libnsl: Turn remaining symbols into compat symbols [BZ #22701]
Commit Message
On 01/30/2018 02:01 AM, Joseph Myers wrote:
> I think this introduces test failures in the case where there is an
> installed libnss_nis but you're not using --enable-obsolete-nsl, if
> /etc/nsswitch.conf has "passwd: compat".
>
> FAIL: nss/bug17079
> FAIL: nss/tst-nss-getpwent
>
> The output of make check for those tests shows (seen on Ubuntu 16.04):
> "relocation error: /lib/x86_64-linux-gnu/libnss_nis.so.2: symbol
> _nsl_default_nss version GLIBC_PRIVATE not defined in file libnsl.so.1
> with link time reference", for both those tests.
Please try the attached patch. It should not interfere with the test goal.
The issue could also be avoided if we disabled lazy binding for loading
NSS modules, so that the module wouldn't be loaded at all, instead
crashing later at run time.
Thanks,
Florian
Comments
On Tue, 30 Jan 2018, Florian Weimer wrote:
> On 01/30/2018 02:01 AM, Joseph Myers wrote:
> > I think this introduces test failures in the case where there is an
> > installed libnss_nis but you're not using --enable-obsolete-nsl, if
> > /etc/nsswitch.conf has "passwd: compat".
> >
> > FAIL: nss/bug17079
> > FAIL: nss/tst-nss-getpwent
> >
> > The output of make check for those tests shows (seen on Ubuntu 16.04):
> > "relocation error: /lib/x86_64-linux-gnu/libnss_nis.so.2: symbol
> > _nsl_default_nss version GLIBC_PRIVATE not defined in file libnsl.so.1
> > with link time reference", for both those tests.
>
> Please try the attached patch. It should not interfere with the test goal.
I confirm that this fixes those test failures for me.
On Tue, Jan 30, 2018 at 01:14:18PM +0000, Joseph Myers wrote:
> On Tue, 30 Jan 2018, Florian Weimer wrote:
> > On 01/30/2018 02:01 AM, Joseph Myers wrote:
> > > I think this introduces test failures in the case where there is an
> > > installed libnss_nis but you're not using --enable-obsolete-nsl, if
> > > /etc/nsswitch.conf has "passwd: compat".
> > >
> > > FAIL: nss/bug17079
> > > FAIL: nss/tst-nss-getpwent
> > >
> > > The output of make check for those tests shows (seen on Ubuntu 16.04):
> > > "relocation error: /lib/x86_64-linux-gnu/libnss_nis.so.2: symbol
> > > _nsl_default_nss version GLIBC_PRIVATE not defined in file libnsl.so.1
> > > with link time reference", for both those tests.
> >
> > Please try the attached patch. It should not interfere with the test goal.
>
> I confirm that this fixes those test failures for me.
Thanks, I think this patch should be applied then.
On 01/30/2018 02:24 PM, Dmitry V. Levin wrote:
> On Tue, Jan 30, 2018 at 01:14:18PM +0000, Joseph Myers wrote:
>> On Tue, 30 Jan 2018, Florian Weimer wrote:
>>> On 01/30/2018 02:01 AM, Joseph Myers wrote:
>>>> I think this introduces test failures in the case where there is an
>>>> installed libnss_nis but you're not using --enable-obsolete-nsl, if
>>>> /etc/nsswitch.conf has "passwd: compat".
>>>>
>>>> FAIL: nss/bug17079
>>>> FAIL: nss/tst-nss-getpwent
>>>>
>>>> The output of make check for those tests shows (seen on Ubuntu 16.04):
>>>> "relocation error: /lib/x86_64-linux-gnu/libnss_nis.so.2: symbol
>>>> _nsl_default_nss version GLIBC_PRIVATE not defined in file libnsl.so.1
>>>> with link time reference", for both those tests.
>>>
>>> Please try the attached patch. It should not interfere with the test goal.
>>
>> I confirm that this fixes those test failures for me.
>
> Thanks, I think this patch should be applied then.
Thanks, I've pushed it.
Florian
Subject: [PATCH] nss: Adjust tests to use nss_files only
To: libc-alpha@sourceware.org
2018-01-30 Florian Weimer <fweimer@redhat.com>
* nss/bug17079.c (do_test): Use nss_files only for reading passwd
data.
* nss/tst-nss-getpwent.c (do_test): Likewise.
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
+#include <nss.h>
#include <pwd.h>
#include <stdbool.h>
#include <stdio.h>
@@ -213,6 +214,8 @@ test_buffer_size (size_t buffer_size)
int
do_test (void)
{
+ __nss_configure_lookup ("passwd", "files");
+
if (!init_test_items ())
return 1;
printf ("info: %d test items\n", test_count);
@@ -15,6 +15,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <nss.h>
#include <pwd.h>
#include <stdbool.h>
#include <stdio.h>
@@ -26,6 +27,8 @@
int
do_test (void)
{
+ __nss_configure_lookup ("passwd", "files");
+
/* Count the number of entries in the password database, and fetch
data from the first and last entries. */
size_t count = 0;