diff options
author | Andreas Schneider <asn@samba.org> | 2015-10-30 14:31:33 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2015-11-05 09:23:15 +0100 |
commit | 6361063995ed457a6005eb048eef2c55f1b8ae87 (patch) | |
tree | e185fafabd2c78166452e546555b22596f009ff5 | |
parent | 77eb8e0a4b83d46d854337dbf4f6ace76d557e85 (diff) | |
download | samba-6361063995ed457a6005eb048eef2c55f1b8ae87.tar.gz |
s3-lib: Get the real initial uid for selftest
We need this that if we connect as the user who started smbd, we are
able to perform privileged operation like creating a user.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | source3/lib/util_sec.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c index 9ccd04e24ad..760f8b06906 100644 --- a/source3/lib/util_sec.c +++ b/source3/lib/util_sec.c @@ -60,8 +60,22 @@ void sec_init(void) static int initialized; if (!initialized) { + +#ifndef AUTOCONF_TEST + if (uid_wrapper_enabled()) { + setenv("UID_WRAPPER_MYUID", "1", 1); + } +#endif + initial_uid = geteuid(); initial_gid = getegid(); + +#ifndef AUTOCONF_TEST + if (uid_wrapper_enabled()) { + unsetenv("UID_WRAPPER_MYUID"); + } +#endif + initialized = 1; } } |