* src/chfn.c, src/chsh.c, src/expiry.c, src/gpasswd.c,

src/newgrp.c, src/passwd.c, src/su.c: Use the same stderr and
	syslog warnings when the username cannot be determined.
	* src/newgrp.c: Reuse the same stderr message for groups which do
	not exist in the system.
This commit is contained in:
nekral-guest
2008-08-30 18:27:07 +00:00
parent 307f703b99
commit 38a50366bc
8 changed files with 31 additions and 8 deletions

View File

@@ -851,12 +851,15 @@ int main (int argc, char **argv)
pw = get_my_pwent ();
if (NULL == pw) {
fputs (_("Who are you?\n"), stderr);
fprintf (stderr, _("%s: Cannot determine your user name.\n"),
Prog);
#ifdef WITH_AUDIT
audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
"user lookup",
NULL, (unsigned int) bywho, 0);
#endif
SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
(unsigned long) getuid ()));
failure ();
}
myname = xstrdup (pw->pw_name);