summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2012-10-19 12:44:22 +0000
committerbrooks <brooks@FreeBSD.org>2012-10-19 12:44:22 +0000
commitcb3047054f01017776ffe7bc982fe6d6f5a08cdb (patch)
tree215be12bec7b0be963ae597a694b1e9054e3daab /include
parent3ec6e1c2f7079ab12b6a1573572b26641c1ec3f5 (diff)
parentbf5ab71b9ae38d07e5e8c32ca9d75e921206a04a (diff)
downloadFreeBSD-src-cb3047054f01017776ffe7bc982fe6d6f5a08cdb.zip
FreeBSD-src-cb3047054f01017776ffe7bc982fe6d6f5a08cdb.tar.gz
Replace our version of the pwcache(3) API with NetBSD's implementation.
This adds two features: * uid_from_user() and gid_from_group() as the reverse of user_from_uid() and groups_from_gid(). * pwcache_userdb() and pwcache_groupdb() which allow alternative lookup functions to be used. For example lookups from passwd and group databases in a non-standard location.
Diffstat (limited to 'include')
-rw-r--r--include/grp.h4
-rw-r--r--include/pwd.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/include/grp.h b/include/grp.h
index 2b9f73f..e7f65ec 100644
--- a/include/grp.h
+++ b/include/grp.h
@@ -69,6 +69,10 @@ struct group *getgrgid(gid_t);
struct group *getgrnam(const char *);
#if __BSD_VISIBLE
const char *group_from_gid(gid_t, int);
+int gid_from_group(const char *, gid_t *);
+int pwcache_groupdb(int (*)(int), void (*)(void),
+ struct group * (*)(const char *),
+ struct group * (*)(gid_t));
#endif
#if __BSD_VISIBLE || __XSI_VISIBLE
/* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */
diff --git a/include/pwd.h b/include/pwd.h
index 0a6dba1..2099e33 100644
--- a/include/pwd.h
+++ b/include/pwd.h
@@ -165,6 +165,10 @@ int getpwuid_r(uid_t, struct passwd *, char *, size_t,
int getpwent_r(struct passwd *, char *, size_t, struct passwd **);
int setpassent(int);
const char *user_from_uid(uid_t, int);
+int uid_from_user(const char *, uid_t *);
+int pwcache_userdb(int (*)(int), void (*)(void),
+ struct passwd * (*)(const char *),
+ struct passwd * (*)(uid_t));
#endif
__END_DECLS
OpenPOWER on IntegriCloud