]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
* src/chfn.c, src/chgpasswd.c, src/chpasswd.c, src/gpasswd.c,
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 22 Aug 2008 02:22:34 +0000 (02:22 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 22 Aug 2008 02:22:34 +0000 (02:22 +0000)
src/groupadd.c, src/groupdel.c, src/groupmems.c, src/groupmod.c,
src/grpconv.c, src/grpunconv.c, src/newusers.c, src/pwconv.c,
src/pwunconv.c, src/useradd.c, src/userdel.c: Harmonize the name
of the variables keeping the lock status, to match the shadow
library prefixes.

16 files changed:
ChangeLog
src/chfn.c
src/chgpasswd.c
src/chpasswd.c
src/gpasswd.c
src/groupadd.c
src/groupdel.c
src/groupmems.c
src/groupmod.c
src/grpconv.c
src/grpunconv.c
src/newusers.c
src/pwconv.c
src/pwunconv.c
src/useradd.c
src/userdel.c

index a80f612affe04cf15a9e1b0bed347514691cc2ab..cc04f21c05c92ccfa2a58132236bca81a802fef3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-08-17  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/chfn.c, src/chgpasswd.c, src/chpasswd.c, src/gpasswd.c,
+       src/groupadd.c, src/groupdel.c, src/groupmems.c, src/groupmod.c,
+       src/grpconv.c, src/grpunconv.c, src/newusers.c, src/pwconv.c,
+       src/pwunconv.c, src/useradd.c, src/userdel.c: Harmonize the name
+       of the variables keeping the lock status, to match the shadow
+       library prefixes.
+
 2008-08-17  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/chage.c, src/chgpasswd.c, src/chpasswd.c, src/chsh.c,
index f211b3627290bce0b26ee01a72a4a019cd9bb98f..d757c9e6d27b90bf06b1c1aff883ccfaa28ccd64 100644 (file)
@@ -72,7 +72,7 @@ static bool oflg = false;             /* -o - set other information        */
 #ifdef USE_PAM
 static pam_handle_t *pamh = NULL;
 #endif
-static bool passwd_locked = false;
+static bool pw_locked = false;
 
 /*
  * External identifiers
@@ -94,14 +94,14 @@ static void get_old_fields (const char *gecos);
  */
 static void fail_exit (int code)
 {
-       if (passwd_locked) {
+       if (pw_locked) {
                if (pw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
                        /* continue */
                }
        }
-       passwd_locked = false;
+       pw_locked = false;
 
        closelog ();
 
@@ -442,7 +442,7 @@ static void update_gecos (const char *user, char *gecos)
                         Prog, pw_dbname ());
                fail_exit (E_NOPERM);
        }
-       passwd_locked = true;
+       pw_locked = true;
        if (pw_open (O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"), Prog, pw_dbname ());
@@ -487,7 +487,7 @@ static void update_gecos (const char *user, char *gecos)
                SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
                fail_exit (E_NOPERM);
        }
-       passwd_locked = false; /* If we fail to unlock, do not retry */
+       pw_locked = false; /* If we fail to unlock, do not retry */
        if (pw_unlock () == 0) {
                fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
index 4fb02b0b8b2bbf7db0b1be4846b2de130d718fa2..eec869d107238d42ffc80322dab3ebfee2a6767e 100644 (file)
@@ -64,9 +64,9 @@ static long sha_rounds = 5000;
 
 #ifdef SHADOWGRP
 static bool is_shadow_grp;
-static bool gshadow_locked = false;
+static bool sgr_locked = false;
 #endif
-static bool group_locked = false;
+static bool gr_locked = false;
 
 #ifdef USE_PAM
 static pam_handle_t *pamh = NULL;
@@ -86,7 +86,7 @@ static void close_files (void);
  */
 static void fail_exit (int code)
 {
-       if (group_locked) {
+       if (gr_locked) {
                if (gr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
@@ -95,7 +95,7 @@ static void fail_exit (int code)
        }
 
 #ifdef SHADOWGRP
-       if (gshadow_locked) {
+       if (sgr_locked) {
                if (sgr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
@@ -294,7 +294,7 @@ static void open_files (void)
                         Prog, gr_dbname ());
                fail_exit (1);
        }
-       group_locked = true;
+       gr_locked = true;
        if (gr_open (O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"), Prog, gr_dbname ());
@@ -310,7 +310,7 @@ static void open_files (void)
                                 Prog, sgr_dbname ());
                        fail_exit (1);
                }
-               gshadow_locked = true;
+               sgr_locked = true;
                if (sgr_open (O_RDWR) == 0) {
                        fprintf (stderr, _("%s: cannot open %s\n"),
                                 Prog, sgr_dbname ());
@@ -339,7 +339,7 @@ static void close_files (void)
                        SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
                        /* continue */
                }
-               gshadow_locked = false;
+               sgr_locked = false;
        }
 #endif
 
@@ -355,7 +355,7 @@ static void close_files (void)
                SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
                /* continue */
        }
-       group_locked = false;
+       gr_locked = false;
 }
 
 int main (int argc, char **argv)
index 136bf6b68623ad6d109a2a5b33a944070e3161c0..5393683bf1c4a91286be00edf18a51fea0ba059a 100644 (file)
@@ -61,8 +61,8 @@ static const char *crypt_method = NULL;
 static long sha_rounds = 5000;
 
 static bool is_shadow_pwd;
-static bool passwd_locked = false;
-static bool shadow_locked = false;
+static bool pw_locked = false;
+static bool spw_locked = false;
 
 #ifdef USE_PAM
 static pam_handle_t *pamh = NULL;
@@ -82,7 +82,7 @@ static void close_files (void);
  */
 static void fail_exit (int code)
 {
-       if (passwd_locked) {
+       if (pw_locked) {
                if (pw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
@@ -90,7 +90,7 @@ static void fail_exit (int code)
                }
        }
 
-       if (shadow_locked) {
+       if (spw_locked) {
                if (spw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
@@ -288,7 +288,7 @@ static void open_files (void)
                         Prog, pw_dbname ());
                fail_exit (1);
        }
-       passwd_locked = true;
+       pw_locked = true;
        if (pw_open (O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"), Prog, pw_dbname ());
@@ -303,7 +303,7 @@ static void open_files (void)
                                 Prog, spw_dbname ());
                        fail_exit (1);
                }
-               shadow_locked = true;
+               spw_locked = true;
                if (spw_open (O_RDWR) == 0) {
                        fprintf (stderr,
                                 _("%s: cannot open %s\n"),
@@ -331,7 +331,7 @@ static void close_files (void)
                        SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
                        /* continue */
                }
-               shadow_locked = false;
+               spw_locked = false;
        }
 
        if (pw_close () == 0) {
@@ -346,7 +346,7 @@ static void close_files (void)
                SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
                /* continue */
        }
-       passwd_locked = false;
+       pw_locked = false;
 }
 
 int main (int argc, char **argv)
index 2a087488d0ed4182270c4233c07b431a6510821d..ba11e7b1fd8775b221251f674801190457e40be2 100644 (file)
@@ -59,9 +59,9 @@ static char *Prog;
 /* Indicate if shadow groups are enabled on the system
  * (/etc/gshadow present) */
 static bool is_shadowgrp;
-static bool gshadow_locked = false;
+static bool sgr_locked = false;
 #endif
-static bool group_locked = false;
+static bool gr_locked = false;
 
 /* Flags set by options */
 static bool aflg = false;
@@ -160,7 +160,7 @@ static RETSIGTYPE catch_signals (int killed)
  */
 static void fail_exit (int status)
 {
-       if (group_locked) {
+       if (gr_locked) {
                if (gr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
@@ -172,7 +172,7 @@ static void fail_exit (int status)
                }
        }
 #ifdef SHADOWGRP
-       if (gshadow_locked) {
+       if (sgr_locked) {
                if (sgr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
@@ -378,7 +378,7 @@ static void open_files (void)
 #endif
                fail_exit (1);
        }
-       group_locked = true;
+       gr_locked = true;
 #ifdef SHADOWGRP
        if (is_shadowgrp) {
                if (sgr_lock () == 0) {
@@ -392,7 +392,7 @@ static void open_files (void)
 #endif
                        fail_exit (1);
                }
-               gshadow_locked = true;
+               sgr_locked = true;
        }
 #endif
        if (gr_open (O_RDWR) == 0) {
@@ -460,7 +460,7 @@ static void close_files (void)
 #endif
                        /* continue */
                }
-               gshadow_locked = false;
+               sgr_locked = false;
        }
 #endif
        if (gr_unlock () == 0) {
@@ -473,7 +473,7 @@ static void close_files (void)
 #endif
                /* continue */
        }
-       group_locked = false;
+       gr_locked = false;
 }
 
 /*
index 25e94009389f434c308000622ca46137eb678d1e..0cd799d126c22508d5df85ed610962af57b9c825 100644 (file)
@@ -83,9 +83,9 @@ static bool pflg = false;     /* new encrypted password */
 
 #ifdef SHADOWGRP
 static bool is_shadow_grp;
-static bool gshadow_locked = false;
+static bool sgr_locked = false;
 #endif
-static bool group_locked = false;
+static bool gr_locked = false;
 
 
 #ifdef USE_PAM
@@ -266,7 +266,7 @@ static void close_files (void)
 #endif
                /* continue */
        }
-       group_locked = false;
+       gr_locked = false;
 #ifdef SHADOWGRP
        if (is_shadow_grp) {
                if (sgr_close () == 0) {
@@ -285,7 +285,7 @@ static void close_files (void)
 #endif
                        /* continue */
                }
-               gshadow_locked = false;
+               sgr_locked = false;
        }
 #endif                         /* SHADOWGRP */
 }
@@ -308,7 +308,7 @@ static void open_files (void)
 #endif
                fail_exit (E_GRP_UPDATE);
        }
-       group_locked = true;
+       gr_locked = true;
        if (gr_open (O_RDWR) == 0) {
                fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
                SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
@@ -332,7 +332,7 @@ static void open_files (void)
 #endif
                        fail_exit (E_GRP_UPDATE);
                }
-               gshadow_locked = true;
+               sgr_locked = true;
                if (sgr_open (O_RDWR) == 0) {
                        fprintf (stderr,
                                 _("%s: cannot open %s\n"), Prog, sgr_dbname ());
@@ -353,7 +353,7 @@ static void open_files (void)
  */
 static void fail_exit (int code)
 {
-       if (group_locked) {
+       if (gr_locked) {
                if (gr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
@@ -366,7 +366,7 @@ static void fail_exit (int code)
                }
        }
 #ifdef SHADOWGRP
-       if (gshadow_locked) {
+       if (sgr_locked) {
                if (sgr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
index 1d10aedd2bd2e9ec3a8e53270a6c865feb767521..08effa28a53fc3d99811d4be198370407a10b82c 100644 (file)
@@ -59,9 +59,9 @@ static gid_t group_id = -1;
 
 #ifdef SHADOWGRP
 static bool is_shadow_grp;
-static bool gshadow_locked = false;
+static bool sgr_locked = false;
 #endif
-static bool group_locked = false;
+static bool gr_locked = false;
 
 /*
  * exit status values
@@ -94,7 +94,7 @@ static void usage (void)
  */
 static void fail_exit (int code)
 {
-       if (group_locked) {
+       if (gr_locked) {
                if (gr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
@@ -107,7 +107,7 @@ static void fail_exit (int code)
                }
        }
 #ifdef SHADOWGRP
-       if (gshadow_locked) {
+       if (sgr_locked) {
                if (sgr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
@@ -189,7 +189,7 @@ static void close_files (void)
 #endif
                /* continue */
        }
-       group_locked = false;
+       gr_locked = false;
 #ifdef SHADOWGRP
        if (is_shadow_grp) {
                if (sgr_close () == 0)) {
@@ -208,7 +208,7 @@ static void close_files (void)
 #endif
                        /* continue */
                }
-               gshadow_locked = false;
+               sgr_locked = false;
        }
 #endif                         /* SHADOWGRP */
 }
@@ -226,7 +226,7 @@ static void open_files (void)
                         Prog, gr_dbname ());
                fail_exit (E_GRP_UPDATE);
        }
-       group_locked = true;
+       gr_locked = true;
        if (gr_open (O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"), Prog, gr_dbname ());
@@ -241,7 +241,7 @@ static void open_files (void)
                                 Prog, sgr_dbname ());
                        fail_exit (E_GRP_UPDATE);
                }
-               gshadow_locked = true;
+               sgr_locked = true;
                if (sgr_open (O_RDWR) == 0)) {
                        fprintf (stderr,
                                 _("%s: cannot open %s\n"),
index 5d26977a6e9e08beacf543c2c0903e0c9dbc3245..7e9582018757daa6c9aab699e44198e5a18064b8 100644 (file)
@@ -68,7 +68,7 @@ static bool purge = false;
 static bool list = false;
 static int exclusive = 0;
 static char *Prog;
-static bool group_locked = false;
+static bool gr_locked = false;
 
 static char *whoami (void);
 static void display_members (char **members);
@@ -205,7 +205,7 @@ static void check_perms (void)
 
 static void fail_exit (int code)
 {
-       if (group_locked) {
+       if (gr_locked) {
                if (gr_unlock () == 0) {
                        fprintf (stderr,
                                 _("%s: failed to unlock %s\n"),
@@ -258,7 +258,7 @@ int main (int argc, char **argv)
                                 Prog, gr_dbname ());
                        fail_exit (EXIT_GROUP_FILE);
                }
-               group_locked = true;
+               gr_locked = true;
        }
 
        if (gr_open (list ? O_RDONLY : O_RDWR) == 0) {
index cc31a218cc728c58803963336c19ec2762d75ff6..3424053cfb069ac733c9639aa0acbf0ee44fb22b 100644 (file)
  */
 #ifdef SHADOWGRP
 static bool is_shadow_grp;
-static bool gshadow_locked = false;
+static bool sgr_locked = false;
 #endif                         /* SHADOWGRP */
-static bool group_locked = false;
-static bool passwd_locked = false;
+static bool gr_locked = false;
+static bool pw_locked = false;
 static char *group_name;
 static char *group_newname;
 static char *group_passwd;
@@ -123,7 +123,7 @@ static void usage (void)
 
 static void fail_exit (int status)
 {
-       if (group_locked) {
+       if (gr_locked) {
                if (gr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
@@ -136,7 +136,7 @@ static void fail_exit (int status)
                }
        }
 #ifdef SHADOWGRP
-       if (gshadow_locked) {
+       if (sgr_locked) {
                if (sgr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
@@ -149,7 +149,7 @@ static void fail_exit (int status)
                }
        }
 #endif                         /* SHADOWGRP */
-       if (passwd_locked) {
+       if (pw_locked) {
                if (pw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", pw_dbname ()));
@@ -525,7 +525,7 @@ static void close_files (void)
 #endif
                /* continue */
        }
-       group_locked = false;
+       gr_locked = false;
 #ifdef SHADOWGRP
        if (is_shadow_grp) {
                if (sgr_close () == 0)) {
@@ -549,7 +549,7 @@ static void close_files (void)
 #endif
                        /* continue */
                }
-               gshadow_locked = false;
+               sgr_locked = false;
        }
 #endif                         /* SHADOWGRP */
        if (gflg) {
@@ -574,7 +574,7 @@ static void close_files (void)
 #endif
                        /* continue */
                }
-               passwd_locked = false;
+               pw_locked = false;
        }
 }
 
@@ -591,7 +591,7 @@ static void open_files (void)
                         Prog, gr_dbname ());
                fail_exit (E_GRP_UPDATE);
        }
-       group_locked = true;
+       gr_locked = true;
        if (gr_open (O_RDWR) == 0) {
                fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
                SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
@@ -605,7 +605,7 @@ static void open_files (void)
                                 Prog, sgr_dbname ());
                        fail_exit (E_GRP_UPDATE);
                }
-               gshadow_locked = true;
+               sgr_locked = true;
                if (sgr_open (O_RDWR) == 0) {
                        fprintf (stderr,
                                 _("%s: cannot open %s\n"),
@@ -622,7 +622,7 @@ static void open_files (void)
                                 Prog, pw_dbname ());
                        fail_exit (E_GRP_UPDATE);
                }
-               passwd_locked = true;
+               pw_locked = true;
                if (pw_open (O_RDWR) == 0) {
                        fprintf (stderr,
                                 _("%s: cannot open %s\n"),
index beb31574c4ae6b31eed8196fce50937a3b970563..4f77bbfccd896560f47589158a03ed668427fa7b 100644 (file)
 /*
  * Global variables
  */
-static bool group_locked   = false;
-static bool gshadow_locked = false;
+static bool gr_locked   = false;
+static bool sgr_locked = false;
 
 /* local function prototypes */
 static void fail_exit (int);
 
 static void fail_exit (int status)
 {
-       if (group_locked) {
+       if (gr_locked) {
                gr_unlock ();
        }
-       if (gshadow_locked) {
+       if (sgr_locked) {
                sgr_unlock ();
        }
        exit (status);
@@ -88,7 +88,7 @@ int main (int argc, char **argv)
                         Prog, gr_dbname ());
                fail_exit (5);
        }
-       group_locked = true;
+       gr_locked = true;
        if (gr_open (O_RDWR) == 0) {
                fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
                fail_exit (1);
@@ -100,7 +100,7 @@ int main (int argc, char **argv)
                         Prog, sgr_dbname ());
                fail_exit (5);
        }
-       gshadow_locked = true;
+       sgr_locked = true;
        if (sgr_open (O_CREAT | O_RDWR) == 0) {
                fprintf (stderr, _("%s: cannot open %s\n"), Prog, sgr_dbname ());
                fail_exit (1);
index cb88f9d469395c1716a0e2246c4f6eb3a4f8a6ef..ea9d463402e6e8a02b01a9f98763ccd249b58166 100644 (file)
 /*
  * Global variables
  */
-static bool group_locked   = false;
-static bool gshadow_locked = false;
+static bool gr_locked   = false;
+static bool sgr_locked = false;
 
 /* local function prototypes */
 static void fail_exit (int status);
 
 static void fail_exit (int status)
 {
-       if (group_locked) {
+       if (gr_locked) {
                if (gr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
@@ -70,7 +70,7 @@ static void fail_exit (int status)
                }
        }
 
-       if (gshadow_locked) {
+       if (sgr_locked) {
                if (sgr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
@@ -102,7 +102,7 @@ int main (int argc, char **argv)
                         Prog, gr_dbname ());
                fail_exit (5);
        }
-       group_locked = true;
+       gr_locked = true;
        if (gr_open (O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"), Prog, gr_dbname ());
@@ -115,7 +115,7 @@ int main (int argc, char **argv)
                         Prog, sgr_dbname ());
                fail_exit (5);
        }
-       gshadow_locked = true;
+       sgr_locked = true;
        if (sgr_open (O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"), Prog, sgr_dbname ());
@@ -164,20 +164,16 @@ int main (int argc, char **argv)
                fail_exit (3);
        }
 
-       if (group_locked) {
-               if (gr_unlock () == 0) {
-                       fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
-                       SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
-                       /* continue */
-               }
+       if (gr_unlock () == 0) {
+               fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
+               SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+               /* continue */
        }
 
-       if (gshadow_locked) {
-               if (sgr_unlock () == 0) {
-                       fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
-                       SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
-                       /* continue */
-               }
+       if (sgr_unlock () == 0) {
+               fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
+               SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+               /* continue */
        }
 
        nscd_flush_cache ("group");
index eacfdfd614c3dc6e65bcce6cf06df6cefcf45759..7e3202614150b701f34ce672ae2c05fccbca4790 100644 (file)
@@ -76,11 +76,11 @@ static long sha_rounds = 5000;
 static bool is_shadow;
 #ifdef SHADOWGRP
 static bool is_shadow_grp;
-static bool gshadow_locked = false;
+static bool sgr_locked = false;
 #endif
-static bool passwd_locked = false;
-static bool group_locked = false;
-static bool shadow_locked = false;
+static bool pw_locked = false;
+static bool gr_locked = false;
+static bool spw_locked = false;
 
 #ifdef USE_PAM
 static pam_handle_t *pamh = NULL;
@@ -128,21 +128,21 @@ static void usage (void)
  */
 static void fail_exit (int code)
 {
-       if (shadow_locked) {
+       if (spw_locked) {
                if (spw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
                        /* continue */
                }
        }
-       if (passwd_locked) {
+       if (pw_locked) {
                if (pw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
                        /* continue */
                }
        }
-       if (group_locked) {
+       if (gr_locked) {
                if (gr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
@@ -150,7 +150,7 @@ static void fail_exit (int code)
                }
        }
 #ifdef SHADOWGRP
-       if (gshadow_locked) {
+       if (sgr_locked) {
                if (sgr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
@@ -613,21 +613,21 @@ static void open_files (void)
                         Prog, pw_dbname ());
                fail_exit (1);
        }
-       passwd_locked = true;
+       pw_locked = true;
        if (is_shadow && (spw_lock () == 0)) {
                fprintf (stderr,
                         _("%s: cannot lock %s; try again later.\n"),
                         Prog, spw_dbname ());
                fail_exit (1);
        }
-       shadow_locked = true;
+       spw_locked = true;
        if (gr_lock () == 0) {
                fprintf (stderr,
                         _("%s: cannot lock %s; try again later.\n"),
                         Prog, gr_dbname ());
                fail_exit (1);
        }
-       group_locked = true;
+       gr_locked = true;
 #ifdef SHADOWGRP
        if (is_shadow_grp && (sgr_lock () == 0)) {
                fprintf (stderr,
@@ -635,7 +635,7 @@ static void open_files (void)
                         Prog, sgr_dbname ());
                fail_exit (1);
        }
-       gshadow_locked = true;
+       sgr_locked = true;
 #endif
 
        if (pw_open (O_RDWR) == 0) {
@@ -673,7 +673,7 @@ static void close_files (void)
                SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
                /* continue */
        }
-       passwd_locked = false;
+       pw_locked = false;
 
        if (is_shadow) {
                if (spw_close () == 0) {
@@ -690,7 +690,7 @@ static void close_files (void)
                        SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
                        /* continue */
                }
-               shadow_locked = false;
+               spw_locked = false;
        }
 
        if (gr_close () == 0) {
@@ -707,7 +707,7 @@ static void close_files (void)
                SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
                /* continue */
        }
-       group_locked = false;
+       gr_locked = false;
 
 #ifdef SHADOWGRP
        if (is_shadow_grp) {
@@ -725,7 +725,7 @@ static void close_files (void)
                        SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
                        /* continue */
                }
-               gshadow_locked = false;
+               sgr_locked = false;
        }
 #endif
 }
index 81478bdbcfc95fa0249e2502981a2aaeaa84be9a..1e751ea6b289eeb89842e1b384cee9989ac6aca8 100644 (file)
  * Global variables
  */
 static char *Prog;
-static bool shadow_locked = false;
-static bool passwd_locked = false;
+static bool spw_locked = false;
+static bool pw_locked = false;
 
 /* local function prototypes */
 static void fail_exit (int status);
 
 static void fail_exit (int status)
 {
-       if (passwd_locked) {
+       if (pw_locked) {
                if (pw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
@@ -100,7 +100,7 @@ static void fail_exit (int status)
                }
        }
 
-       if (shadow_locked) {
+       if (spw_locked) {
                if (spw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
@@ -131,7 +131,7 @@ int main (int argc, char **argv)
                         Prog, pw_dbname ());
                fail_exit (E_PWDBUSY);
        }
-       passwd_locked = true;
+       pw_locked = true;
        if (pw_open (O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"), Prog, pw_dbname ());
@@ -144,7 +144,7 @@ int main (int argc, char **argv)
                         Prog, spw_dbname ());
                fail_exit (E_PWDBUSY);
        }
-       shadow_locked = true;
+       spw_locked = true;
        if (spw_open (O_CREAT | O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"), Prog, spw_dbname ());
@@ -242,7 +242,7 @@ int main (int argc, char **argv)
                /* continue */
        }
 
-       if (passwd_locked) {
+       if (pw_locked) {
                if (pw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
@@ -250,7 +250,7 @@ int main (int argc, char **argv)
                }
        }
 
-       if (shadow_locked) {
+       if (spw_locked) {
                if (spw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
index 562c151a9661f15e3594007551dd455c7a2b7382..a4896577b61657acdce316af7dd7d0db9392379f 100644 (file)
  * Global variables
  */
 static char *Prog;
-static bool shadow_locked = false;
-static bool passwd_locked = false;
+static bool spw_locked = false;
+static bool pw_locked = false;
 
 /* local function prototypes */
 static void fail_exit (int status);
 
 static void fail_exit (int status)
 {
-       if (shadow_locked) {
+       if (spw_locked) {
                if (spw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
                        /* continue */
                }
        }
-       if (passwd_locked) {
+       if (pw_locked) {
                if (pw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
@@ -97,7 +97,7 @@ int main (int argc, char **argv)
                         Prog, pw_dbname ());
                fail_exit (5);
        }
-       passwd_locked = true;
+       pw_locked = true;
        if (pw_open (O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"),
@@ -111,7 +111,7 @@ int main (int argc, char **argv)
                         Prog, spw_dbname ());
                fail_exit (5);
        }
-       shadow_locked = true;
+       spw_locked = true;
        if (spw_open (O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"),
index 83ef0769f20fafbe3051d10ac1920679f418062d..da8ab5c5d088d97ea380bd1092780b6db5c03cc4 100644 (file)
@@ -110,11 +110,11 @@ static bool is_shadow_pwd;
 
 #ifdef SHADOWGRP
 static bool is_shadow_grp;
-static bool gshadow_locked = false;
+static bool sgr_locked = false;
 #endif
-static bool passwd_locked = false;
-static bool group_locked = false;
-static bool shadow_locked = false;
+static bool pw_locked = false;
+static bool gr_locked = false;
+static bool spw_locked = false;
 static char **user_groups;     /* NULL-terminated list */
 static long sys_ngroups;
 static bool do_grp_update = false;     /* group files need to be updated */
@@ -198,7 +198,7 @@ static void fail_exit (int code)
                rmdir (user_home);
        }
 
-       if (shadow_locked) {
+       if (spw_locked) {
                if (spw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", spw_dbname ()));
@@ -210,7 +210,7 @@ static void fail_exit (int code)
                        /* continue */
                }
        }
-       if (passwd_locked) {
+       if (pw_locked) {
                if (pw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", pw_dbname ()));
@@ -222,7 +222,7 @@ static void fail_exit (int code)
                        /* continue */
                }
        }
-       if (group_locked) {
+       if (gr_locked) {
                if (gr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
@@ -235,7 +235,7 @@ static void fail_exit (int code)
                }
        }
 #ifdef SHADOWGRP
-       if (gshadow_locked) {
+       if (sgr_locked) {
                if (sgr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
                        SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
@@ -1278,7 +1278,7 @@ static void close_files (void)
 #endif
                        /* continue */
                }
-               shadow_locked = false;
+               spw_locked = false;
        }
        if (pw_unlock () == 0) {
                fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
@@ -1290,7 +1290,7 @@ static void close_files (void)
 #endif
                /* continue */
        }
-       passwd_locked = false;
+       pw_locked = false;
        if (gr_unlock () == 0) {
                fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
@@ -1301,7 +1301,7 @@ static void close_files (void)
 #endif
                /* continue */
        }
-       group_locked = false;
+       gr_locked = false;
 #ifdef SHADOWGRP
        if (is_shadow_grp) {
                if (sgr_unlock () == 0) {
@@ -1314,7 +1314,7 @@ static void close_files (void)
 #endif
                        /* continue */
                }
-               gshadow_locked = false;
+               sgr_locked = false;
        }
 #endif
 }
@@ -1332,7 +1332,7 @@ static void open_files (void)
                         Prog, pw_dbname ());
                exit (E_PW_UPDATE);
        }
-       passwd_locked = true;
+       pw_locked = true;
        if (pw_open (O_RDWR) == 0) {
                fprintf (stderr, _("%s: cannot open %s\n"), Prog, pw_dbname ());
                fail_exit (E_PW_UPDATE);
@@ -1344,7 +1344,7 @@ static void open_files (void)
                                 Prog, spw_dbname ());
                        fail_exit (E_PW_UPDATE);
                }
-               shadow_locked = true;
+               spw_locked = true;
                if (spw_open (O_RDWR) == 0) {
                        fprintf (stderr,
                                 _("%s: cannot open %s\n"),
@@ -1362,7 +1362,7 @@ static void open_files (void)
                         Prog, gr_dbname ());
                fail_exit (E_GRP_UPDATE);
        }
-       group_locked = true;
+       gr_locked = true;
        if (gr_open (O_RDWR) == 0) {
                fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
                fail_exit (E_GRP_UPDATE);
@@ -1375,7 +1375,7 @@ static void open_files (void)
                                 Prog, sgr_dbname ());
                        fail_exit (E_GRP_UPDATE);
                }
-               gshadow_locked = true;
+               sgr_locked = true;
                if (sgr_open (O_RDWR) == 0) {
                        fprintf (stderr,
                                 _("%s: cannot open %s\n"),
index 1cb8ce5edcdb0858df0e9fa8d40a4f8c53f8d106..dd085bb89b4fface5e68c82324c12f2a29a89fbe 100644 (file)
@@ -80,11 +80,11 @@ static bool is_shadow_pwd;
 
 #ifdef SHADOWGRP
 static bool is_shadow_grp;
-static bool gshadow_locked = false;
+static bool sgr_locked = false;
 #endif
-static bool passwd_locked  = false;
-static bool group_locked   = false;
-static bool shadow_locked  = false;
+static bool pw_locked  = false;
+static bool gr_locked   = false;
+static bool spw_locked  = false;
 
 /* local function prototypes */
 static void usage (void);
@@ -327,7 +327,7 @@ static void close_files (void)
                SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
                /* continue */
        }
-       passwd_locked = false;
+       pw_locked = false;
 
        if (is_shadow_pwd) {
                if (spw_close () == 0) {
@@ -341,7 +341,7 @@ static void close_files (void)
                        SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
                        /* continue */
                }
-               shadow_locked = false;
+               spw_locked = false;
        }
 
        if (gr_close () == 0) {
@@ -354,7 +354,7 @@ static void close_files (void)
                SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
                /* continue */
        }
-       group_locked = false;
+       gr_locked = false;
 
 #ifdef SHADOWGRP
        if (is_shadow_grp) {
@@ -370,7 +370,7 @@ static void close_files (void)
                        SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
                        /* continue */
                }
-               gshadow_locked = false;
+               sgr_locked = false;
        }
 #endif
 }
@@ -380,21 +380,21 @@ static void close_files (void)
  */
 static void fail_exit (int code)
 {
-       if (passwd_locked) {
+       if (pw_locked) {
                if (pw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
                        /* continue */
                }
        }
-       if (group_locked) {
+       if (gr_locked) {
                if (gr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
                        /* continue */
                }
        }
-       if (shadow_locked) {
+       if (spw_locked) {
                if (spw_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
@@ -402,7 +402,7 @@ static void fail_exit (int code)
                }
        }
 #ifdef SHADOWGRP
-       if (gshadow_locked) {
+       if (sgr_locked) {
                if (sgr_unlock () == 0) {
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
@@ -439,7 +439,7 @@ static void open_files (void)
 #endif
                fail_exit (E_PW_UPDATE);
        }
-       passwd_locked = true;
+       pw_locked = true;
        if (pw_open (O_RDWR) == 0) {
                fprintf (stderr,
                         _("%s: cannot open %s\n"), Prog, pw_dbname ());
@@ -462,7 +462,7 @@ static void open_files (void)
 #endif
                        fail_exit (E_PW_UPDATE);
                }
-               shadow_locked = true;
+               spw_locked = true;
                if (spw_open (O_RDWR) == 0) {
                        fprintf (stderr,
                                 _("%s: cannot open %s\n"),
@@ -486,7 +486,7 @@ static void open_files (void)
 #endif
                fail_exit (E_GRP_UPDATE);
        }
-       group_locked = true;
+       gr_locked = true;
        if (gr_open (O_RDWR) == 0) {
                fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
 #ifdef WITH_AUDIT
@@ -509,7 +509,7 @@ static void open_files (void)
 #endif
                        fail_exit (E_GRP_UPDATE);
                }
-               gshadow_locked= true;
+               sgr_locked= true;
                if (sgr_open (O_RDWR) == 0) {
                        fprintf (stderr, _("%s: cannot open %s\n"),
                                 Prog, sgr_dbname ());