summary refs log tree commit diff
path: root/nis/nss_compat
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-05-18 14:52:08 +0000
committerUlrich Drepper <drepper@redhat.com>2006-05-18 14:52:08 +0000
commit758b9d7efe599e3de3472593b6f8f03cfc29ea92 (patch)
tree2e7d4cf5fe8c0d5431c3951a55b2e5445b72261d /nis/nss_compat
parent5f1724bf0306309e7da4ebf7fcc19c03fdbf1142 (diff)
downloadglibc-758b9d7efe599e3de3472593b6f8f03cfc29ea92.tar.gz
glibc-758b9d7efe599e3de3472593b6f8f03cfc29ea92.tar.xz
glibc-758b9d7efe599e3de3472593b6f8f03cfc29ea92.zip
* nis/nss_compat/compat-pwd.c (internal_setpwent): If nss_set*ent
	returned NSS_STATUS_UNAVAIL, still return NSS_STATUS_SUCCESS.
	* nis/nss_compat/compat-spwd.c (internal_setspent): Likewise.
	* nis/nss_compat/compat-grp.c (internal_setgrent): Likewise.

	* nis/nss_compat/compat-initgroups.c (nss_setgrent, nss_endgrent):
	Removed.
	(init_nss_interface): Remove initialization of these variables.

2006-05-18  Ulrich Drepper  <drepper@redhat.com>

	* nis/nis_call.c (rec_dirsearch): Little optimization: pull
	nis_free_directory forward to avoid duplication.
Diffstat (limited to 'nis/nss_compat')
-rw-r--r--nis/nss_compat/compat-grp.c8
-rw-r--r--nis/nss_compat/compat-initgroups.c6
-rw-r--r--nis/nss_compat/compat-pwd.c8
-rw-r--r--nis/nss_compat/compat-spwd.c8
4 files changed, 19 insertions, 11 deletions
diff --git a/nis/nss_compat/compat-grp.c b/nis/nss_compat/compat-grp.c
index d51eb6d0f2..093876fd74 100644
--- a/nis/nss_compat/compat-grp.c
+++ b/nis/nss_compat/compat-grp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-1999,2001-2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1999,2001-2005,2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996.
 
@@ -138,7 +138,11 @@ internal_setgrent (ent_t *ent, int stayopen)
     rewind (ent->stream);
 
   if (status == NSS_STATUS_SUCCESS && nss_setgrent)
-    return nss_setgrent (stayopen);
+    {
+      status = nss_setgrent (stayopen);
+      if (status == NSS_STATUS_UNAVAIL)
+        status = NSS_STATUS_SUCCESS;
+    }
 
   return status;
 }
diff --git a/nis/nss_compat/compat-initgroups.c b/nis/nss_compat/compat-initgroups.c
index 9574ea7c0b..70403a0785 100644
--- a/nis/nss_compat/compat-initgroups.c
+++ b/nis/nss_compat/compat-initgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2003, 2004, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
 
@@ -36,7 +36,6 @@ static service_user *ni;
 static enum nss_status (*nss_initgroups_dyn) (const char *, gid_t,
 					      long int *, long int *,
 					      gid_t **, long int, int *);
-static enum nss_status (*nss_setgrent) (int stayopen);
 static enum nss_status (*nss_getgrnam_r) (const char *name,
 					  struct group * grp, char *buffer,
 					  size_t buflen, int *errnop);
@@ -45,7 +44,6 @@ static enum nss_status (*nss_getgrgid_r) (gid_t gid, struct group * grp,
 					  int *errnop);
 static enum nss_status (*nss_getgrent_r) (struct group * grp, char *buffer,
 					  size_t buflen, int *errnop);
-static enum nss_status (*nss_endgrent) (void);
 
 /* Protect global state against multiple changers.  */
 __libc_lock_define_initialized (static, lock)
@@ -92,11 +90,9 @@ init_nss_interface (void)
       && __nss_database_lookup ("group_compat", NULL, "nis", &ni) >= 0)
     {
       nss_initgroups_dyn = __nss_lookup_function (ni, "initgroups_dyn");
-      nss_setgrent = __nss_lookup_function (ni, "setgrent");
       nss_getgrnam_r = __nss_lookup_function (ni, "getgrnam_r");
       nss_getgrgid_r = __nss_lookup_function (ni, "getgrgid_r");
       nss_getgrent_r = __nss_lookup_function (ni, "getgrent_r");
-      nss_endgrent = __nss_lookup_function (ni, "endgrent");
     }
 
   __libc_lock_unlock (lock);
diff --git a/nis/nss_compat/compat-pwd.c b/nis/nss_compat/compat-pwd.c
index 43ccb27071..1031714529 100644
--- a/nis/nss_compat/compat-pwd.c
+++ b/nis/nss_compat/compat-pwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-1999,2001-2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1999,2001-2005,2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
@@ -258,7 +258,11 @@ internal_setpwent (ent_t *ent, int stayopen)
   give_pwd_free (&ent->pwd);
 
   if (status == NSS_STATUS_SUCCESS && nss_setpwent)
-    return nss_setpwent (stayopen);
+    {
+      status = nss_setpwent (stayopen);
+      if (status == NSS_STATUS_UNAVAIL)
+        status = NSS_STATUS_SUCCESS;
+    }
 
   return status;
 }
diff --git a/nis/nss_compat/compat-spwd.c b/nis/nss_compat/compat-spwd.c
index 120e3bd38d..5c820a5f65 100644
--- a/nis/nss_compat/compat-spwd.c
+++ b/nis/nss_compat/compat-spwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-1999,2001-2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1999,2001-2005,2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
@@ -212,7 +212,11 @@ internal_setspent (ent_t *ent, int stayopen)
   give_spwd_free (&ent->pwd);
 
   if (status == NSS_STATUS_SUCCESS && nss_setspent)
-    return nss_setspent (stayopen);
+    {
+      status = nss_setspent (stayopen);
+      if (status == NSS_STATUS_UNAVAIL)
+        status = NSS_STATUS_SUCCESS;
+    }
 
   return status;
 }