about summary refs log tree commit diff
path: root/nis/nis_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nis_table.c')
-rw-r--r--nis/nis_table.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/nis/nis_table.c b/nis/nis_table.c
index 70b4701419..cb25be61e2 100644
--- a/nis/nis_table.c
+++ b/nis/nis_table.c
@@ -1,5 +1,4 @@
-/* Copyright (c) 1997-1999, 2003, 2004, 2005, 2006, 2007
-   Free Software Foundation, Inc.
+/* Copyright (c) 1997-1999,2003,2004,2005,2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
 
@@ -275,14 +274,21 @@ nis_list (const_nis_name name, unsigned int flags,
       memset (res, '\0', sizeof (nis_result));
 
       status = __nisfind_server (ibreq->ibr_name,
-				 ibreq->ibr_srch.ibr_srch_val != NULL,
-				 &dir, &bptr, flags & ~MASTER_ONLY);
+				 ibreq->ibr_srch.ibr_srch_val != NULL, &dir);
       if (status != NIS_SUCCESS)
 	{
           NIS_RES_STATUS (res) = status;
           goto fail3;
 	}
 
+      status = __nisbind_create (&bptr, dir->do_servers.do_servers_val,
+				 dir->do_servers.do_servers_len, flags);
+      if (__builtin_expect (status != NIS_SUCCESS, 0))
+        {
+          NIS_RES_STATUS (res) = status;
+	  goto fail2;
+        }
+
       while (__nisbind_connect (&bptr) != NIS_SUCCESS)
 	if (__builtin_expect (__nisbind_next (&bptr) != NIS_SUCCESS, 0))
 	  {
@@ -332,6 +338,7 @@ nis_list (const_nis_name name, unsigned int flags,
 		    NIS_RES_STATUS (res) = NIS_NOMEMORY;
 		  fail:
 		    __nisbind_destroy (&bptr);
+		  fail2:
 		    nis_free_directory (dir);
 		  fail3:
 		    free (tablepath);