diff --git a/src/usermod.c b/src/usermod.c index 30f47b8a..7b1e0581 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -801,21 +801,21 @@ free_ngrp: static void update_gshadow_file(void) { - bool changed; const struct sgrp *sgrp; - changed = false; - /* * Scan through the entire shadow group file looking for the groups * that the user is a member of. */ while ((sgrp = sgr_next ()) != NULL) { + bool changed; bool is_member; bool was_member; bool was_admin; struct sgrp *nsgrp; + changed = false; + /* * See if the user was a member of this group */ @@ -924,8 +924,6 @@ update_gshadow_file(void) if (!changed) goto free_nsgrp; - changed = false; - /* * Update the group entry to reflect the changes. */