use getpwnam_shadow to unbreak, from Gregor Best

This commit is contained in:
sthen 2016-05-12 11:36:48 +00:00
parent c978032140
commit 46058f7cc6
2 changed files with 23 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.86 2015/10/31 22:58:16 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.87 2016/05/12 11:36:48 sthen Exp $
COMMENT= screen saver and locker for the X Window System
DISTNAME= xscreensaver-5.34
REVISION= 0
CATEGORIES= x11

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-driver_passwd-pwent_c,v 1.3 2016/05/12 11:36:48 sthen Exp $
--- driver/passwd-pwent.c.orig Sat Dec 27 11:17:26 2008
+++ driver/passwd-pwent.c Wed May 11 23:43:04 2016
@@ -133,7 +133,7 @@ user_name (void)
still work. Right?) */
if (!u || !*u)
{
- struct passwd *p = getpwuid (getuid ());
+ struct passwd *p = getpwuid_shadow (getuid ());
u = (p ? p->pw_name : 0);
}
@@ -177,7 +177,7 @@ get_encrypted_passwd(const char *user)
if (user && *user && !result)
{ /* Check non-shadow passwords too. */
- struct passwd *p = getpwnam(user);
+ struct passwd *p = getpwnam_shadow(user);
if (p && passwd_known_p (p->pw_passwd))
result = strdup(p->pw_passwd);
}