* 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:
parent
82ed690817
commit
82779cd336
@ -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>
|
2008-08-17 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* src/chage.c, src/chgpasswd.c, src/chpasswd.c, src/chsh.c,
|
* src/chage.c, src/chgpasswd.c, src/chpasswd.c, src/chsh.c,
|
||||||
|
10
src/chfn.c
10
src/chfn.c
@ -72,7 +72,7 @@ static bool oflg = false; /* -o - set other information */
|
|||||||
#ifdef USE_PAM
|
#ifdef USE_PAM
|
||||||
static pam_handle_t *pamh = NULL;
|
static pam_handle_t *pamh = NULL;
|
||||||
#endif
|
#endif
|
||||||
static bool passwd_locked = false;
|
static bool pw_locked = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* External identifiers
|
* External identifiers
|
||||||
@ -94,14 +94,14 @@ static void get_old_fields (const char *gecos);
|
|||||||
*/
|
*/
|
||||||
static void fail_exit (int code)
|
static void fail_exit (int code)
|
||||||
{
|
{
|
||||||
if (passwd_locked) {
|
if (pw_locked) {
|
||||||
if (pw_unlock () == 0) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
passwd_locked = false;
|
pw_locked = false;
|
||||||
|
|
||||||
closelog ();
|
closelog ();
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ static void update_gecos (const char *user, char *gecos)
|
|||||||
Prog, pw_dbname ());
|
Prog, pw_dbname ());
|
||||||
fail_exit (E_NOPERM);
|
fail_exit (E_NOPERM);
|
||||||
}
|
}
|
||||||
passwd_locked = true;
|
pw_locked = true;
|
||||||
if (pw_open (O_RDWR) == 0) {
|
if (pw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"), Prog, pw_dbname ());
|
_("%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 ()));
|
SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
|
||||||
fail_exit (E_NOPERM);
|
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) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
||||||
|
@ -64,9 +64,9 @@ static long sha_rounds = 5000;
|
|||||||
|
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
static bool is_shadow_grp;
|
static bool is_shadow_grp;
|
||||||
static bool gshadow_locked = false;
|
static bool sgr_locked = false;
|
||||||
#endif
|
#endif
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
|
|
||||||
#ifdef USE_PAM
|
#ifdef USE_PAM
|
||||||
static pam_handle_t *pamh = NULL;
|
static pam_handle_t *pamh = NULL;
|
||||||
@ -86,7 +86,7 @@ static void close_files (void);
|
|||||||
*/
|
*/
|
||||||
static void fail_exit (int code)
|
static void fail_exit (int code)
|
||||||
{
|
{
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
||||||
@ -95,7 +95,7 @@ static void fail_exit (int code)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (gshadow_locked) {
|
if (sgr_locked) {
|
||||||
if (sgr_unlock () == 0) {
|
if (sgr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
||||||
@ -294,7 +294,7 @@ static void open_files (void)
|
|||||||
Prog, gr_dbname ());
|
Prog, gr_dbname ());
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
if (gr_open (O_RDWR) == 0) {
|
if (gr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"), Prog, gr_dbname ());
|
_("%s: cannot open %s\n"), Prog, gr_dbname ());
|
||||||
@ -310,7 +310,7 @@ static void open_files (void)
|
|||||||
Prog, sgr_dbname ());
|
Prog, sgr_dbname ());
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
gshadow_locked = true;
|
sgr_locked = true;
|
||||||
if (sgr_open (O_RDWR) == 0) {
|
if (sgr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr, _("%s: cannot open %s\n"),
|
fprintf (stderr, _("%s: cannot open %s\n"),
|
||||||
Prog, sgr_dbname ());
|
Prog, sgr_dbname ());
|
||||||
@ -339,7 +339,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
gshadow_locked = false;
|
sgr_locked = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -355,7 +355,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
group_locked = false;
|
gr_locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main (int argc, char **argv)
|
int main (int argc, char **argv)
|
||||||
|
@ -61,8 +61,8 @@ static const char *crypt_method = NULL;
|
|||||||
static long sha_rounds = 5000;
|
static long sha_rounds = 5000;
|
||||||
|
|
||||||
static bool is_shadow_pwd;
|
static bool is_shadow_pwd;
|
||||||
static bool passwd_locked = false;
|
static bool pw_locked = false;
|
||||||
static bool shadow_locked = false;
|
static bool spw_locked = false;
|
||||||
|
|
||||||
#ifdef USE_PAM
|
#ifdef USE_PAM
|
||||||
static pam_handle_t *pamh = NULL;
|
static pam_handle_t *pamh = NULL;
|
||||||
@ -82,7 +82,7 @@ static void close_files (void);
|
|||||||
*/
|
*/
|
||||||
static void fail_exit (int code)
|
static void fail_exit (int code)
|
||||||
{
|
{
|
||||||
if (passwd_locked) {
|
if (pw_locked) {
|
||||||
if (pw_unlock () == 0) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", 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) {
|
if (spw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||||
@ -288,7 +288,7 @@ static void open_files (void)
|
|||||||
Prog, pw_dbname ());
|
Prog, pw_dbname ());
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
passwd_locked = true;
|
pw_locked = true;
|
||||||
if (pw_open (O_RDWR) == 0) {
|
if (pw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"), Prog, pw_dbname ());
|
_("%s: cannot open %s\n"), Prog, pw_dbname ());
|
||||||
@ -303,7 +303,7 @@ static void open_files (void)
|
|||||||
Prog, spw_dbname ());
|
Prog, spw_dbname ());
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
shadow_locked = true;
|
spw_locked = true;
|
||||||
if (spw_open (O_RDWR) == 0) {
|
if (spw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"),
|
_("%s: cannot open %s\n"),
|
||||||
@ -331,7 +331,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
shadow_locked = false;
|
spw_locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pw_close () == 0) {
|
if (pw_close () == 0) {
|
||||||
@ -346,7 +346,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
passwd_locked = false;
|
pw_locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main (int argc, char **argv)
|
int main (int argc, char **argv)
|
||||||
|
@ -59,9 +59,9 @@ static char *Prog;
|
|||||||
/* Indicate if shadow groups are enabled on the system
|
/* Indicate if shadow groups are enabled on the system
|
||||||
* (/etc/gshadow present) */
|
* (/etc/gshadow present) */
|
||||||
static bool is_shadowgrp;
|
static bool is_shadowgrp;
|
||||||
static bool gshadow_locked = false;
|
static bool sgr_locked = false;
|
||||||
#endif
|
#endif
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
|
|
||||||
/* Flags set by options */
|
/* Flags set by options */
|
||||||
static bool aflg = false;
|
static bool aflg = false;
|
||||||
@ -160,7 +160,7 @@ static RETSIGTYPE catch_signals (int killed)
|
|||||||
*/
|
*/
|
||||||
static void fail_exit (int status)
|
static void fail_exit (int status)
|
||||||
{
|
{
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
||||||
@ -172,7 +172,7 @@ static void fail_exit (int status)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (gshadow_locked) {
|
if (sgr_locked) {
|
||||||
if (sgr_unlock () == 0) {
|
if (sgr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
|
||||||
@ -378,7 +378,7 @@ static void open_files (void)
|
|||||||
#endif
|
#endif
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (is_shadowgrp) {
|
if (is_shadowgrp) {
|
||||||
if (sgr_lock () == 0) {
|
if (sgr_lock () == 0) {
|
||||||
@ -392,7 +392,7 @@ static void open_files (void)
|
|||||||
#endif
|
#endif
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
gshadow_locked = true;
|
sgr_locked = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (gr_open (O_RDWR) == 0) {
|
if (gr_open (O_RDWR) == 0) {
|
||||||
@ -460,7 +460,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
gshadow_locked = false;
|
sgr_locked = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
@ -473,7 +473,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
group_locked = false;
|
gr_locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -83,9 +83,9 @@ static bool pflg = false; /* new encrypted password */
|
|||||||
|
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
static bool is_shadow_grp;
|
static bool is_shadow_grp;
|
||||||
static bool gshadow_locked = false;
|
static bool sgr_locked = false;
|
||||||
#endif
|
#endif
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_PAM
|
#ifdef USE_PAM
|
||||||
@ -266,7 +266,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
group_locked = false;
|
gr_locked = false;
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (is_shadow_grp) {
|
if (is_shadow_grp) {
|
||||||
if (sgr_close () == 0) {
|
if (sgr_close () == 0) {
|
||||||
@ -285,7 +285,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
gshadow_locked = false;
|
sgr_locked = false;
|
||||||
}
|
}
|
||||||
#endif /* SHADOWGRP */
|
#endif /* SHADOWGRP */
|
||||||
}
|
}
|
||||||
@ -308,7 +308,7 @@ static void open_files (void)
|
|||||||
#endif
|
#endif
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
if (gr_open (O_RDWR) == 0) {
|
if (gr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
|
SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
|
||||||
@ -332,7 +332,7 @@ static void open_files (void)
|
|||||||
#endif
|
#endif
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
gshadow_locked = true;
|
sgr_locked = true;
|
||||||
if (sgr_open (O_RDWR) == 0) {
|
if (sgr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"), Prog, sgr_dbname ());
|
_("%s: cannot open %s\n"), Prog, sgr_dbname ());
|
||||||
@ -353,7 +353,7 @@ static void open_files (void)
|
|||||||
*/
|
*/
|
||||||
static void fail_exit (int code)
|
static void fail_exit (int code)
|
||||||
{
|
{
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
||||||
@ -366,7 +366,7 @@ static void fail_exit (int code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (gshadow_locked) {
|
if (sgr_locked) {
|
||||||
if (sgr_unlock () == 0) {
|
if (sgr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
|
||||||
|
@ -59,9 +59,9 @@ static gid_t group_id = -1;
|
|||||||
|
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
static bool is_shadow_grp;
|
static bool is_shadow_grp;
|
||||||
static bool gshadow_locked = false;
|
static bool sgr_locked = false;
|
||||||
#endif
|
#endif
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* exit status values
|
* exit status values
|
||||||
@ -94,7 +94,7 @@ static void usage (void)
|
|||||||
*/
|
*/
|
||||||
static void fail_exit (int code)
|
static void fail_exit (int code)
|
||||||
{
|
{
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
||||||
@ -107,7 +107,7 @@ static void fail_exit (int code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (gshadow_locked) {
|
if (sgr_locked) {
|
||||||
if (sgr_unlock () == 0) {
|
if (sgr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
|
||||||
@ -189,7 +189,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
group_locked = false;
|
gr_locked = false;
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (is_shadow_grp) {
|
if (is_shadow_grp) {
|
||||||
if (sgr_close () == 0)) {
|
if (sgr_close () == 0)) {
|
||||||
@ -208,7 +208,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
gshadow_locked = false;
|
sgr_locked = false;
|
||||||
}
|
}
|
||||||
#endif /* SHADOWGRP */
|
#endif /* SHADOWGRP */
|
||||||
}
|
}
|
||||||
@ -226,7 +226,7 @@ static void open_files (void)
|
|||||||
Prog, gr_dbname ());
|
Prog, gr_dbname ());
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
if (gr_open (O_RDWR) == 0) {
|
if (gr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"), Prog, gr_dbname ());
|
_("%s: cannot open %s\n"), Prog, gr_dbname ());
|
||||||
@ -241,7 +241,7 @@ static void open_files (void)
|
|||||||
Prog, sgr_dbname ());
|
Prog, sgr_dbname ());
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
gshadow_locked = true;
|
sgr_locked = true;
|
||||||
if (sgr_open (O_RDWR) == 0)) {
|
if (sgr_open (O_RDWR) == 0)) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"),
|
_("%s: cannot open %s\n"),
|
||||||
|
@ -68,7 +68,7 @@ static bool purge = false;
|
|||||||
static bool list = false;
|
static bool list = false;
|
||||||
static int exclusive = 0;
|
static int exclusive = 0;
|
||||||
static char *Prog;
|
static char *Prog;
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
|
|
||||||
static char *whoami (void);
|
static char *whoami (void);
|
||||||
static void display_members (char **members);
|
static void display_members (char **members);
|
||||||
@ -205,7 +205,7 @@ static void check_perms (void)
|
|||||||
|
|
||||||
static void fail_exit (int code)
|
static void fail_exit (int code)
|
||||||
{
|
{
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: failed to unlock %s\n"),
|
_("%s: failed to unlock %s\n"),
|
||||||
@ -258,7 +258,7 @@ int main (int argc, char **argv)
|
|||||||
Prog, gr_dbname ());
|
Prog, gr_dbname ());
|
||||||
fail_exit (EXIT_GROUP_FILE);
|
fail_exit (EXIT_GROUP_FILE);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gr_open (list ? O_RDONLY : O_RDWR) == 0) {
|
if (gr_open (list ? O_RDONLY : O_RDWR) == 0) {
|
||||||
|
@ -68,10 +68,10 @@
|
|||||||
*/
|
*/
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
static bool is_shadow_grp;
|
static bool is_shadow_grp;
|
||||||
static bool gshadow_locked = false;
|
static bool sgr_locked = false;
|
||||||
#endif /* SHADOWGRP */
|
#endif /* SHADOWGRP */
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
static bool passwd_locked = false;
|
static bool pw_locked = false;
|
||||||
static char *group_name;
|
static char *group_name;
|
||||||
static char *group_newname;
|
static char *group_newname;
|
||||||
static char *group_passwd;
|
static char *group_passwd;
|
||||||
@ -123,7 +123,7 @@ static void usage (void)
|
|||||||
|
|
||||||
static void fail_exit (int status)
|
static void fail_exit (int status)
|
||||||
{
|
{
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
||||||
@ -136,7 +136,7 @@ static void fail_exit (int status)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (gshadow_locked) {
|
if (sgr_locked) {
|
||||||
if (sgr_unlock () == 0) {
|
if (sgr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
|
||||||
@ -149,7 +149,7 @@ static void fail_exit (int status)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* SHADOWGRP */
|
#endif /* SHADOWGRP */
|
||||||
if (passwd_locked) {
|
if (pw_locked) {
|
||||||
if (pw_unlock () == 0) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", pw_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", pw_dbname ()));
|
||||||
@ -525,7 +525,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
group_locked = false;
|
gr_locked = false;
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (is_shadow_grp) {
|
if (is_shadow_grp) {
|
||||||
if (sgr_close () == 0)) {
|
if (sgr_close () == 0)) {
|
||||||
@ -549,7 +549,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
gshadow_locked = false;
|
sgr_locked = false;
|
||||||
}
|
}
|
||||||
#endif /* SHADOWGRP */
|
#endif /* SHADOWGRP */
|
||||||
if (gflg) {
|
if (gflg) {
|
||||||
@ -574,7 +574,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
passwd_locked = false;
|
pw_locked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,7 +591,7 @@ static void open_files (void)
|
|||||||
Prog, gr_dbname ());
|
Prog, gr_dbname ());
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
if (gr_open (O_RDWR) == 0) {
|
if (gr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
|
SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
|
||||||
@ -605,7 +605,7 @@ static void open_files (void)
|
|||||||
Prog, sgr_dbname ());
|
Prog, sgr_dbname ());
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
gshadow_locked = true;
|
sgr_locked = true;
|
||||||
if (sgr_open (O_RDWR) == 0) {
|
if (sgr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"),
|
_("%s: cannot open %s\n"),
|
||||||
@ -622,7 +622,7 @@ static void open_files (void)
|
|||||||
Prog, pw_dbname ());
|
Prog, pw_dbname ());
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
passwd_locked = true;
|
pw_locked = true;
|
||||||
if (pw_open (O_RDWR) == 0) {
|
if (pw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"),
|
_("%s: cannot open %s\n"),
|
||||||
|
@ -53,18 +53,18 @@
|
|||||||
/*
|
/*
|
||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
static bool gshadow_locked = false;
|
static bool sgr_locked = false;
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static void fail_exit (int);
|
static void fail_exit (int);
|
||||||
|
|
||||||
static void fail_exit (int status)
|
static void fail_exit (int status)
|
||||||
{
|
{
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
gr_unlock ();
|
gr_unlock ();
|
||||||
}
|
}
|
||||||
if (gshadow_locked) {
|
if (sgr_locked) {
|
||||||
sgr_unlock ();
|
sgr_unlock ();
|
||||||
}
|
}
|
||||||
exit (status);
|
exit (status);
|
||||||
@ -88,7 +88,7 @@ int main (int argc, char **argv)
|
|||||||
Prog, gr_dbname ());
|
Prog, gr_dbname ());
|
||||||
fail_exit (5);
|
fail_exit (5);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
if (gr_open (O_RDWR) == 0) {
|
if (gr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
@ -100,7 +100,7 @@ int main (int argc, char **argv)
|
|||||||
Prog, sgr_dbname ());
|
Prog, sgr_dbname ());
|
||||||
fail_exit (5);
|
fail_exit (5);
|
||||||
}
|
}
|
||||||
gshadow_locked = true;
|
sgr_locked = true;
|
||||||
if (sgr_open (O_CREAT | O_RDWR) == 0) {
|
if (sgr_open (O_CREAT | O_RDWR) == 0) {
|
||||||
fprintf (stderr, _("%s: cannot open %s\n"), Prog, sgr_dbname ());
|
fprintf (stderr, _("%s: cannot open %s\n"), Prog, sgr_dbname ());
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
|
@ -54,15 +54,15 @@
|
|||||||
/*
|
/*
|
||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
static bool gshadow_locked = false;
|
static bool sgr_locked = false;
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static void fail_exit (int status);
|
static void fail_exit (int status);
|
||||||
|
|
||||||
static void fail_exit (int status)
|
static void fail_exit (int status)
|
||||||
{
|
{
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", 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) {
|
if (sgr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
||||||
@ -102,7 +102,7 @@ int main (int argc, char **argv)
|
|||||||
Prog, gr_dbname ());
|
Prog, gr_dbname ());
|
||||||
fail_exit (5);
|
fail_exit (5);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
if (gr_open (O_RDWR) == 0) {
|
if (gr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"), Prog, gr_dbname ());
|
_("%s: cannot open %s\n"), Prog, gr_dbname ());
|
||||||
@ -115,7 +115,7 @@ int main (int argc, char **argv)
|
|||||||
Prog, sgr_dbname ());
|
Prog, sgr_dbname ());
|
||||||
fail_exit (5);
|
fail_exit (5);
|
||||||
}
|
}
|
||||||
gshadow_locked = true;
|
sgr_locked = true;
|
||||||
if (sgr_open (O_RDWR) == 0) {
|
if (sgr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"), Prog, sgr_dbname ());
|
_("%s: cannot open %s\n"), Prog, sgr_dbname ());
|
||||||
@ -164,20 +164,16 @@ int main (int argc, char **argv)
|
|||||||
fail_exit (3);
|
fail_exit (3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (group_locked) {
|
if (gr_unlock () == 0) {
|
||||||
if (gr_unlock () == 0) {
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
/* continue */
|
||||||
/* continue */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gshadow_locked) {
|
if (sgr_unlock () == 0) {
|
||||||
if (sgr_unlock () == 0) {
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
/* continue */
|
||||||
/* continue */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nscd_flush_cache ("group");
|
nscd_flush_cache ("group");
|
||||||
|
@ -76,11 +76,11 @@ static long sha_rounds = 5000;
|
|||||||
static bool is_shadow;
|
static bool is_shadow;
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
static bool is_shadow_grp;
|
static bool is_shadow_grp;
|
||||||
static bool gshadow_locked = false;
|
static bool sgr_locked = false;
|
||||||
#endif
|
#endif
|
||||||
static bool passwd_locked = false;
|
static bool pw_locked = false;
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
static bool shadow_locked = false;
|
static bool spw_locked = false;
|
||||||
|
|
||||||
#ifdef USE_PAM
|
#ifdef USE_PAM
|
||||||
static pam_handle_t *pamh = NULL;
|
static pam_handle_t *pamh = NULL;
|
||||||
@ -128,21 +128,21 @@ static void usage (void)
|
|||||||
*/
|
*/
|
||||||
static void fail_exit (int code)
|
static void fail_exit (int code)
|
||||||
{
|
{
|
||||||
if (shadow_locked) {
|
if (spw_locked) {
|
||||||
if (spw_unlock () == 0) {
|
if (spw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (passwd_locked) {
|
if (pw_locked) {
|
||||||
if (pw_unlock () == 0) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
||||||
@ -150,7 +150,7 @@ static void fail_exit (int code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (gshadow_locked) {
|
if (sgr_locked) {
|
||||||
if (sgr_unlock () == 0) {
|
if (sgr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
||||||
@ -613,21 +613,21 @@ static void open_files (void)
|
|||||||
Prog, pw_dbname ());
|
Prog, pw_dbname ());
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
passwd_locked = true;
|
pw_locked = true;
|
||||||
if (is_shadow && (spw_lock () == 0)) {
|
if (is_shadow && (spw_lock () == 0)) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot lock %s; try again later.\n"),
|
_("%s: cannot lock %s; try again later.\n"),
|
||||||
Prog, spw_dbname ());
|
Prog, spw_dbname ());
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
shadow_locked = true;
|
spw_locked = true;
|
||||||
if (gr_lock () == 0) {
|
if (gr_lock () == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot lock %s; try again later.\n"),
|
_("%s: cannot lock %s; try again later.\n"),
|
||||||
Prog, gr_dbname ());
|
Prog, gr_dbname ());
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (is_shadow_grp && (sgr_lock () == 0)) {
|
if (is_shadow_grp && (sgr_lock () == 0)) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
@ -635,7 +635,7 @@ static void open_files (void)
|
|||||||
Prog, sgr_dbname ());
|
Prog, sgr_dbname ());
|
||||||
fail_exit (1);
|
fail_exit (1);
|
||||||
}
|
}
|
||||||
gshadow_locked = true;
|
sgr_locked = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pw_open (O_RDWR) == 0) {
|
if (pw_open (O_RDWR) == 0) {
|
||||||
@ -673,7 +673,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
passwd_locked = false;
|
pw_locked = false;
|
||||||
|
|
||||||
if (is_shadow) {
|
if (is_shadow) {
|
||||||
if (spw_close () == 0) {
|
if (spw_close () == 0) {
|
||||||
@ -690,7 +690,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
shadow_locked = false;
|
spw_locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gr_close () == 0) {
|
if (gr_close () == 0) {
|
||||||
@ -707,7 +707,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
group_locked = false;
|
gr_locked = false;
|
||||||
|
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (is_shadow_grp) {
|
if (is_shadow_grp) {
|
||||||
@ -725,7 +725,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
gshadow_locked = false;
|
sgr_locked = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
16
src/pwconv.c
16
src/pwconv.c
@ -84,15 +84,15 @@
|
|||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
static char *Prog;
|
static char *Prog;
|
||||||
static bool shadow_locked = false;
|
static bool spw_locked = false;
|
||||||
static bool passwd_locked = false;
|
static bool pw_locked = false;
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static void fail_exit (int status);
|
static void fail_exit (int status);
|
||||||
|
|
||||||
static void fail_exit (int status)
|
static void fail_exit (int status)
|
||||||
{
|
{
|
||||||
if (passwd_locked) {
|
if (pw_locked) {
|
||||||
if (pw_unlock () == 0) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", 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) {
|
if (spw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||||
@ -131,7 +131,7 @@ int main (int argc, char **argv)
|
|||||||
Prog, pw_dbname ());
|
Prog, pw_dbname ());
|
||||||
fail_exit (E_PWDBUSY);
|
fail_exit (E_PWDBUSY);
|
||||||
}
|
}
|
||||||
passwd_locked = true;
|
pw_locked = true;
|
||||||
if (pw_open (O_RDWR) == 0) {
|
if (pw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"), Prog, pw_dbname ());
|
_("%s: cannot open %s\n"), Prog, pw_dbname ());
|
||||||
@ -144,7 +144,7 @@ int main (int argc, char **argv)
|
|||||||
Prog, spw_dbname ());
|
Prog, spw_dbname ());
|
||||||
fail_exit (E_PWDBUSY);
|
fail_exit (E_PWDBUSY);
|
||||||
}
|
}
|
||||||
shadow_locked = true;
|
spw_locked = true;
|
||||||
if (spw_open (O_CREAT | O_RDWR) == 0) {
|
if (spw_open (O_CREAT | O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"), Prog, spw_dbname ());
|
_("%s: cannot open %s\n"), Prog, spw_dbname ());
|
||||||
@ -242,7 +242,7 @@ int main (int argc, char **argv)
|
|||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (passwd_locked) {
|
if (pw_locked) {
|
||||||
if (pw_unlock () == 0) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", 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) {
|
if (spw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||||
|
@ -48,22 +48,22 @@
|
|||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
static char *Prog;
|
static char *Prog;
|
||||||
static bool shadow_locked = false;
|
static bool spw_locked = false;
|
||||||
static bool passwd_locked = false;
|
static bool pw_locked = false;
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static void fail_exit (int status);
|
static void fail_exit (int status);
|
||||||
|
|
||||||
static void fail_exit (int status)
|
static void fail_exit (int status)
|
||||||
{
|
{
|
||||||
if (shadow_locked) {
|
if (spw_locked) {
|
||||||
if (spw_unlock () == 0) {
|
if (spw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (passwd_locked) {
|
if (pw_locked) {
|
||||||
if (pw_unlock () == 0) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
||||||
@ -97,7 +97,7 @@ int main (int argc, char **argv)
|
|||||||
Prog, pw_dbname ());
|
Prog, pw_dbname ());
|
||||||
fail_exit (5);
|
fail_exit (5);
|
||||||
}
|
}
|
||||||
passwd_locked = true;
|
pw_locked = true;
|
||||||
if (pw_open (O_RDWR) == 0) {
|
if (pw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"),
|
_("%s: cannot open %s\n"),
|
||||||
@ -111,7 +111,7 @@ int main (int argc, char **argv)
|
|||||||
Prog, spw_dbname ());
|
Prog, spw_dbname ());
|
||||||
fail_exit (5);
|
fail_exit (5);
|
||||||
}
|
}
|
||||||
shadow_locked = true;
|
spw_locked = true;
|
||||||
if (spw_open (O_RDWR) == 0) {
|
if (spw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"),
|
_("%s: cannot open %s\n"),
|
||||||
|
@ -110,11 +110,11 @@ static bool is_shadow_pwd;
|
|||||||
|
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
static bool is_shadow_grp;
|
static bool is_shadow_grp;
|
||||||
static bool gshadow_locked = false;
|
static bool sgr_locked = false;
|
||||||
#endif
|
#endif
|
||||||
static bool passwd_locked = false;
|
static bool pw_locked = false;
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
static bool shadow_locked = false;
|
static bool spw_locked = false;
|
||||||
static char **user_groups; /* NULL-terminated list */
|
static char **user_groups; /* NULL-terminated list */
|
||||||
static long sys_ngroups;
|
static long sys_ngroups;
|
||||||
static bool do_grp_update = false; /* group files need to be updated */
|
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);
|
rmdir (user_home);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shadow_locked) {
|
if (spw_locked) {
|
||||||
if (spw_unlock () == 0) {
|
if (spw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", spw_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", spw_dbname ()));
|
||||||
@ -210,7 +210,7 @@ static void fail_exit (int code)
|
|||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (passwd_locked) {
|
if (pw_locked) {
|
||||||
if (pw_unlock () == 0) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", pw_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", pw_dbname ()));
|
||||||
@ -222,7 +222,7 @@ static void fail_exit (int code)
|
|||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
||||||
@ -235,7 +235,7 @@ static void fail_exit (int code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (gshadow_locked) {
|
if (sgr_locked) {
|
||||||
if (sgr_unlock () == 0) {
|
if (sgr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", sgr_dbname ()));
|
||||||
@ -1278,7 +1278,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
shadow_locked = false;
|
spw_locked = false;
|
||||||
}
|
}
|
||||||
if (pw_unlock () == 0) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
@ -1290,7 +1290,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
passwd_locked = false;
|
pw_locked = false;
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_WARN, "failed to unlock %s", gr_dbname ()));
|
||||||
@ -1301,7 +1301,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
group_locked = false;
|
gr_locked = false;
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (is_shadow_grp) {
|
if (is_shadow_grp) {
|
||||||
if (sgr_unlock () == 0) {
|
if (sgr_unlock () == 0) {
|
||||||
@ -1314,7 +1314,7 @@ static void close_files (void)
|
|||||||
#endif
|
#endif
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
gshadow_locked = false;
|
sgr_locked = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1332,7 +1332,7 @@ static void open_files (void)
|
|||||||
Prog, pw_dbname ());
|
Prog, pw_dbname ());
|
||||||
exit (E_PW_UPDATE);
|
exit (E_PW_UPDATE);
|
||||||
}
|
}
|
||||||
passwd_locked = true;
|
pw_locked = true;
|
||||||
if (pw_open (O_RDWR) == 0) {
|
if (pw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr, _("%s: cannot open %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: cannot open %s\n"), Prog, pw_dbname ());
|
||||||
fail_exit (E_PW_UPDATE);
|
fail_exit (E_PW_UPDATE);
|
||||||
@ -1344,7 +1344,7 @@ static void open_files (void)
|
|||||||
Prog, spw_dbname ());
|
Prog, spw_dbname ());
|
||||||
fail_exit (E_PW_UPDATE);
|
fail_exit (E_PW_UPDATE);
|
||||||
}
|
}
|
||||||
shadow_locked = true;
|
spw_locked = true;
|
||||||
if (spw_open (O_RDWR) == 0) {
|
if (spw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"),
|
_("%s: cannot open %s\n"),
|
||||||
@ -1362,7 +1362,7 @@ static void open_files (void)
|
|||||||
Prog, gr_dbname ());
|
Prog, gr_dbname ());
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
if (gr_open (O_RDWR) == 0) {
|
if (gr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
@ -1375,7 +1375,7 @@ static void open_files (void)
|
|||||||
Prog, sgr_dbname ());
|
Prog, sgr_dbname ());
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
gshadow_locked = true;
|
sgr_locked = true;
|
||||||
if (sgr_open (O_RDWR) == 0) {
|
if (sgr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"),
|
_("%s: cannot open %s\n"),
|
||||||
|
@ -80,11 +80,11 @@ static bool is_shadow_pwd;
|
|||||||
|
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
static bool is_shadow_grp;
|
static bool is_shadow_grp;
|
||||||
static bool gshadow_locked = false;
|
static bool sgr_locked = false;
|
||||||
#endif
|
#endif
|
||||||
static bool passwd_locked = false;
|
static bool pw_locked = false;
|
||||||
static bool group_locked = false;
|
static bool gr_locked = false;
|
||||||
static bool shadow_locked = false;
|
static bool spw_locked = false;
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static void usage (void);
|
static void usage (void);
|
||||||
@ -327,7 +327,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
passwd_locked = false;
|
pw_locked = false;
|
||||||
|
|
||||||
if (is_shadow_pwd) {
|
if (is_shadow_pwd) {
|
||||||
if (spw_close () == 0) {
|
if (spw_close () == 0) {
|
||||||
@ -341,7 +341,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
shadow_locked = false;
|
spw_locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gr_close () == 0) {
|
if (gr_close () == 0) {
|
||||||
@ -354,7 +354,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
group_locked = false;
|
gr_locked = false;
|
||||||
|
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (is_shadow_grp) {
|
if (is_shadow_grp) {
|
||||||
@ -370,7 +370,7 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
gshadow_locked = false;
|
sgr_locked = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -380,21 +380,21 @@ static void close_files (void)
|
|||||||
*/
|
*/
|
||||||
static void fail_exit (int code)
|
static void fail_exit (int code)
|
||||||
{
|
{
|
||||||
if (passwd_locked) {
|
if (pw_locked) {
|
||||||
if (pw_unlock () == 0) {
|
if (pw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (group_locked) {
|
if (gr_locked) {
|
||||||
if (gr_unlock () == 0) {
|
if (gr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
|
||||||
/* continue */
|
/* continue */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (shadow_locked) {
|
if (spw_locked) {
|
||||||
if (spw_unlock () == 0) {
|
if (spw_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||||
@ -402,7 +402,7 @@ static void fail_exit (int code)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (gshadow_locked) {
|
if (sgr_locked) {
|
||||||
if (sgr_unlock () == 0) {
|
if (sgr_unlock () == 0) {
|
||||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
|
||||||
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
|
||||||
@ -439,7 +439,7 @@ static void open_files (void)
|
|||||||
#endif
|
#endif
|
||||||
fail_exit (E_PW_UPDATE);
|
fail_exit (E_PW_UPDATE);
|
||||||
}
|
}
|
||||||
passwd_locked = true;
|
pw_locked = true;
|
||||||
if (pw_open (O_RDWR) == 0) {
|
if (pw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"), Prog, pw_dbname ());
|
_("%s: cannot open %s\n"), Prog, pw_dbname ());
|
||||||
@ -462,7 +462,7 @@ static void open_files (void)
|
|||||||
#endif
|
#endif
|
||||||
fail_exit (E_PW_UPDATE);
|
fail_exit (E_PW_UPDATE);
|
||||||
}
|
}
|
||||||
shadow_locked = true;
|
spw_locked = true;
|
||||||
if (spw_open (O_RDWR) == 0) {
|
if (spw_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot open %s\n"),
|
_("%s: cannot open %s\n"),
|
||||||
@ -486,7 +486,7 @@ static void open_files (void)
|
|||||||
#endif
|
#endif
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
group_locked = true;
|
gr_locked = true;
|
||||||
if (gr_open (O_RDWR) == 0) {
|
if (gr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
|
||||||
#ifdef WITH_AUDIT
|
#ifdef WITH_AUDIT
|
||||||
@ -509,7 +509,7 @@ static void open_files (void)
|
|||||||
#endif
|
#endif
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
gshadow_locked= true;
|
sgr_locked= true;
|
||||||
if (sgr_open (O_RDWR) == 0) {
|
if (sgr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr, _("%s: cannot open %s\n"),
|
fprintf (stderr, _("%s: cannot open %s\n"),
|
||||||
Prog, sgr_dbname ());
|
Prog, sgr_dbname ());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user