aboutsummaryrefslogtreecommitdiff
path: root/inet/getnetgrent_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-08-13 23:24:09 +0000
committerUlrich Drepper <drepper@redhat.com>2004-08-13 23:24:09 +0000
commita57532064137c37543e7e8861a8931444a21157c (patch)
treeefe6375dbb13bc0488bb4a2da678a4305a4074b5 /inet/getnetgrent_r.c
parent2486480e23051b536fa2ac612b0613105ba988cf (diff)
downloadglibc-a57532064137c37543e7e8861a8931444a21157c.tar
glibc-a57532064137c37543e7e8861a8931444a21157c.tar.gz
glibc-a57532064137c37543e7e8861a8931444a21157c.tar.bz2
glibc-a57532064137c37543e7e8861a8931444a21157c.zip
Update.
* 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.
Diffstat (limited to 'inet/getnetgrent_r.c')
-rw-r--r--inet/getnetgrent_r.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/inet/getnetgrent_r.c b/inet/getnetgrent_r.c
index fa355b210e..87853981cd 100644
--- a/inet/getnetgrent_r.c
+++ b/inet/getnetgrent_r.c
@@ -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)
{