* 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.
This commit is contained in:
nekral-guest
2008-08-22 02:22:34 +00:00
parent 82ed690817
commit 82779cd336
16 changed files with 151 additions and 146 deletions

View File

@ -68,10 +68,10 @@
*/
#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"),