2012-02-13 Mike Frysinger <vapier@gentoo.org>

* src/passwd.c: (non PAM flavour) Report permission denied when
	access to /etc/shadow fails with EACCES.
This commit is contained in:
nekral-guest 2012-02-13 20:32:00 +00:00
parent e363962dd2
commit 0c1cbaede8
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2012-02-13 Mike Frysinger <vapier@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@gentoo.org>
* lib/nscd.c: Add missing newline to error message.

View File

@ -1057,6 +1057,12 @@ int main (int argc, char **argv)
*/
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);
}