svn commit: r245267 - in stable/9: include lib/libc/gen

Brooks Davis brooks at FreeBSD.org
Thu Jan 10 22:15:14 UTC 2013


Author: brooks
Date: Thu Jan 10 22:15:13 2013
New Revision: 245267
URL: http://svnweb.freebsd.org/changeset/base/245267

Log:
  MFC r241731:
  
  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.

Added:
     - copied from r245265, head/contrib/libc-pwcache/
Directory Properties:
  stable/9/contrib/libc-pwcache/   (props changed)
Deleted:
  stable/9/lib/libc/gen/pwcache.3
  stable/9/lib/libc/gen/pwcache.c
Modified:
  stable/9/include/grp.h
  stable/9/include/pwd.h
  stable/9/lib/libc/gen/Makefile.inc
  stable/9/lib/libc/gen/Symbol.map
Directory Properties:
  stable/9/include/   (props changed)
  stable/9/lib/libc/   (props changed)

Modified: stable/9/include/grp.h
==============================================================================
--- stable/9/include/grp.h	Thu Jan 10 21:38:31 2013	(r245266)
+++ stable/9/include/grp.h	Thu Jan 10 22:15:13 2013	(r245267)
@@ -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)' */

Modified: stable/9/include/pwd.h
==============================================================================
--- stable/9/include/pwd.h	Thu Jan 10 21:38:31 2013	(r245266)
+++ stable/9/include/pwd.h	Thu Jan 10 22:15:13 2013	(r245267)
@@ -165,6 +165,10 @@ int		 getpwuid_r(uid_t, struct passwd *,
 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
 

Modified: stable/9/lib/libc/gen/Makefile.inc
==============================================================================
--- stable/9/lib/libc/gen/Makefile.inc	Thu Jan 10 21:38:31 2013	(r245266)
+++ stable/9/lib/libc/gen/Makefile.inc	Thu Jan 10 22:15:13 2013	(r245267)
@@ -24,7 +24,7 @@ SRCS+=  __getosreldate.c __xuname.c \
 	lockf.c lrand48.c mrand48.c nftw.c nice.c \
 	nlist.c nrand48.c opendir.c \
 	pause.c pmadvise.c popen.c posix_spawn.c \
-	psignal.c pututxline.c pw_scan.c pwcache.c \
+	psignal.c pututxline.c pw_scan.c \
 	raise.c readdir.c readpassphrase.c rewinddir.c \
 	scandir.c seed48.c seekdir.c semctl.c \
 	setdomainname.c sethostname.c setjmperr.c setmode.c \
@@ -36,6 +36,9 @@ SRCS+=  __getosreldate.c __xuname.c \
 	usleep.c utime.c utxdb.c valloc.c vis.c wait.c wait3.c waitpid.c \
 	waitid.c wordexp.c
 
+.PATH: ${.CURDIR}/../../contrib/libc-pwcache
+SRCS+=	pwcache.c pwcache.h
+
 CANCELPOINTS_SRCS=sem.c sem_new.c
 .for src in ${CANCELPOINTS_SRCS}
 SRCS+=cancelpoints_${src}

Modified: stable/9/lib/libc/gen/Symbol.map
==============================================================================
--- stable/9/lib/libc/gen/Symbol.map	Thu Jan 10 21:38:31 2013	(r245266)
+++ stable/9/lib/libc/gen/Symbol.map	Thu Jan 10 22:15:13 2013	(r245267)
@@ -384,6 +384,10 @@ FBSD_1.3 {
 	 fdlopen;
 	__FreeBSD_libc_enter_restricted_mode;
 	getcontextx;
+	gid_from_group;
+	pwcache_userdb;
+	pwcache_groupdb;
+	uid_from_user;
 	waitid;
 };
 


More information about the svn-src-all mailing list