]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
sec_ctx.c: Fix -Wunused-function warning on macOS
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Wed, 8 Sep 2021 12:27:41 +0000 (13:27 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 13 Oct 2021 01:42:35 +0000 (01:42 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14862

Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/sec_ctx.c

index 4ccda7095284be0505661c3beec43b7992db827c..56fdf1fe4761bffef06cc74e5cef53ddcd10fbe5 100644 (file)
@@ -92,15 +92,6 @@ static bool become_gid(gid_t gid)
        return True;
 }
 
-/****************************************************************************
- Become the specified uid and gid.
-****************************************************************************/
-
-static bool become_id(uid_t uid, gid_t gid)
-{
-       return become_gid(gid) && become_uid(uid);
-}
-
 /****************************************************************************
  Drop back to root privileges in order to change to another user.
 ****************************************************************************/
@@ -237,12 +228,19 @@ bool push_sec_ctx(void)
        return True;
 }
 
+#ifndef HAVE_DARWIN_INITGROUPS
 /****************************************************************************
Change UNIX security context. Calls panic if not successful so no return value.
Become the specified uid and gid.
 ****************************************************************************/
 
-#ifndef HAVE_DARWIN_INITGROUPS
+static bool become_id(uid_t uid, gid_t gid)
+{
+       return become_gid(gid) && become_uid(uid);
+}
 
+/****************************************************************************
+ Change UNIX security context. Calls panic if not successful so no return value.
+****************************************************************************/
 /* Normal credential switch path. */
 
 static void set_unix_security_ctx(uid_t uid, gid_t gid, int ngroups, gid_t *groups)