From 5bbb9b871f45d8027a94f3e09718354b5337308a Mon Sep 17 00:00:00 2001 From: tedu <> Date: Wed, 18 Nov 2015 16:44:46 +0000 Subject: [PATCH] Add _shadow variants to the two popular getpw functions (uid and nam). This version of the function will always open the secure/shadow/master password files. Soon, the regular variants of these functions will not. (Intermixing shadow and regular gets a little weird; don't do that.) Not using struct spwd and getspwnam functions to reduce churn in callers. Should just be a one line diff in most places. ok deraadt --- src/include/pwd.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/include/pwd.h b/src/include/pwd.h index 98455523..06a11afa 100644 --- a/src/include/pwd.h +++ b/src/include/pwd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pwd.h,v 1.23 2014/05/16 21:28:15 tedu Exp $ */ +/* $OpenBSD: pwd.h,v 1.24 2015/11/18 16:44:46 tedu Exp $ */ /* $NetBSD: pwd.h,v 1.9 1996/05/15 21:36:45 jtc Exp $ */ /*- @@ -93,6 +93,8 @@ struct passwd { __BEGIN_DECLS struct passwd *getpwuid(uid_t); struct passwd *getpwnam(const char *); +struct passwd *getpwuid_shadow(uid_t); +struct passwd *getpwnam_shadow(const char *); int getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **result); int getpwuid_r(uid_t uid, struct passwd *, char *buf, size_t buflen,