Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Apply patch from OGAWA Takaya to fix FreeBSD hosted builds.



details:   https://anonhg.NetBSD.org/src/rev/9d3ff37e4519
branches:  trunk
changeset: 566736:9d3ff37e4519
user:      sjg <sjg%NetBSD.org@localhost>
date:      Tue May 18 22:14:35 2004 +0000

description:
Apply patch from OGAWA Takaya to fix FreeBSD hosted builds.
The trick is to force use of the NetBSD versions of user_from_{uid,gid}().

PR: 24843

diffstat:

 lib/libc/gen/pwcache.c     |  14 ++++++--------
 tools/compat/compat_defs.h |   7 ++++++-
 tools/compat/compat_pwd.h  |   7 +------
 3 files changed, 13 insertions(+), 15 deletions(-)

diffs (117 lines):

diff -r bd7f473d1499 -r 9d3ff37e4519 lib/libc/gen/pwcache.c
--- a/lib/libc/gen/pwcache.c    Tue May 18 21:47:45 2004 +0000
+++ b/lib/libc/gen/pwcache.c    Tue May 18 22:14:35 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pwcache.c,v 1.26 2004/04/23 02:58:27 simonb Exp $      */
+/*     $NetBSD: pwcache.c,v 1.27 2004/05/18 22:14:35 sjg Exp $ */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -66,12 +66,16 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
 #if 0
 static char sccsid[] = "@(#)cache.c    8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: pwcache.c,v 1.26 2004/04/23 02:58:27 simonb Exp $");
+__RCSID("$NetBSD: pwcache.c,v 1.27 2004/05/18 22:14:35 sjg Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -240,7 +244,6 @@
        return (0);
 }
 
-#if !HAVE_USER_FROM_UID
 /*
  * user_from_uid()
  *     caches the name (if any) for the uid. If noname clear, we always
@@ -249,7 +252,6 @@
  * Return
  *     Pointer to stored name (or a empty string)
  */
-
 const char *
 user_from_uid(uid_t uid, int noname)
 {
@@ -319,7 +321,6 @@
  * Return
  *     Pointer to stored name (or a empty string)
  */
-
 const char *
 group_from_gid(gid_t gid, int noname)
 {
@@ -380,7 +381,6 @@
        }
        return (ptr->name);
 }
-#endif /* HAVE_USER_FROM_UID */
 
 /*
  * uid_from_user()
@@ -388,7 +388,6 @@
  * Return
  *     the uid (if any) for a user name, or a -1 if no match can be found
  */
-
 int
 uid_from_user(const char *name, uid_t *uid)
 {
@@ -453,7 +452,6 @@
  * Return
  *     the gid (if any) for a group name, or a -1 if no match can be found
  */
-
 int
 gid_from_group(const char *name, gid_t *gid)
 {
diff -r bd7f473d1499 -r 9d3ff37e4519 tools/compat/compat_defs.h
--- a/tools/compat/compat_defs.h        Tue May 18 21:47:45 2004 +0000
+++ b/tools/compat/compat_defs.h        Tue May 18 22:14:35 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_defs.h,v 1.34 2004/04/24 15:46:24 matt Exp $    */
+/*     $NetBSD: compat_defs.h,v 1.35 2004/05/18 22:14:35 sjg Exp $     */
 
 #ifndef        __NETBSD_COMPAT_DEFS_H__
 #define        __NETBSD_COMPAT_DEFS_H__
@@ -245,6 +245,11 @@
 int gid_from_group(const char *, gid_t *);
 int pwcache_groupdb(int (*)(int), void (*)(void),
                struct group * (*)(const char *), struct group * (*)(gid_t));
+# if HAVE_USER_FROM_UID
+/* Make them use our version */
+#  define user_from_uid __nbcompat_user_from_uid
+#  define group_from_gid __nbcompat_group_from_gid
+# endif
 #endif
 
 #if !HAVE_PWRITE
diff -r bd7f473d1499 -r 9d3ff37e4519 tools/compat/compat_pwd.h
--- a/tools/compat/compat_pwd.h Tue May 18 21:47:45 2004 +0000
+++ b/tools/compat/compat_pwd.h Tue May 18 22:14:35 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_pwd.h,v 1.2 2002/07/03 17:17:04 pooka Exp $     */
+/*     $NetBSD: compat_pwd.h,v 1.3 2004/05/18 22:14:35 sjg Exp $       */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -41,11 +41,6 @@
 
 /* A very special version of <pwd.h> for pwd_mkdb(8) and __nbcompat_pwscan(3). */
 
-#if HAVE_USER_FROM_UID
-#define user_from_uid __nbcompat_system_user_from_uid
-#define group_from_gid __nbcompat_system_group_from_gid
-#endif
-
 #include "../../include/pwd.h"
 
 #define passwd __nbcompat_passwd



Home | Main Index | Thread Index | Old Index