[Pkg-shadow-commits] r3710 - in upstream/trunk: . src

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Mon Feb 13 20:32:00 UTC 2012


Author: nekral-guest
Date: 2012-02-13 20:32:00 +0000 (Mon, 13 Feb 2012)
New Revision: 3710

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/passwd.c
Log:
2012-02-13  Mike Frysinger  <vapier at gentoo.org>
	* src/passwd.c: (non PAM flavour) Report permission denied when
	access to /etc/shadow fails with EACCES.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2012-02-13 20:09:59 UTC (rev 3709)
+++ upstream/trunk/ChangeLog	2012-02-13 20:32:00 UTC (rev 3710)
@@ -1,5 +1,10 @@
 2012-02-13  Mike Frysinger  <vapier at gentoo.org>
 
+	* src/passwd.c: (non PAM flavour) Report permission denied when
+	access to /etc/shadow fails with EACCES.
+
+2012-02-13  Mike Frysinger  <vapier at gentoo.org>
+
 	* lib/nscd.c: Add missing newline to error message.
 	* lib/nscd.c: If nscd is installed but not in use, then running
 	`nscd -i` will exit(1). We shouldn't warn in this case since this

Modified: upstream/trunk/src/passwd.c
===================================================================
--- upstream/trunk/src/passwd.c	2012-02-13 20:09:59 UTC (rev 3709)
+++ upstream/trunk/src/passwd.c	2012-02-13 20:32:00 UTC (rev 3710)
@@ -1057,6 +1057,12 @@
 	 */
 	sp = getspnam (name); /* !USE_PAM, no need for xgetspnam */
 	if (NULL == sp) {
+		if (errno == EACCES) {
+			(void) fprintf (stderr,
+			                _("%s: Permission denied.\n"),
+			                Prog);
+			exit (E_NOPERM);
+		}
 		sp = pwd_to_spwd (pw);
 	}
 




More information about the Pkg-shadow-commits mailing list