mirror of git://sourceware.org/git/glibc.git
* nscd/initgrcache.c (addinitgroupsX): Judge successful lookups by
status of NSS calls, not the number of returned entries.
This commit is contained in:
parent
a4518922f3
commit
fbbc73b3d7
|
|
@ -1,5 +1,8 @@
|
||||||
2006-08-01 Ulrich Drepper <drepper@redhat.com>
|
2006-08-01 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* nscd/initgrcache.c (addinitgroupsX): Judge successful lookups by
|
||||||
|
status of NSS calls, not the number of returned entries.
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/syscalls.list: Remove add_key,
|
* sysdeps/unix/sysv/linux/syscalls.list: Remove add_key,
|
||||||
request_key, keyctl.
|
request_key, keyctl.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,23 +33,23 @@ is_smp_system (void)
|
||||||
{
|
{
|
||||||
struct utsname uts;
|
struct utsname uts;
|
||||||
char buf[512];
|
char buf[512];
|
||||||
};
|
} u;
|
||||||
char *cp;
|
char *cp;
|
||||||
|
|
||||||
/* Try reading the number using `sysctl' first. */
|
/* Try reading the number using `sysctl' first. */
|
||||||
if (uname (&uts) == 0)
|
if (uname (&u.uts) == 0)
|
||||||
cp = uts.version;
|
cp = u.uts.version;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* This was not successful. Now try reading the /proc filesystem. */
|
/* This was not successful. Now try reading the /proc filesystem. */
|
||||||
int fd = open_not_cancel_2 ("/proc/sys/kernel/version", O_RDONLY);
|
int fd = open_not_cancel_2 ("/proc/sys/kernel/version", O_RDONLY);
|
||||||
if (__builtin_expect (fd, 0) == -1
|
if (__builtin_expect (fd, 0) == -1
|
||||||
|| (reslen = read_not_cancel (fd, buf, sizeof (buf))) <= 0)
|
|| read_not_cancel (fd, u.buf, sizeof (u.buf)) <= 0)
|
||||||
/* This also didn't work. We give up and say it's a UP machine. */
|
/* This also didn't work. We give up and say it's a UP machine. */
|
||||||
buf[0] = '\0';
|
u.buf[0] = '\0';
|
||||||
|
|
||||||
close_not_cancel_no_status (fd);
|
close_not_cancel_no_status (fd);
|
||||||
cp = buf;
|
cp = u.buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
return strstr (cp, "SMP") != NULL;
|
return strstr (cp, "SMP") != NULL;
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* Nothing added yet. */
|
/* Nothing added yet. */
|
||||||
|
bool any_success = false;
|
||||||
while (! no_more)
|
while (! no_more)
|
||||||
{
|
{
|
||||||
long int prev_start = start;
|
long int prev_start = start;
|
||||||
|
|
@ -158,6 +159,8 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
|
||||||
if (NSS_STATUS_TRYAGAIN > status || status > NSS_STATUS_RETURN)
|
if (NSS_STATUS_TRYAGAIN > status || status > NSS_STATUS_RETURN)
|
||||||
__libc_fatal ("illegal status in internal_getgrouplist");
|
__libc_fatal ("illegal status in internal_getgrouplist");
|
||||||
|
|
||||||
|
any_success |= status == NSS_STATUS_SUCCESS;
|
||||||
|
|
||||||
if (status != NSS_STATUS_SUCCESS
|
if (status != NSS_STATUS_SUCCESS
|
||||||
&& nss_next_action (nip, status) == NSS_ACTION_RETURN)
|
&& nss_next_action (nip, status) == NSS_ACTION_RETURN)
|
||||||
break;
|
break;
|
||||||
|
|
@ -171,7 +174,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
|
||||||
ssize_t total;
|
ssize_t total;
|
||||||
ssize_t written;
|
ssize_t written;
|
||||||
out:
|
out:
|
||||||
if (start == 0)
|
if (!any_success)
|
||||||
{
|
{
|
||||||
/* Nothing found. Create a negative result record. */
|
/* Nothing found. Create a negative result record. */
|
||||||
written = total = sizeof (notfound);
|
written = total = sizeof (notfound);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue