From: Alex Richardson Date: Wed, 8 Sep 2021 12:27:41 +0000 (+0100) Subject: sec_ctx.c: Fix -Wunused-function warning on macOS X-Git-Tag: ldb-2.5.0~481 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6dadf251fc02c2b3237c48d316f5cb8791ab4f76;p=thirdparty%2Fsamba.git sec_ctx.c: Fix -Wunused-function warning on macOS BUG: https://bugzilla.samba.org/show_bug.cgi?id=14862 Signed-off-by: Alex Richardson Reviewed-by: Andrew Bartlett Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/sec_ctx.c b/source3/smbd/sec_ctx.c index 4ccda709528..56fdf1fe476 100644 --- a/source3/smbd/sec_ctx.c +++ b/source3/smbd/sec_ctx.c @@ -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)