* src/groupmems.c: Check the return value of gr_update().

* src/chage.c, src/chfn.c, src/chgpasswd.c, src/chpasswd.c,
	src/chsh.c, src/gpasswd.c, src/groupadd.c, src/groupmems.c,
	src/groupmod.c, src/grpck.c, src/grpconv.c, src/grpunconv.c,
	src/passwd.c, src/pwck.c, src/pwconv.c, src/pwunconv.c,
	src/useradd.c, src/userdel.c, src/usermod.c: Harmonize the error
	message sent to stderr in case of *_update () failure.
	* src/chage.c, src/chsh.c, src/groupadd.c, src/passwd.c: Do not
	log to syslog when pw_update() or spw_update() fail.
	* src/newusers.c: Do not log specific error message to stderr when
	sgr_update() fails.
	* src/pwconv.c: Remove duplicated definition of Prog.
This commit is contained in:
nekral-guest
2008-08-30 18:27:34 +00:00
parent 38a50366bc
commit d7b55ce2bb
21 changed files with 138 additions and 107 deletions

View File

@@ -555,8 +555,9 @@ static void update_noshadow (void)
}
npw->pw_passwd = update_crypt_pw (npw->pw_passwd);
if (pw_update (npw) == 0) {
fputs (_("Error updating the password entry.\n"), stderr);
SYSLOG ((LOG_WARN, "error updating password entry"));
fprintf (stderr,
_("%s: failed to prepare the new %s entry '%s'\n"),
Prog, pw_dbname (), npw->pw_name);
fail_exit (E_FAILURE);
}
if (pw_close () == 0) {
@@ -634,8 +635,9 @@ static void update_shadow (void)
nsp->sp_lstchg = 0;
if (spw_update (nsp) == 0) {
fputs (_("Error updating the password entry.\n"), stderr);
SYSLOG ((LOG_WARN, "error updating password entry"));
fprintf (stderr,
_("%s: failed to prepare the new %s entry '%s'\n"),
Prog, spw_dbname (), nsp->sp_namp);
fail_exit (E_FAILURE);
}
if (spw_close () == 0) {