Browse Source

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
OPENBSD_5_9
tedu 9 years ago
parent
commit
5bbb9b871f
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/include/pwd.h

+ 3
- 1
src/include/pwd.h View File

@ -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 $ */ /* $NetBSD: pwd.h,v 1.9 1996/05/15 21:36:45 jtc Exp $ */
/*- /*-
@ -93,6 +93,8 @@ struct passwd {
__BEGIN_DECLS __BEGIN_DECLS
struct passwd *getpwuid(uid_t); struct passwd *getpwuid(uid_t);
struct passwd *getpwnam(const char *); 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, int getpwnam_r(const char *, struct passwd *, char *, size_t,
struct passwd **result); struct passwd **result);
int getpwuid_r(uid_t uid, struct passwd *, char *buf, size_t buflen, int getpwuid_r(uid_t uid, struct passwd *, char *buf, size_t buflen,


Loading…
Cancel
Save