summaryrefslogtreecommitdiffstats
path: root/provision.inc
diff options
context:
space:
mode:
authorAntoine Beaupré2010-07-19 16:20:16 (GMT)
committeranarcat2010-07-20 01:07:19 (GMT)
commit37eb51ec372325b2ef025fe4b689645518621d9f (patch)
tree847dec048b1e150e9908b0656b744a9e1d8b2c8c /provision.inc
parent68c205c01df58c41374c26664aab73d672aef5cf (diff)
don't use get_current_user() to figure out the aegir user, but rely on the running uid instead
Diffstat (limited to 'provision.inc')
-rw-r--r--provision.inc17
1 files changed, 17 insertions, 0 deletions
diff --git a/provision.inc b/provision.inc
index 2a76134..2f40bcb 100644
--- a/provision.inc
+++ b/provision.inc
@@ -171,6 +171,23 @@ function provision_shell_exec() {
}
/**
+ * Find the username of the current running procses
+ *
+ * This will return the username of the current running user (as seen
+ * from posix_geteuid()) and should be used instead of
+ * get_current_user() (which looks at the file owner instead).
+ *
+ * @see get_current_user()
+ * @see posix_geteuid()
+ *
+ * @return
+ * String. The username.
+ */
+function provision_current_user() {
+ return provision_posix_username(posix_geteuid());
+}
+
+/**
* Check whether a user is a member of a group.
*
* @param user