|
|
147e83 |
commit 5a9af6376d43b58c6545feb86002812a57956654
|
|
|
147e83 |
Author: Florian Weimer <fweimer@redhat.com>
|
|
|
147e83 |
Date: Fri Sep 25 20:20:33 2015 +0200
|
|
|
147e83 |
|
|
|
147e83 |
Fix inconsistent passwd compensation in nss/bug17079.c
|
|
|
147e83 |
|
|
|
147e83 |
It used to be common practice to have a statically linked shell for an
|
|
|
147e83 |
alternative root account, as in:
|
|
|
147e83 |
|
|
|
147e83 |
root:x:0:0:root:/root:/bin/bash
|
|
|
147e83 |
toor:x:0:0:root recovery account:/root:/sbin/sash
|
|
|
147e83 |
|
|
|
147e83 |
This causes problems with passwd NSS tests because a UID-based lookup
|
|
|
147e83 |
will only retrieve one of those entries. The original version of
|
|
|
147e83 |
nss/bug17079.c detected this, but failed to use this information later
|
|
|
147e83 |
on.
|
|
|
147e83 |
|
|
|
147e83 |
diff --git a/nss/bug17079.c b/nss/bug17079.c
|
|
|
147e83 |
index 9846737..0249922 100644
|
|
|
147e83 |
--- a/nss/bug17079.c
|
|
|
147e83 |
+++ b/nss/bug17079.c
|
|
|
147e83 |
@@ -72,7 +72,11 @@ init_test_items (void)
|
|
|
147e83 |
struct passwd *pwd2 = getpwuid (test_items[i].pw_uid);
|
|
|
147e83 |
if (pwd1 == NULL || !equal (pwd1, test_items + i)
|
|
|
147e83 |
|| pwd2 == NULL || !equal (pwd2, test_items + i))
|
|
|
147e83 |
- test_items[i].pw_name = NULL;
|
|
|
147e83 |
+ {
|
|
|
147e83 |
+ printf ("info: skipping user \"%s\", UID %ld due to inconsistency\n",
|
|
|
147e83 |
+ test_items[i].pw_name, (long) test_items[i].pw_uid);
|
|
|
147e83 |
+ test_items[i].pw_name = NULL;
|
|
|
147e83 |
+ }
|
|
|
147e83 |
else
|
|
|
147e83 |
found = true;
|
|
|
147e83 |
}
|
|
|
147e83 |
@@ -195,6 +199,10 @@ test_buffer_size (size_t buffer_size)
|
|
|
147e83 |
for (int i = 0; i < test_count; ++i)
|
|
|
147e83 |
for (size_t padding_size = 0; padding_size < 3; ++padding_size)
|
|
|
147e83 |
{
|
|
|
147e83 |
+ /* Skip entries with inconsistent name/UID lookups. */
|
|
|
147e83 |
+ if (test_items[i].pw_name == NULL)
|
|
|
147e83 |
+ continue;
|
|
|
147e83 |
+
|
|
|
147e83 |
test_one (test_items + i, buffer_size, '\0', padding_size);
|
|
|
147e83 |
if (padding_size > 0)
|
|
|
147e83 |
{
|