From 15d698437f9c7edd04aba454f0f87bc20aa7acf8 Mon Sep 17 00:00:00 2001 From: millert <> Date: Thu, 13 Sep 2018 12:31:15 +0000 Subject: [PATCH] Add uid_from_user() and gid_from_group(), derived from pax's cache.c. It replaces the existing pwcache.c functions user_from_uid(3) and group_from_gid(3) with the pax equivalents. Adapted from NetBSD (mycroft) changes from our own pax's cache.c. OK guenther@ --- src/include/grp.h | 5 +++-- src/include/pwd.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/include/grp.h b/src/include/grp.h index 2a1a6c7f..ebf65189 100644 --- a/src/include/grp.h +++ b/src/include/grp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: grp.h,v 1.12 2014/08/31 04:04:38 guenther Exp $ */ +/* $OpenBSD: grp.h,v 1.13 2018/09/13 12:31:15 millert Exp $ */ /* $NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $ */ /*- @@ -70,7 +70,8 @@ int getgrnam_r(const char *, struct group *, char *, #endif #if __BSD_VISIBLE int setgroupent(int); -char *group_from_gid(gid_t, int); +int gid_from_group(const char *, gid_t *); +const char *group_from_gid(gid_t, int); #endif __END_DECLS diff --git a/src/include/pwd.h b/src/include/pwd.h index 6a532200..84107349 100644 --- a/src/include/pwd.h +++ b/src/include/pwd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pwd.h,v 1.25 2017/03/09 10:13:03 fcambus Exp $ */ +/* $OpenBSD: pwd.h,v 1.26 2018/09/13 12:31:15 millert Exp $ */ /* $NetBSD: pwd.h,v 1.9 1996/05/15 21:36:45 jtc Exp $ */ /*- @@ -106,7 +106,8 @@ void endpwent(void); #endif #if __BSD_VISIBLE int setpassent(int); -char *user_from_uid(uid_t, int); +int uid_from_user(const char *, uid_t *); +const char *user_from_uid(uid_t, int); char *bcrypt_gensalt(u_int8_t); char *bcrypt(const char *, const char *); int bcrypt_newhash(const char *, int, char *, size_t);