From: Alan T. DeKok Date: Fri, 29 May 2015 16:09:35 +0000 (-0400) Subject: nitgroups only when changing UIDs X-Git-Tag: release_3_0_9~310 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4e206697f78dd920b365c02b816c4b5acee3788;p=thirdparty%2Ffreeradius-server.git nitgroups only when changing UIDs --- diff --git a/src/main/mainconfig.c b/src/main/mainconfig.c index a5552cd9cf7..b60f0c6c962 100644 --- a/src/main/mainconfig.c +++ b/src/main/mainconfig.c @@ -486,16 +486,16 @@ static int switch_users(CONF_SECTION *cs) if (server_uid != user->pw_uid) { server_uid = user->pw_uid; do_suid = true; - } - #ifdef HAVE_INITGROUPS - if (initgroups(uid_name, server_gid) < 0) { - fprintf(stderr, "%s: Cannot initialize supplementary group list for user %s: %s\n", - progname, uid_name, fr_syserror(errno)); - talloc_free(user); - return 0; - } + if (initgroups(uid_name, server_gid) < 0) { + fprintf(stderr, "%s: Cannot initialize supplementary group list for user %s: %s\n", + progname, uid_name, fr_syserror(errno)); + talloc_free(user); + return 0; + } #endif + } + talloc_free(user); }