summaryrefslogtreecommitdiff
path: root/source3/lib/util_sec.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util_sec.c')
-rw-r--r--source3/lib/util_sec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c
index 26be27ea51..c13b20ec92 100644
--- a/source3/lib/util_sec.c
+++ b/source3/lib/util_sec.c
@@ -52,10 +52,16 @@ static gid_t initial_gid;
remember what uid we got started as - this allows us to run correctly
as non-root while catching trapdoor systems
****************************************************************************/
+
void sec_init(void)
{
- initial_uid = geteuid();
- initial_gid = getegid();
+ static int initialized;
+
+ if (!initialized) {
+ initial_uid = geteuid();
+ initial_gid = getegid();
+ initialized = 1;
+ }
}
/****************************************************************************