* src/chage.c: Report failure to unlock the passwd or shadow file
to stderr and syslog.
This commit is contained in:
parent
fd4b6cc52a
commit
e3a5f66059
@ -1,3 +1,8 @@
|
|||||||
|
2008-08-06 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/chage.c: Report failure to unlock the passwd or shadow file
|
||||||
|
to stderr and syslog.
|
||||||
|
|
||||||
2008-08-06 Nicolas François <nicolas.francois@centraliens.net>
|
2008-08-06 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* src/pwconv.c: Report failure to unlock the passwd or shadow file
|
* src/pwconv.c: Report failure to unlock the passwd or shadow file
|
||||||
|
24
src/chage.c
24
src/chage.c
@ -109,10 +109,18 @@ static void fail_exit (int code);
|
|||||||
static void fail_exit (int code)
|
static void fail_exit (int code)
|
||||||
{
|
{
|
||||||
if (spw_locked) {
|
if (spw_locked) {
|
||||||
spw_unlock ();
|
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 (pw_locked) {
|
if (pw_locked) {
|
||||||
pw_unlock ();
|
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 */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
closelog ();
|
closelog ();
|
||||||
|
|
||||||
@ -616,9 +624,17 @@ static void close_files (void)
|
|||||||
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);
|
||||||
}
|
}
|
||||||
spw_unlock ();
|
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 */
|
||||||
|
}
|
||||||
spw_locked = false;
|
spw_locked = false;
|
||||||
pw_unlock ();
|
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 */
|
||||||
|
}
|
||||||
pw_locked = false;
|
pw_locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user