Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tools/compat split all the password and group translation fu...
details: https://anonhg.NetBSD.org/src/rev/cb9aa462239d
branches: trunk
changeset: 747801:cb9aa462239d
user: christos <christos%NetBSD.org@localhost>
date: Fri Oct 02 18:03:19 2009 +0000
description:
split all the password and group translation functions into individual
ifdefs instead of having a large one.
diffstat:
tools/compat/compat_defs.h | 48 ++++++++++++++++++++++++++++++++++-----------
1 files changed, 36 insertions(+), 12 deletions(-)
diffs (81 lines):
diff -r 965bbcaf95e1 -r cb9aa462239d tools/compat/compat_defs.h
--- a/tools/compat/compat_defs.h Fri Oct 02 17:48:39 2009 +0000
+++ b/tools/compat/compat_defs.h Fri Oct 02 18:03:19 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_defs.h,v 1.72 2009/02/24 22:25:24 sketch Exp $ */
+/* $NetBSD: compat_defs.h,v 1.73 2009/10/02 18:03:19 christos Exp $ */
#ifndef __NETBSD_COMPAT_DEFS_H__
#define __NETBSD_COMPAT_DEFS_H__
@@ -345,36 +345,60 @@
* 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 || !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
+#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
#endif
#if !HAVE_DECL_UID_FROM_USER
int uid_from_user(const char *, uid_t *);
#endif
+
#if !HAVE_DECL_USER_FROM_UID
const char *user_from_uid(uid_t, int);
#endif
+
#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
int gid_from_group(const char *, gid_t *);
#endif
+
#if !HAVE_DECL_GROUP_FROM_GID
const char *group_from_gid(gid_t, int);
#endif
+
#if !HAVE_DECL_PWCACHE_GROUPDB
int pwcache_groupdb(int (*)(int), void (*)(void),
- struct group * (*)(const char *), struct group * (*)(gid_t));
+ struct group * (*)(const char *), struct group * (*)(gid_t));
#endif
#if !HAVE_DECL_STRNDUP
Home |
Main Index |
Thread Index |
Old Index