]> granicus.if.org Git - shadow/commitdiff
* Merge two is_shadowgrp blocks.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Wed, 6 Aug 2008 15:55:57 +0000 (15:55 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Wed, 6 Aug 2008 15:55:57 +0000 (15:55 +0000)
 * Indicate that we continue when *_unlock fail

src/gpasswd.c

index f01e570b5962552f87f213c1ab933a33044b0c90..f76672036c2538646c77b5a31c313956506e5120 100644 (file)
@@ -438,17 +438,17 @@ static void close_files (void)
                fail_exit (1);
        }
 #ifdef SHADOWGRP
-       if (is_shadowgrp && (sgr_close () == 0)) {
-               fprintf (stderr, _("%s: cannot rewrite the shadow group file\n"), Prog);
-               SYSLOG ((LOG_WARN, "cannot rewrite the shadow group file"));
+       if (is_shadowgrp) {
+               if (sgr_close () == 0) {
+                       fprintf (stderr, _("%s: cannot rewrite the shadow group file\n"), Prog);
+                       SYSLOG ((LOG_WARN, "cannot rewrite the shadow group file"));
 #ifdef WITH_AUDIT
-               audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
-                             "rewriting /etc/gshadow",
-                             group, AUDIT_NO_ID, 0);
+                       audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
+                                     "rewriting /etc/gshadow",
+                                     group, AUDIT_NO_ID, 0);
 #endif
-               fail_exit (1);
-       }
-       if (is_shadowgrp) {
+                       fail_exit (1);
+               }
                if (sgr_unlock () == 0) {
                        fprintf (stderr, _("%s: cannot unlock the shadow group file\n"), Prog);
                        SYSLOG ((LOG_WARN, "cannot unlock the shadow group file"));
@@ -457,6 +457,7 @@ static void close_files (void)
                                      "unlocking gshadow file",
                                      group, AUDIT_NO_ID, 0);
 #endif
+                       /* continue */
                }
                gshadow_locked = false;
        }
@@ -469,6 +470,7 @@ static void close_files (void)
                              "unlocking group file",
                              group, AUDIT_NO_ID, 0);
 #endif
+               /* continue */
        }
        group_locked = false;
 }