Update.
authorUlrich Drepper <drepper@redhat.com>
Fri, 13 Aug 2004 23:24:09 +0000 (23:24 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 13 Aug 2004 23:24:09 +0000 (23:24 +0000)
* inet/getnetgrent_r.c (innetgr): We must get the lock used for
the set/get/end interfaces since we call all these functions in
succession and must not be interrupted doing this.
Reported by Chuck Simmons.

ChangeLog
inet/getnetgrent_r.c

index c481a3f..828a476 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2004-08-13  Ulrich Drepper  <drepper@redhat.com>
 
+       * inet/getnetgrent_r.c (innetgr): We must get the lock used for
+       the set/get/end interfaces since we call all these functions in
+       succession and must not be interrupted doing this.
+       Reported by Chuck Simmons.
+
        * inet/netgroup.h (struct name_list): Replace name pointer with
        zero-sized array.
        * inet/getnetgrent_r.c: Adjust code for change in name_list
index fa355b2..8785398 100644 (file)
@@ -344,6 +344,8 @@ innetgr (const char *netgroup, const char *host, const char *user,
   const char *current_group = netgroup;
   int real_entry = 0;
 
+  __libc_lock_lock (lock);
+
   /* Walk through the services until we found an answer or we shall
      not work further.  We can do some optimization here.  Since all
      services must provide the `setnetgrent' function we can do all
@@ -445,6 +447,8 @@ innetgr (const char *netgroup, const char *host, const char *user,
       break;
     }
 
+  __libc_lock_unlock (lock);
+
   /* Free the memory.  */
   while (known != NULL)
     {