uwrap: Small optimalization of uwrap_init().
authorRobin Hack <hack.robin@gmail.com>
Fri, 23 Jan 2015 14:15:42 +0000 (15:15 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 28 Jan 2015 16:17:07 +0000 (17:17 +0100)
Don't call getenv("UID_WRAPPER") on start of uwrap_init().

Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/uid_wrapper/uid_wrapper.c

index aa3f30212a843a4db272d28aed2a86a5689c204b..187cc113862900587c88bf45ec828ceb26aa6d51 100644 (file)
@@ -572,7 +572,7 @@ static void uwrap_thread_child(void)
 
 static void uwrap_init(void)
 {
-       const char *env = getenv("UID_WRAPPER");
+       const char *env;
        pthread_t tid = pthread_self();
 
        UWRAP_LOCK(uwrap_id);
@@ -607,6 +607,7 @@ static void uwrap_init(void)
        uwrap.initialised = true;
        uwrap.enabled = false;
 
+       env = getenv("UID_WRAPPER");
        if (env != NULL && env[0] == '1') {
                const char *root = getenv("UID_WRAPPER_ROOT");
                int rc;