[23463] in Source-Commits
/svn/athena r23113 - in trunk/debathena/debathena/libnss-nonlocal: . debian
daemon@ATHENA.MIT.EDU (andersk@MIT.EDU)
Tue Jul 29 07:17:28 2008
Date: Tue, 29 Jul 2008 07:16:51 -0400 (EDT)
From: andersk@MIT.EDU
Message-Id: <200807291116.HAA15561@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: andersk
Date: 2008-07-29 07:16:49 -0400 (Tue, 29 Jul 2008)
New Revision: 23113
Added:
trunk/debathena/debathena/libnss-nonlocal/Makefile.am
trunk/debathena/debathena/libnss-nonlocal/configure.ac
Removed:
trunk/debathena/debathena/libnss-nonlocal/Makefile
trunk/debathena/debathena/libnss-nonlocal/libnss_nonlocal.map
Modified:
trunk/debathena/debathena/libnss-nonlocal/debian/changelog
trunk/debathena/debathena/libnss-nonlocal/debian/control
trunk/debathena/debathena/libnss-nonlocal/debian/rules
trunk/debathena/debathena/libnss-nonlocal/nonlocal-group.c
trunk/debathena/debathena/libnss-nonlocal/nonlocal-passwd.c
trunk/debathena/debathena/libnss-nonlocal/nonlocal.h
trunk/debathena/debathena/libnss-nonlocal/nsswitch-internal.h
Log:
In libnss-nonlocal:
* Replace the magic buflen hack with explicit iteration over the nss
chain, so that getpwent/getgrent works with nscd enabled.
* Fix some memory leaks.
* Autotoolfiscate.
* Code cleanup.
Deleted: trunk/debathena/debathena/libnss-nonlocal/Makefile
Added: trunk/debathena/debathena/libnss-nonlocal/Makefile.am
Added: trunk/debathena/debathena/libnss-nonlocal/configure.ac
Modified: trunk/debathena/debathena/libnss-nonlocal/debian/changelog
===================================================================
--- trunk/debathena/debathena/libnss-nonlocal/debian/changelog 2008-07-28 17:08:32 UTC (rev 23112)
+++ trunk/debathena/debathena/libnss-nonlocal/debian/changelog 2008-07-29 11:16:49 UTC (rev 23113)
@@ -1,3 +1,13 @@
+libnss-nonlocal (1.7-0debathena1) unstable; urgency=low
+
+ * Replace the magic buflen hack with explicit iteration over the nss
+ chain, so that getpwent/getgrent works with nscd enabled.
+ * Fix some memory leaks.
+ * Autotoolfiscate.
+ * Code cleanup.
+
+ -- Anders Kaseorg <andersk@mit.edu> Tue, 29 Jul 2008 06:57:53 -0400
+
libnss-nonlocal (1.6-0debathena1) unstable; urgency=low
* Use a version script to hide internal symbols.
Modified: trunk/debathena/debathena/libnss-nonlocal/debian/control
===================================================================
--- trunk/debathena/debathena/libnss-nonlocal/debian/control 2008-07-28 17:08:32 UTC (rev 23112)
+++ trunk/debathena/debathena/libnss-nonlocal/debian/control 2008-07-29 11:16:49 UTC (rev 23113)
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Debian-Athena Project <debathena@mit.edu>
Standards-Version: 3.7.2
-Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0)
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0), libtool, automake1.9, autoconf
Package: libnss-nonlocal
Architecture: any
Modified: trunk/debathena/debathena/libnss-nonlocal/debian/rules
===================================================================
--- trunk/debathena/debathena/libnss-nonlocal/debian/rules 2008-07-28 17:08:32 UTC (rev 23112)
+++ trunk/debathena/debathena/libnss-nonlocal/debian/rules 2008-07-29 11:16:49 UTC (rev 23113)
@@ -1,6 +1,22 @@
#!/usr/bin/make -f
+DEB_AUTO_UPDATE_AUTOCONF = 2.50
+DEB_AUTO_UPDATE_AUTOHEADER = 2.50
+DEB_AUTO_UPDATE_AUTOMAKE = 1.9
+DEB_AUTO_UPDATE_ACLOCAL = 1.9
+DEB_AUTO_UPDATE_LIBTOOL = pre
+
include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/makefile.mk
+include /usr/share/cdbs/1/class/autotools.mk
-DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(DEB_DESTDIR)
+DEB_CONFIGURE_PREFIX = /
+
+debian/stamp-autotools-files: DEB_AUTO_UPDATE_AUTOMAKE += --foreign --add-missing
+
+debian/stamp-autotools-files: aclocal.m4
+aclocal.m4:
+ touch $@
+
+clean::
+ rm -f aclocal.m4 config.guess config.sub install-sh ltmain.sh \
+ configure config.h.in missing depcomp Makefile.in
Deleted: trunk/debathena/debathena/libnss-nonlocal/libnss_nonlocal.map
Modified: trunk/debathena/debathena/libnss-nonlocal/nonlocal-group.c
===================================================================
--- trunk/debathena/debathena/libnss-nonlocal/nonlocal-group.c 2008-07-28 17:08:32 UTC (rev 23112)
+++ trunk/debathena/debathena/libnss-nonlocal/nonlocal-group.c 2008-07-29 11:16:49 UTC (rev 23113)
@@ -41,11 +41,19 @@
#include "nsswitch-internal.h"
#include "nonlocal.h"
-#define MAGIC_LOCAL_GR_BUFLEN (sysconf(_SC_GETGR_R_SIZE_MAX) + 7)
#define MAGIC_NONLOCAL_GROUPNAME "nss-nonlocal-users"
#define MAGIC_LOCAL_GROUPNAME "nss-local-users"
+enum nss_status
+_nss_nonlocal_getgrnam_r(const char *name, struct group *grp,
+ char *buffer, size_t buflen, int *errnop);
+
+enum nss_status
+_nss_nonlocal_getgrgid_r(gid_t gid, struct group *grp,
+ char *buffer, size_t buflen, int *errnop);
+
+
static service_user *
nss_group_nonlocal_database(void)
{
@@ -60,89 +68,131 @@
enum nss_status
check_nonlocal_gid(const char *user, gid_t gid, int *errnop)
{
- enum nss_status status = NSS_STATUS_SUCCESS;
+ static const char *fct_name = "getgrgid_r";
+ static service_user *startp = NULL;
+ static void *fct_start = NULL;
+ enum nss_status status;
+ service_user *nip;
+ union {
+ enum nss_status (*l)(gid_t gid, struct group *grp,
+ char *buffer, size_t buflen, int *errnop);
+ void *ptr;
+ } fct;
struct group gbuf;
- struct group *gbufp = &gbuf;
- int ret;
int old_errno = errno;
- int buflen = MAGIC_LOCAL_GR_BUFLEN;
+
+ int buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
char *buf = malloc(buflen);
if (buf == NULL) {
*errnop = ENOMEM;
errno = old_errno;
return NSS_STATUS_TRYAGAIN;
}
- errno = 0;
- ret = getgrgid_r(gid, gbufp, buf, buflen, &gbufp);
- if (ret != 0) {
- *errnop = old_errno;
- status = NSS_STATUS_TRYAGAIN;
- } else if (gbufp != NULL) {
+
+ if (fct_start == NULL &&
+ __nss_group_lookup(&startp, fct_name, &fct_start) != 0) {
+ free(buf);
+ return NSS_STATUS_UNAVAIL;
+ }
+ nip = startp;
+ fct.ptr = fct_start;
+ do {
+ if (fct.l == _nss_nonlocal_getgrgid_r)
+ status = NSS_STATUS_NOTFOUND;
+ else
+ status = DL_CALL_FCT(fct.l, (gid, &gbuf, buf, buflen, errnop));
+ if (status == NSS_STATUS_TRYAGAIN && *errnop == ERANGE)
+ break;
+ } while (__nss_next(&nip, fct_name, &fct.ptr, status, 0) == 0);
+
+ if (status == NSS_STATUS_SUCCESS) {
syslog(LOG_WARNING, "nss_nonlocal: removing local group %u (%s) from non-local user %s\n", gbuf.gr_gid, gbuf.gr_name, user);
status = NSS_STATUS_NOTFOUND;
+ } else if (status != NSS_STATUS_TRYAGAIN) {
+ status = NSS_STATUS_SUCCESS;
}
+
free(buf);
- errno = old_errno;
return status;
}
enum nss_status
get_local_group(const char *name, struct group *grp, char *buffer, size_t buflen, int *errnop)
{
- enum nss_status status = NSS_STATUS_NOTFOUND;
+ static const char *fct_name = "getgrnam_r";
+ static service_user *startp = NULL;
+ static void *fct_start = NULL;
+ enum nss_status status;
+ service_user *nip;
+ union {
+ enum nss_status (*l)(const char *name, struct group *grp,
+ char *buffer, size_t buflen, int *errnop);
+ void *ptr;
+ } fct;
struct group gbuf;
- struct group *gbufp = &gbuf;
- int ret, n;
+ int n;
int old_errno = errno;
- int len = MAGIC_LOCAL_GR_BUFLEN;
+
+ int len = sysconf(_SC_GETGR_R_SIZE_MAX);
char *buf = malloc(len);
if (buf == NULL) {
*errnop = ENOMEM;
errno = old_errno;
return NSS_STATUS_TRYAGAIN;
}
- errno = 0;
- ret = getgrnam_r(name, gbufp, buf, len, &gbufp);
- if (ret != 0) {
- *errnop = old_errno;
+
+ if (fct_start == NULL &&
+ __nss_group_lookup(&startp, fct_name, &fct_start) != 0) {
+ free(buf);
+ return NSS_STATUS_UNAVAIL;
+ }
+ nip = startp;
+ fct.ptr = fct_start;
+ do {
+ if (fct.l == _nss_nonlocal_getgrnam_r)
+ status = NSS_STATUS_NOTFOUND;
+ else
+ status = DL_CALL_FCT(fct.l, (name, &gbuf, buf, buflen, errnop));
+ if (status == NSS_STATUS_TRYAGAIN && *errnop == ERANGE)
+ break;
+ } while (__nss_next(&nip, fct_name, &fct.ptr, status, 0) == 0);
+
+ if (status != NSS_STATUS_SUCCESS)
+ goto get_local_group_done;
+
+ n = snprintf(buffer, buflen, "%s", gbuf.gr_name);
+ if (n < 0 || n >= buflen) {
+ *errnop = ERANGE;
status = NSS_STATUS_TRYAGAIN;
- } else if (gbufp != NULL) {
- status = NSS_STATUS_SUCCESS;
+ goto get_local_group_done;
+ }
+ grp->gr_name = buffer;
+ buffer += n;
+ buflen -= n;
- n = snprintf(buffer, buflen, "%s", gbufp->gr_name);
- if (n < 0 || n >= buflen) {
- *errnop = ERANGE;
- status = NSS_STATUS_TRYAGAIN;
- goto get_local_group_done;
- }
- grp->gr_name = buffer;
- buffer += n;
- buflen -= n;
+ n = snprintf(buffer, buflen, "%s", gbuf.gr_passwd);
+ if (n < 0 || n >= buflen) {
+ *errnop = ERANGE;
+ status = NSS_STATUS_TRYAGAIN;
+ goto get_local_group_done;
+ }
+ grp->gr_passwd = buffer;
+ buffer += n;
+ buflen -= n;
- n = snprintf(buffer, buflen, "%s", gbufp->gr_passwd);
- if (n < 0 || n >= buflen) {
- *errnop = ERANGE;
- status = NSS_STATUS_TRYAGAIN;
- goto get_local_group_done;
- }
- grp->gr_passwd = buffer;
- buffer += n;
- buflen -= n;
+ grp->gr_gid = gbuf.gr_gid;
- grp->gr_gid = gbufp->gr_gid;
+ if (buflen < sizeof(void *)) {
+ *errnop = ERANGE;
+ status = NSS_STATUS_TRYAGAIN;
+ goto get_local_group_done;
+ }
+ *(void **)buffer = NULL;
+ buffer += sizeof(void *);
+ buflen -= sizeof(void *);
- if (buflen < sizeof(void *)) {
- *errnop = ERANGE;
- status = NSS_STATUS_TRYAGAIN;
- goto get_local_group_done;
- }
- *(void **)buffer = NULL;
- buffer += sizeof(void *);
- buflen -= sizeof(void *);
- }
get_local_group_done:
free(buf);
- errno = old_errno;
return status;
}
@@ -225,8 +275,7 @@
enum nss_status status;
char *nonlocal_ignore = getenv(NONLOCAL_IGNORE_ENV);
- if (buflen == MAGIC_LOCAL_GR_BUFLEN ||
- (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0'))
+ if (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0')
return NSS_STATUS_UNAVAIL;
if (grent_nip == NULL) {
@@ -271,8 +320,7 @@
} fct;
char *nonlocal_ignore = getenv(NONLOCAL_IGNORE_ENV);
- if (buflen == MAGIC_LOCAL_GR_BUFLEN ||
- (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0'))
+ if (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0')
return NSS_STATUS_UNAVAIL;
nip = nss_group_nonlocal_database();
@@ -310,8 +358,7 @@
} fct;
char *nonlocal_ignore = getenv(NONLOCAL_IGNORE_ENV);
- if (buflen == MAGIC_LOCAL_GR_BUFLEN ||
- (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0'))
+ if (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0')
return NSS_STATUS_UNAVAIL;
nip = nss_group_nonlocal_database();
@@ -358,10 +405,10 @@
/* Check that the user is a nonlocal user before adding any groups. */
status = check_nonlocal_user(user, errnop);
- if (status == NSS_STATUS_NOTFOUND)
+ if (status == NSS_STATUS_TRYAGAIN)
+ return status;
+ else if (status != NSS_STATUS_SUCCESS)
is_local = 1;
- else if (status != NSS_STATUS_SUCCESS)
- return status;
int old_errno = errno;
@@ -374,14 +421,16 @@
}
status = get_local_group(MAGIC_LOCAL_GROUPNAME,
&local_users_group, buffer, buflen, errnop);
- if (status == NSS_STATUS_NOTFOUND) {
+ if (status == NSS_STATUS_SUCCESS) {
+ local_users_gid = local_users_group.gr_gid;
+ } else if (status == NSS_STATUS_TRYAGAIN) {
+ free(buffer);
+ return status;
+ } else {
syslog(LOG_WARNING, "nss_nonlocal: Group %s does not exist locally!",
MAGIC_LOCAL_GROUPNAME);
local_users_gid = -1;
- } else if (status != NSS_STATUS_SUCCESS) {
- return status;
- } else
- local_users_gid = local_users_group.gr_gid;
+ }
free(buffer);
if (is_local) {
@@ -396,15 +445,16 @@
}
status = get_local_group(MAGIC_NONLOCAL_GROUPNAME,
&nonlocal_users_group, buffer, buflen, errnop);
- if (status == NSS_STATUS_NOTFOUND) {
+ if (status == NSS_STATUS_SUCCESS) {
+ gid = nonlocal_users_group.gr_gid;
+ } else if (status == NSS_STATUS_TRYAGAIN) {
+ free(buffer);
+ return status;
+ } else {
syslog(LOG_WARNING, "nss_nonlocal: Group %s does not exist locally!",
MAGIC_NONLOCAL_GROUPNAME);
gid = -1;
- } else if (status != NSS_STATUS_SUCCESS) {
- errno = old_errno;
- return status;
- } else
- gid = nonlocal_users_group.gr_gid;
+ }
free(buffer);
}
@@ -436,8 +486,6 @@
}
}
- errno = old_errno;
-
if (is_local)
return NSS_STATUS_SUCCESS;
@@ -480,7 +528,7 @@
status = check_nonlocal_gid(user, (*groupsp)[in], &nonlocal_errno);
if (status == NSS_STATUS_SUCCESS) {
(*groupsp)[out++] = (*groupsp)[in];
- } else if (status != NSS_STATUS_NOTFOUND) {
+ } else if (status == NSS_STATUS_TRYAGAIN) {
*start = out;
*errnop = nonlocal_errno;
return status;
Modified: trunk/debathena/debathena/libnss-nonlocal/nonlocal-passwd.c
===================================================================
--- trunk/debathena/debathena/libnss-nonlocal/nonlocal-passwd.c 2008-07-28 17:08:32 UTC (rev 23112)
+++ trunk/debathena/debathena/libnss-nonlocal/nonlocal-passwd.c 2008-07-29 11:16:49 UTC (rev 23113)
@@ -43,9 +43,15 @@
#include "nsswitch-internal.h"
#include "nonlocal.h"
-#define MAGIC_LOCAL_PW_BUFLEN (sysconf(_SC_GETPW_R_SIZE_MAX) + 7)
+enum nss_status
+_nss_nonlocal_getpwuid_r(uid_t uid, struct passwd *pwd,
+ char *buffer, size_t buflen, int *errnop);
+enum nss_status
+_nss_nonlocal_getpwnam_r(const char *name, struct passwd *pwd,
+ char *buffer, size_t buflen, int *errnop);
+
static service_user *
nss_passwd_nonlocal_database(void)
{
@@ -60,57 +66,100 @@
enum nss_status
check_nonlocal_uid(const char *user, uid_t uid, int *errnop)
{
- enum nss_status status = NSS_STATUS_SUCCESS;
+ static const char *fct_name = "getpwuid_r";
+ static service_user *startp = NULL;
+ static void *fct_start = NULL;
+ enum nss_status status;
+ service_user *nip;
+ union {
+ enum nss_status (*l)(uid_t uid, struct passwd *pwd,
+ char *buffer, size_t buflen, int *errnop);
+ void *ptr;
+ } fct;
struct passwd pwbuf;
- struct passwd *pwbufp = &pwbuf;
- int ret;
int old_errno = errno;
- int buflen = MAGIC_LOCAL_PW_BUFLEN;
+
+ int buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
char *buf = malloc(buflen);
if (buf == NULL) {
*errnop = ENOMEM;
errno = old_errno;
return NSS_STATUS_TRYAGAIN;
}
- errno = 0;
- ret = getpwuid_r(uid, pwbufp, buf, buflen, &pwbufp);
- if (ret != 0) {
- *errnop = errno;
- status = NSS_STATUS_TRYAGAIN;
- } else if (pwbufp != NULL) {
+
+ if (fct_start == NULL &&
+ __nss_passwd_lookup(&startp, fct_name, &fct_start) != 0) {
+ free(buf);
+ return NSS_STATUS_UNAVAIL;
+ }
+ nip = startp;
+ fct.ptr = fct_start;
+ do {
+ if (fct.l == _nss_nonlocal_getpwuid_r)
+ status = NSS_STATUS_NOTFOUND;
+ else
+ status = DL_CALL_FCT(fct.l, (uid, &pwbuf, buf, buflen, errnop));
+ if (status == NSS_STATUS_TRYAGAIN && *errnop == ERANGE)
+ break;
+ } while (__nss_next(&nip, fct_name, &fct.ptr, status, 0) == 0);
+
+ if (status == NSS_STATUS_SUCCESS) {
syslog(LOG_ERR, "nss_nonlocal: possible spoofing attack: non-local user %s has same UID as local user %s!\n", user, pwbuf.pw_name);
status = NSS_STATUS_NOTFOUND;
+ } else if (status != NSS_STATUS_TRYAGAIN) {
+ status = NSS_STATUS_SUCCESS;
}
+
free(buf);
- errno = old_errno;
return status;
}
enum nss_status
check_nonlocal_user(const char *user, int *errnop)
{
- enum nss_status status = NSS_STATUS_SUCCESS;
+ static const char *fct_name = "getpwnam_r";
+ static service_user *startp = NULL;
+ static void *fct_start = NULL;
+ enum nss_status status;
+ service_user *nip;
+ union {
+ enum nss_status (*l)(const char *name, struct passwd *pwd,
+ char *buffer, size_t buflen, int *errnop);
+ void *ptr;
+ } fct;
struct passwd pwbuf;
- struct passwd *pwbufp = &pwbuf;
- int ret;
int old_errno = errno;
- int buflen = MAGIC_LOCAL_PW_BUFLEN;
+
+ int buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
char *buf = malloc(buflen);
if (buf == NULL) {
*errnop = ENOMEM;
errno = old_errno;
return NSS_STATUS_TRYAGAIN;
}
- errno = 0;
- ret = getpwnam_r(user, pwbufp, buf, buflen, &pwbufp);
- if (ret != 0) {
- *errnop = errno;
- status = NSS_STATUS_TRYAGAIN;
- } else if (pwbufp != NULL) {
+
+ if (fct_start == NULL &&
+ __nss_passwd_lookup(&startp, fct_name, &fct_start) != 0) {
+ free(buf);
+ return NSS_STATUS_UNAVAIL;
+ }
+ nip = startp;
+ fct.ptr = fct_start;
+ do {
+ if (fct.l == _nss_nonlocal_getpwnam_r)
+ status = NSS_STATUS_NOTFOUND;
+ else
+ status = DL_CALL_FCT(fct.l, (user, &pwbuf, buf, buflen, errnop));
+ if (status == NSS_STATUS_TRYAGAIN && *errnop == ERANGE)
+ break;
+ } while (__nss_next(&nip, fct_name, &fct.ptr, status, 0) == 0);
+
+ if (status == NSS_STATUS_SUCCESS)
status = NSS_STATUS_NOTFOUND;
- }
+ else if (status != NSS_STATUS_TRYAGAIN)
+ status = NSS_STATUS_SUCCESS;
+
free(buf);
- errno = old_errno;
return status;
}
@@ -194,8 +243,7 @@
enum nss_status status;
char *nonlocal_ignore = getenv(NONLOCAL_IGNORE_ENV);
- if (buflen == MAGIC_LOCAL_PW_BUFLEN ||
- (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0'))
+ if (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0')
return NSS_STATUS_UNAVAIL;
if (pwent_nip == NULL) {
@@ -241,8 +289,7 @@
int group_errno;
char *nonlocal_ignore = getenv(NONLOCAL_IGNORE_ENV);
- if (buflen == MAGIC_LOCAL_PW_BUFLEN ||
- (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0'))
+ if (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0')
return NSS_STATUS_UNAVAIL;
nip = nss_passwd_nonlocal_database();
@@ -288,8 +335,7 @@
int group_errno;
char *nonlocal_ignore = getenv(NONLOCAL_IGNORE_ENV);
- if (buflen == MAGIC_LOCAL_PW_BUFLEN ||
- (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0'))
+ if (nonlocal_ignore != NULL && nonlocal_ignore[0] != '\0')
return NSS_STATUS_UNAVAIL;
nip = nss_passwd_nonlocal_database();
Modified: trunk/debathena/debathena/libnss-nonlocal/nonlocal.h
===================================================================
--- trunk/debathena/debathena/libnss-nonlocal/nonlocal.h 2008-07-28 17:08:32 UTC (rev 23112)
+++ trunk/debathena/debathena/libnss-nonlocal/nonlocal.h 2008-07-29 11:16:49 UTC (rev 23113)
@@ -1,7 +1,12 @@
#ifndef NONLOCAL_H
#define NONLOCAL_H
+
+#include "config.h"
+
enum nss_status check_nonlocal_uid(const char *user, uid_t uid, int *errnop);
enum nss_status check_nonlocal_gid(const char *user, gid_t gid, int *errnop);
enum nss_status check_nonlocal_user(const char *user, int *errnop);
+
#define NONLOCAL_IGNORE_ENV "NSS_NONLOCAL_IGNORE"
+
#endif /* NON_LOCAL_H */
Modified: trunk/debathena/debathena/libnss-nonlocal/nsswitch-internal.h
===================================================================
--- trunk/debathena/debathena/libnss-nonlocal/nsswitch-internal.h 2008-07-28 17:08:32 UTC (rev 23112)
+++ trunk/debathena/debathena/libnss-nonlocal/nsswitch-internal.h 2008-07-29 11:16:49 UTC (rev 23113)
@@ -6,21 +6,29 @@
#ifndef NSSWITCH_INTERNAL_H
#define NSSWITCH_INTERNAL_H
-typedef struct service_user service_user;
+#include "config.h"
-extern int
-__nss_next (service_user **ni, const char *fct_name, void **fctp, int status,
- int all_values);
+/* glibc/config.h.in */
+#if defined USE_REGPARMS && !defined PROF && !defined __BOUNDED_POINTERS__
+# define internal_function __attribute__ ((regparm (3), stdcall))
+#else
+# define internal_function
+#endif
-extern int
-__nss_database_lookup (const char *database,
- const char *alternative_name,
- const char *defconfig, service_user **ni);
+/* glibc/nss/nsswitch.h */
+typedef struct service_user service_user;
-extern int
-__nss_configure_lookup (const char *dbname, const char *service_line);
+extern int __nss_next (service_user **ni, const char *fct_name, void **fctp,
+ int status, int all_values);
+extern int __nss_database_lookup (const char *database,
+ const char *alternative_name,
+ const char *defconfig, service_user **ni);
+extern void *__nss_lookup_function (service_user *ni, const char *fct_name);
-extern void
-*__nss_lookup_function (service_user *ni, const char *fct_name);
+/* glibc/nss/XXX-lookup.c */
+extern int __nss_passwd_lookup (service_user **ni, const char *fct_name,
+ void **fctp) internal_function;
+extern int __nss_group_lookup (service_user **ni, const char *fct_name,
+ void **fctp) internal_function;
#endif /* NSSWITCH_INTERNAL_H */