From: Alejandro Colomar Date: Sat, 2 Sep 2023 14:14:03 +0000 (+0200) Subject: src/gpasswd.c: Move if out of cpp conditional X-Git-Tag: 4.15.0-rc1~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccc055d9d94f07e193542fecc5c6ec535f9d3f97;p=thirdparty%2Fshadow.git src/gpasswd.c: Move if out of cpp conditional This simplifies the code a little bit, and prepares for the next commits, which will clean up further. Signed-off-by: Alejandro Colomar --- diff --git a/src/gpasswd.c b/src/gpasswd.c index 70002eb1d..edc2af69c 100644 --- a/src/gpasswd.c +++ b/src/gpasswd.c @@ -710,7 +710,7 @@ static void check_perms (const struct group *gr) } } else #endif /* SHADOWGRP */ - { + if (!amroot) { #ifdef FIRST_MEMBER_IS_ADMIN /* * The policy here for changing a group is that @@ -726,19 +726,13 @@ static void check_perms (const struct group *gr) * first group member might be just a normal user. * --marekm */ - if (!amroot) { - if (gr->gr_mem[0] == NULL) { - failure (); - } + if (gr->gr_mem[0] == NULL) + failure(); - if (strcmp (gr->gr_mem[0], myname) != 0) { - failure (); - } - } + if (strcmp(gr->gr_mem[0], myname) != 0) + failure(); #else /* ! FIRST_MEMBER_IS_ADMIN */ - if (!amroot) { - failure (); - } + failure(); #endif } }