[Pkg-shadow-commits] r2287 - in upstream/trunk: . src
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Sat Aug 30 18:27:08 UTC 2008
Author: nekral-guest
Date: 2008-08-30 18:27:07 +0000 (Sat, 30 Aug 2008)
New Revision: 2287
Modified:
upstream/trunk/ChangeLog
upstream/trunk/src/chfn.c
upstream/trunk/src/chsh.c
upstream/trunk/src/expiry.c
upstream/trunk/src/gpasswd.c
upstream/trunk/src/newgrp.c
upstream/trunk/src/passwd.c
upstream/trunk/src/su.c
Log:
* 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.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2008-08-22 02:34:04 UTC (rev 2286)
+++ upstream/trunk/ChangeLog 2008-08-30 18:27:07 UTC (rev 2287)
@@ -1,3 +1,11 @@
+2008-08-25 Nicolas François <nicolas.francois at centraliens.net>
+
+ * 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.
+
2008-08-21 Nicolas François <nicolas.francois at centraliens.net>
* src/usermod.c: Log errors while *_close to syslog.
Modified: upstream/trunk/src/chfn.c
===================================================================
--- upstream/trunk/src/chfn.c 2008-08-22 02:34:04 UTC (rev 2286)
+++ upstream/trunk/src/chfn.c 2008-08-30 18:27:07 UTC (rev 2287)
@@ -651,6 +651,8 @@
fprintf (stderr,
_("%s: Cannot determine your user name.\n"),
Prog);
+ SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid ()));
fail_exit (E_NOPERM);
}
user = xstrdup (pw->pw_name);
Modified: upstream/trunk/src/chsh.c
===================================================================
--- upstream/trunk/src/chsh.c 2008-08-22 02:34:04 UTC (rev 2286)
+++ upstream/trunk/src/chsh.c 2008-08-30 18:27:07 UTC (rev 2287)
@@ -472,6 +472,8 @@
fprintf (stderr,
_("%s: Cannot determine your user name.\n"),
Prog);
+ SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid ()));
fail_exit (1);
}
user = xstrdup (pw->pw_name);
Modified: upstream/trunk/src/expiry.c
===================================================================
--- upstream/trunk/src/expiry.c 2008-08-22 02:34:04 UTC (rev 2286)
+++ upstream/trunk/src/expiry.c 2008-08-30 18:27:07 UTC (rev 2287)
@@ -105,7 +105,10 @@
*/
pwd = get_my_pwent ();
if (NULL == pwd) {
- fprintf (stderr, _("%s: unknown user\n"), Prog);
+ fprintf (stderr, _("%s: Cannot determine your user name.\n"),
+ Prog);
+ SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid ()));
exit (10);
}
spwd = getspnam (pwd->pw_name); /* !USE_PAM, No need for xgetspnam */
Modified: upstream/trunk/src/gpasswd.c
===================================================================
--- upstream/trunk/src/gpasswd.c 2008-08-22 02:34:04 UTC (rev 2286)
+++ upstream/trunk/src/gpasswd.c 2008-08-30 18:27:07 UTC (rev 2287)
@@ -851,12 +851,15 @@
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);
Modified: upstream/trunk/src/newgrp.c
===================================================================
--- upstream/trunk/src/newgrp.c 2008-08-22 02:34:04 UTC (rev 2286)
+++ upstream/trunk/src/newgrp.c 2008-08-30 18:27:07 UTC (rev 2287)
@@ -421,14 +421,14 @@
pwd = get_my_pwent ();
if (NULL == pwd) {
- fprintf (stderr, _("unknown UID: %lu\n"),
- (unsigned long) getuid ());
+ fprintf (stderr, _("%s: Cannot determine your user name.\n"),
+ Prog);
#ifdef WITH_AUDIT
audit_logger (AUDIT_CHGRP_ID, Prog,
"changing", NULL,
(unsigned int) getuid (), 0);
#endif
- SYSLOG ((LOG_WARN, "unknown UID %lu",
+ SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
(unsigned long) getuid ()));
closelog ();
exit (1);
@@ -598,7 +598,7 @@
*/
grp = getgrnam (group); /* local, no need for xgetgrnam */
if (NULL == grp) {
- fprintf (stderr, _("unknown group: %s\n"), group);
+ fprintf (stderr, _("%s: group '%s' does not exist\n"), Prog, group);
goto failure;
}
Modified: upstream/trunk/src/passwd.c
===================================================================
--- upstream/trunk/src/passwd.c 2008-08-22 02:34:04 UTC (rev 2286)
+++ upstream/trunk/src/passwd.c 2008-08-30 18:27:07 UTC (rev 2287)
@@ -879,7 +879,9 @@
pw = get_my_pwent ();
if (NULL == pw) {
fprintf (stderr,
- _("%s: Cannot determine your user name.\n"), Prog);
+ _("%s: Cannot determine your user name.\n"), Prog);
+ SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid ()));
exit (E_NOPERM);
}
myname = xstrdup (pw->pw_name);
Modified: upstream/trunk/src/su.c
===================================================================
--- upstream/trunk/src/su.c 2008-08-22 02:34:04 UTC (rev 2286)
+++ upstream/trunk/src/su.c 2008-08-30 18:27:07 UTC (rev 2287)
@@ -468,7 +468,10 @@
*/
pw = get_my_pwent ();
if (NULL == pw) {
- SYSLOG ((LOG_CRIT, "Unknown UID: %u", my_uid));
+ fprintf (stderr, _("%s: Cannot determine your user name.\n"),
+ Prog);
+ SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) my_uid));
su_failure (tty);
}
STRFCPY (oldname, pw->pw_name);
More information about the Pkg-shadow-commits
mailing list