Source-Changes-HG archive

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

[src/trunk]: src/tools/compat Revert most of revision 1.73:



details:   https://anonhg.NetBSD.org/src/rev/d49e752c3f37
branches:  trunk
changeset: 748960:d49e752c3f37
user:      tron <tron%NetBSD.org@localhost>
date:      Wed Nov 11 21:53:46 2009 +0000

description:
Revert most of revision 1.73:
We cannot user_from_uid(3) or group_from_gid(3) unless the system
also supports pwcache_userdb(3) and pwcache_groupdb(3). The build will
use the hosts password and user database otherwise. Switch back to the
old behaviour to only the native functions if they are all present.
This fixes cross builds under Mac OS X and FreeBSD.

Fix based on problem analysis provided by Akihiko Hayashi.

diffstat:

 tools/compat/compat_defs.h |  41 +++++++++++------------------------------
 1 files changed, 11 insertions(+), 30 deletions(-)

diffs (62 lines):

diff -r 3d578ce72d6a -r d49e752c3f37 tools/compat/compat_defs.h
--- a/tools/compat/compat_defs.h        Wed Nov 11 19:03:52 2009 +0000
+++ b/tools/compat/compat_defs.h        Wed Nov 11 21:53:46 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_defs.h,v 1.74 2009/11/06 18:26:06 joerg Exp $   */
+/*     $NetBSD: compat_defs.h,v 1.75 2009/11/11 21:53:46 tron Exp $    */
 
 #ifndef        __NETBSD_COMPAT_DEFS_H__
 #define        __NETBSD_COMPAT_DEFS_H__
@@ -345,34 +345,15 @@
  * XXX host system has all of these functions, all of their interfaces
  * XXX and interactions are exactly the same as in our libc/libutil -- ugh.
  */
-#if !HAVE_USER_FROM_UID
-# define user_from_uid __nbcompat_user_from_uid
-# undef HAVE_DECL_USER_FROM_UID
-#endif
-
-#if !HAVE_UID_FROM_USER
-# define uid_from_user __nbcompat_uid_from_user
-# undef HAVE_DECL_UID_FROM_USER
-#endif
-
-#if !HAVE_PWCACHE_USERDB
-# define pwcache_userdb __nbcompat_pwcache_userdb
-# undef HAVE_DECL_PWCACHE_USERDB
-#endif
-
-#if !HAVE_GROUP_FROM_GID
-# define group_from_gid __nbcompat_group_from_gid
-# undef HAVE_DECL_GROUP_FROM_GID
-#endif
-
-#if !HAVE_GID_FROM_GROUP
-# define gid_from_group __nbcompat_gid_from_group
-# undef HAVE_DECL_GID_FROM_GROUP
-#endif
-
-#if !HAVE_PWCACHE_GROUDB
-# define pwcache_groupdb __nbcompat_pwcache_groupdb
-# undef HAVE_DECL_PWCACHE_GROUPDB
+#if !HAVE_USER_FROM_UID || !HAVE_UID_FROM_USER || !HAVE_GROUP_FROM_GID || \
+    !HAVE_GID_FROM_GROUP || !HAVE_PWCACHE_USERDB || !HAVE_PWCACHE_GROUDB
+/* Make them use our version */
+#  define user_from_uid __nbcompat_user_from_uid
+#  define uid_from_user __nbcompat_uid_from_user
+#  define pwcache_userdb __nbcompat_pwcache_userdb
+#  define group_from_gid __nbcompat_group_from_gid
+#  define gid_from_group __nbcompat_gid_from_group
+#  define pwcache_groupdb __nbcompat_pwcache_groupdb
 #endif
 
 #if !HAVE_DECL_UID_FROM_USER
@@ -385,7 +366,7 @@
 
 #if !HAVE_DECL_PWCACHE_USERDB
 int pwcache_userdb(int (*)(int), void (*)(void),
-    struct passwd * (*)(const char *), struct passwd * (*)(uid_t));
+                struct passwd * (*)(const char *), struct passwd * (*)(uid_t));
 #endif
 
 #if !HAVE_DECL_GID_FROM_GROUP



Home | Main Index | Thread Index | Old Index