mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
Fix inconsistent passwd compensation in nss/bug17079.c
It used to be common practice to have a statically linked shell for an alternative root account, as in: root❌0:0:root:/root:/bin/bash toor❌0:0:root recovery account:/root:/sbin/sash This causes problems with passwd NSS tests because a UID-based lookup will only retrieve one of those entries. The original version of nss/bug17079.c detected this, but failed to use this information later on.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2015-09-25 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
|
* nss/bug17079.c (init_test_items): Add diagnostic for
|
||||||
|
inconsistent entries.
|
||||||
|
(test_buffer_size): Skip inconsistent entries.
|
||||||
|
|
||||||
2015-09-25 Joseph Myers <joseph@codesourcery.com>
|
2015-09-25 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
[BZ #13304]
|
[BZ #13304]
|
||||||
|
@@ -72,7 +72,11 @@ init_test_items (void)
|
|||||||
struct passwd *pwd2 = getpwuid (test_items[i].pw_uid);
|
struct passwd *pwd2 = getpwuid (test_items[i].pw_uid);
|
||||||
if (pwd1 == NULL || !equal (pwd1, test_items + i)
|
if (pwd1 == NULL || !equal (pwd1, test_items + i)
|
||||||
|| pwd2 == NULL || !equal (pwd2, test_items + i))
|
|| pwd2 == NULL || !equal (pwd2, test_items + i))
|
||||||
test_items[i].pw_name = NULL;
|
{
|
||||||
|
printf ("info: skipping user \"%s\", UID %ld due to inconsistency\n",
|
||||||
|
test_items[i].pw_name, (long) test_items[i].pw_uid);
|
||||||
|
test_items[i].pw_name = NULL;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
@@ -195,6 +199,10 @@ test_buffer_size (size_t buffer_size)
|
|||||||
for (int i = 0; i < test_count; ++i)
|
for (int i = 0; i < test_count; ++i)
|
||||||
for (size_t padding_size = 0; padding_size < 3; ++padding_size)
|
for (size_t padding_size = 0; padding_size < 3; ++padding_size)
|
||||||
{
|
{
|
||||||
|
/* Skip entries with inconsistent name/UID lookups. */
|
||||||
|
if (test_items[i].pw_name == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
test_one (test_items + i, buffer_size, '\0', padding_size);
|
test_one (test_items + i, buffer_size, '\0', padding_size);
|
||||||
if (padding_size > 0)
|
if (padding_size > 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user