* src/pwunconv.c: Report failure to unlock the passwd or shadow
file to stderr and syslog.
This commit is contained in:
parent
501ae11f51
commit
85bc9c1d1a
11
ChangeLog
11
ChangeLog
@ -1,12 +1,17 @@
|
|||||||
2008-08-07 Nicolas François <nicolas.francois@centraliens.net>
|
2008-08-07 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* src/usermod.c: Report failure to unlock the passwd or shadow
|
* src/pwunconv.c: Report failure to unlock the passwd or shadow
|
||||||
file to stderr and syslog.
|
file to stderr and syslog.
|
||||||
|
|
||||||
2008-08-07 Nicolas François <nicolas.francois@centraliens.net>
|
2008-08-07 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* src/newusers.c: Report failure to unlock the passwd or shadow
|
* src/usermod.c: Report failure to unlock files to stderr and
|
||||||
file to stderr and syslog.
|
syslog.
|
||||||
|
|
||||||
|
2008-08-07 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/newusers.c: Report failure to unlock files to stderr and
|
||||||
|
syslog.
|
||||||
* src/newusers.c: In case of error when files are open or closed,
|
* src/newusers.c: In case of error when files are open or closed,
|
||||||
indicate the failing file.
|
indicate the failing file.
|
||||||
* src/newusers.c: Do not try to unlock the files manually since
|
* src/newusers.c: Do not try to unlock the files manually since
|
||||||
|
@ -51,15 +51,23 @@ static bool shadow_locked = false;
|
|||||||
static bool passwd_locked = false;
|
static bool passwd_locked = false;
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
static void fail_exit (int);
|
static void fail_exit (int status);
|
||||||
|
|
||||||
static void fail_exit (int status)
|
static void fail_exit (int status)
|
||||||
{
|
{
|
||||||
if (shadow_locked) {
|
if (shadow_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 (passwd_locked) {
|
if (passwd_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 */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exit (status);
|
exit (status);
|
||||||
}
|
}
|
||||||
@ -164,8 +172,16 @@ int main (int argc, char **argv)
|
|||||||
fail_exit (3);
|
fail_exit (3);
|
||||||
}
|
}
|
||||||
|
|
||||||
spw_unlock ();
|
if (spw_unlock () == 0) {
|
||||||
pw_unlock ();
|
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
||||||
|
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||||
|
/* continue */
|
||||||
|
}
|
||||||
|
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 */
|
||||||
|
}
|
||||||
|
|
||||||
nscd_flush_cache ("passwd");
|
nscd_flush_cache ("passwd");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user