From: Volker Lendecke Date: Fri, 9 Jan 2026 09:45:40 +0000 (+0100) Subject: lib: Reduce indentation with an early return X-Git-Tag: tdb-1.4.15~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2058d52573ba34962530c030d533de19b02ae86f;p=thirdparty%2Fsamba.git lib: Reduce indentation with an early return Review with "git show -w" Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/lib/util_sec.c b/source3/lib/util_sec.c index 8fe0efa0bf4..73d1314b17e 100644 --- a/source3/lib/util_sec.c +++ b/source3/lib/util_sec.c @@ -60,27 +60,28 @@ as non-root while catching trapdoor systems void sec_init(void) { - static int initialized; + static bool initialized = false; - if (!initialized) { + if (initialized) { + return; + } #ifndef AUTOCONF_TEST - if (uid_wrapper_enabled()) { - setenv("UID_WRAPPER_MYUID", "1", 1); - } + if (uid_wrapper_enabled()) { + setenv("UID_WRAPPER_MYUID", "1", 1); + } #endif - initial_uid = geteuid(); - initial_gid = getegid(); + initial_uid = geteuid(); + initial_gid = getegid(); #ifndef AUTOCONF_TEST - if (uid_wrapper_enabled()) { - unsetenv("UID_WRAPPER_MYUID"); - } + if (uid_wrapper_enabled()) { + unsetenv("UID_WRAPPER_MYUID"); + } #endif - initialized = 1; - } + initialized = true; } /****************************************************************************