libnsl: Turn remaining symbols into compat symbols [BZ #22701]
Commit Message
2018-01-11 Florian Weimer <fweimer@redhat.com>
[BZ #22701]
* include/rpcsvc/nislib.h (__nis_default_ttl): Add
libnsl_hidden_proto.
* include/rpcsvc/yp.h (yp_xdrall): Declare with
libnsl_hidden_proto.
* include/rpcsvc/ypclnt.h (yp_maplist): Likewise.
* nis/Makefile (libnsl-routines): Add nss-default only for
build-obsolete-nsl.
* nis/nis_defaults.c (__nis_default_ttl): Add
libnsl_hidden_nolink_def.
* nis/rpcsvc/ypclnt.h (yp_maplist): Remove #ifdef'ed-out
declaration.
* nis/yp_xdr.c (xdr_ypall): Add libnsl_hidden_nolink_def.
* nis/ypclnt.c (yp_maplist): Likewise.
Comments
On Jan 11 2018, fweimer@redhat.com (Florian Weimer) wrote:
> [BZ #22701]
> * include/rpcsvc/nislib.h (__nis_default_ttl): Add
> libnsl_hidden_proto.
> * include/rpcsvc/yp.h (yp_xdrall): Declare with
> libnsl_hidden_proto.
> * include/rpcsvc/ypclnt.h (yp_maplist): Likewise.
> * nis/Makefile (libnsl-routines): Add nss-default only for
> build-obsolete-nsl.
> * nis/nis_defaults.c (__nis_default_ttl): Add
> libnsl_hidden_nolink_def.
> * nis/rpcsvc/ypclnt.h (yp_maplist): Remove #ifdef'ed-out
> declaration.
> * nis/yp_xdr.c (xdr_ypall): Add libnsl_hidden_nolink_def.
> * nis/ypclnt.c (yp_maplist): Likewise.
Ok.
Andreas.
On 01/29/2018 02:30 PM, Andreas Schwab wrote:
> On Jan 11 2018, fweimer@redhat.com (Florian Weimer) wrote:
>
>> [BZ #22701]
>> * include/rpcsvc/nislib.h (__nis_default_ttl): Add
>> libnsl_hidden_proto.
>> * include/rpcsvc/yp.h (yp_xdrall): Declare with
>> libnsl_hidden_proto.
>> * include/rpcsvc/ypclnt.h (yp_maplist): Likewise.
>> * nis/Makefile (libnsl-routines): Add nss-default only for
>> build-obsolete-nsl.
>> * nis/nis_defaults.c (__nis_default_ttl): Add
>> libnsl_hidden_nolink_def.
>> * nis/rpcsvc/ypclnt.h (yp_maplist): Remove #ifdef'ed-out
>> declaration.
>> * nis/yp_xdr.c (xdr_ypall): Add libnsl_hidden_nolink_def.
>> * nis/ypclnt.c (yp_maplist): Likewise.
>
> Ok.
Dmitry, is it okay to sneak this into glibc 2.27? The change is mostly
cosmetic; the important change was not installing libnsl.so and
libnsl.a, and that is already on master.
Thanks,
Florian
On Mon, Jan 29, 2018 at 02:32:56PM +0100, Florian Weimer wrote:
> On 01/29/2018 02:30 PM, Andreas Schwab wrote:
> > On Jan 11 2018, fweimer@redhat.com (Florian Weimer) wrote:
> >
> >> [BZ #22701]
> >> * include/rpcsvc/nislib.h (__nis_default_ttl): Add
> >> libnsl_hidden_proto.
> >> * include/rpcsvc/yp.h (yp_xdrall): Declare with
> >> libnsl_hidden_proto.
> >> * include/rpcsvc/ypclnt.h (yp_maplist): Likewise.
> >> * nis/Makefile (libnsl-routines): Add nss-default only for
> >> build-obsolete-nsl.
> >> * nis/nis_defaults.c (__nis_default_ttl): Add
> >> libnsl_hidden_nolink_def.
> >> * nis/rpcsvc/ypclnt.h (yp_maplist): Remove #ifdef'ed-out
> >> declaration.
> >> * nis/yp_xdr.c (xdr_ypall): Add libnsl_hidden_nolink_def.
> >> * nis/ypclnt.c (yp_maplist): Likewise.
> >
> > Ok.
>
> Dmitry, is it okay to sneak this into glibc 2.27? The change is mostly
> cosmetic; the important change was not installing libnsl.so and
> libnsl.a, and that is already on master.
Yes, I think this is OK for 2.27, although I would prefer if it was
committed last week.
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.
Ideally we'd isolate such tests from the host environment so they don't
depend at all on what /etc/nsswitch.conf looks like and never use any NSS
modules from the host environment, only ones newly built with glibc. I
don't know if there's any quick and simple fix, however.
On Mon, Jan 29, 2018 at 5:01 PM, Joseph Myers <joseph@codesourcery.com> 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.
This is:
https://sourceware.org/bugzilla/show_bug.cgi?id=22530
Should I reopen it?
> Ideally we'd isolate such tests from the host environment so they don't
> depend at all on what /etc/nsswitch.conf looks like and never use any NSS
> modules from the host environment, only ones newly built with glibc. I
> don't know if there's any quick and simple fix, however.
>
"make check" really shouldn't use the host environment.
On Mon, 29 Jan 2018, H.J. Lu wrote:
> On Mon, Jan 29, 2018 at 5:01 PM, Joseph Myers <joseph@codesourcery.com> 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.
>
> This is:
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=22530
>
> Should I reopen it?
No, I think this is a different issue involving a different NSS module.
I suppose the present issue might be resolved by restoring the
_nsl_default_nss symbol, for example.
On 01/29/2018 06:12 PM, Joseph Myers wrote:
> On Mon, 29 Jan 2018, H.J. Lu wrote:
>
>> On Mon, Jan 29, 2018 at 5:01 PM, Joseph Myers <joseph@codesourcery.com> 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.
>>
>> This is:
>>
>> https://sourceware.org/bugzilla/show_bug.cgi?id=22530
>>
>> Should I reopen it?
>
> No, I think this is a different issue involving a different NSS module.
> I suppose the present issue might be resolved by restoring the
> _nsl_default_nss symbol, for example.
This is clearly a bug in the test framework. We should mark it XFAIL for
2.27 and fix this in 2.28.
DJ has complete patches to add "in mount namespace" testing which allows us
to completely isolate NSS module tests. The work is complete and pending
some review by me before we post these publicly. DJ has even run the entire
testsuite through the installed-tree-equivalent testing that is provided
by testing in the mount namespace, though it requires your system be configured
to allow user mount namespaces. DJ can comment more here if he wishes.
I want to avoid anyone doing any work here because in 2.28 I'd expect
we'll have converted these tests to use this work (part of the support/
library), and avoid the host configuration issues that have plagued our
testing.
On 29/01/18 13:32, Florian Weimer wrote:
> On 01/29/2018 02:30 PM, Andreas Schwab wrote:
>> On Jan 11 2018, fweimer@redhat.com (Florian Weimer) wrote:
>>
>>> [BZ #22701]
>>> * include/rpcsvc/nislib.h (__nis_default_ttl): Add
>>> libnsl_hidden_proto.
>>> * include/rpcsvc/yp.h (yp_xdrall): Declare with
>>> libnsl_hidden_proto.
>>> * include/rpcsvc/ypclnt.h (yp_maplist): Likewise.
>>> * nis/Makefile (libnsl-routines): Add nss-default only for
>>> build-obsolete-nsl.
>>> * nis/nis_defaults.c (__nis_default_ttl): Add
>>> libnsl_hidden_nolink_def.
>>> * nis/rpcsvc/ypclnt.h (yp_maplist): Remove #ifdef'ed-out
>>> declaration.
>>> * nis/yp_xdr.c (xdr_ypall): Add libnsl_hidden_nolink_def.
>>> * nis/ypclnt.c (yp_maplist): Likewise.
>>
>> Ok.
>
> Dmitry, is it okay to sneak this into glibc 2.27? The change is mostly cosmetic; the important change was not installing libnsl.so and
> libnsl.a, and that is already on master.
>
isn't this an internal abi break?
if i install glibc-2.27 on top of an earlier glibc install
without removing the previous libnss_nis.so.2, which references
_nsl_default_nss, then the new libnsl.so.1 will not have that
symbol so old libnss_nis.so.2 no longer works.
either i have to --enable-obsolete-nsl in the new libc or
remove the old libnss_nis.so.2 (and hope nothing needs it)
before i run the new ldconfig.
i thought 'installing over' previous libc is a valid use
(i do this when testing in chroot)
On 01/31/2018 12:21 PM, Szabolcs Nagy wrote:
> On 29/01/18 13:32, Florian Weimer wrote:
>> On 01/29/2018 02:30 PM, Andreas Schwab wrote:
>>> On Jan 11 2018, fweimer@redhat.com (Florian Weimer) wrote:
>>>
>>>> [BZ #22701]
>>>> * include/rpcsvc/nislib.h (__nis_default_ttl): Add
>>>> libnsl_hidden_proto.
>>>> * include/rpcsvc/yp.h (yp_xdrall): Declare with
>>>> libnsl_hidden_proto.
>>>> * include/rpcsvc/ypclnt.h (yp_maplist): Likewise.
>>>> * nis/Makefile (libnsl-routines): Add nss-default only for
>>>> build-obsolete-nsl.
>>>> * nis/nis_defaults.c (__nis_default_ttl): Add
>>>> libnsl_hidden_nolink_def.
>>>> * nis/rpcsvc/ypclnt.h (yp_maplist): Remove #ifdef'ed-out
>>>> declaration.
>>>> * nis/yp_xdr.c (xdr_ypall): Add libnsl_hidden_nolink_def.
>>>> * nis/ypclnt.c (yp_maplist): Likewise.
>>>
>>> Ok.
>>
>> Dmitry, is it okay to sneak this into glibc 2.27? The change is
>> mostly cosmetic; the important change was not installing libnsl.so and
>> libnsl.a, and that is already on master.
>>
>
> isn't this an internal abi break?
Not really, I think.
> if i install glibc-2.27 on top of an earlier glibc install
> without removing the previous libnss_nis.so.2, which references
> _nsl_default_nss, then the new libnsl.so.1 will not have that
> symbol so old libnss_nis.so.2 no longer works.
>
> either i have to --enable-obsolete-nsl in the new libc or
> remove the old libnss_nis.so.2 (and hope nothing needs it)
> before i run the new ldconfig.
>
> i thought 'installing over' previous libc is a valid use
> (i do this when testing in chroot)
A similar thing happens if you install a glibc over another glibc with
different build flags, e.g. one that is using AT_PLATFORM directories.
We can certainly revert the change and reapply it for 2.28, maybe this
time with a change which loads the NSS modules with RTLD_NOW, so that
the missing GLIBC_PRIVATE symbol is detected at dlopen time and the NSS
module is ignored (at least for now).
Thanks,
Florian
On 31/01/18 12:53, Florian Weimer wrote:
> On 01/31/2018 12:21 PM, Szabolcs Nagy wrote:
>> On 29/01/18 13:32, Florian Weimer wrote:
>>> On 01/29/2018 02:30 PM, Andreas Schwab wrote:
>>>> On Jan 11 2018, fweimer@redhat.com (Florian Weimer) wrote:
>>>>
>>>>> [BZ #22701]
>>>>> * include/rpcsvc/nislib.h (__nis_default_ttl): Add
>>>>> libnsl_hidden_proto.
>>>>> * include/rpcsvc/yp.h (yp_xdrall): Declare with
>>>>> libnsl_hidden_proto.
>>>>> * include/rpcsvc/ypclnt.h (yp_maplist): Likewise.
>>>>> * nis/Makefile (libnsl-routines): Add nss-default only for
>>>>> build-obsolete-nsl.
>>>>> * nis/nis_defaults.c (__nis_default_ttl): Add
>>>>> libnsl_hidden_nolink_def.
>>>>> * nis/rpcsvc/ypclnt.h (yp_maplist): Remove #ifdef'ed-out
>>>>> declaration.
>>>>> * nis/yp_xdr.c (xdr_ypall): Add libnsl_hidden_nolink_def.
>>>>> * nis/ypclnt.c (yp_maplist): Likewise.
>>>>
>>>> Ok.
>>>
>>> Dmitry, is it okay to sneak this into glibc 2.27? The change is mostly cosmetic; the important change was not installing libnsl.so and
>>> libnsl.a, and that is already on master.
>>>
>>
>> isn't this an internal abi break?
>
> Not really, I think.
>
>> if i install glibc-2.27 on top of an earlier glibc install
>> without removing the previous libnss_nis.so.2, which references
>> _nsl_default_nss, then the new libnsl.so.1 will not have that
>> symbol so old libnss_nis.so.2 no longer works.
>>
>> either i have to --enable-obsolete-nsl in the new libc or
>> remove the old libnss_nis.so.2 (and hope nothing needs it)
>> before i run the new ldconfig.
>>
>> i thought 'installing over' previous libc is a valid use
>> (i do this when testing in chroot)
>
> A similar thing happens if you install a glibc over another glibc with different build flags, e.g. one that is using AT_PLATFORM directories.
>
> We can certainly revert the change and reapply it for 2.28, maybe this time with a change which loads the NSS modules with RTLD_NOW, so that the
> missing GLIBC_PRIVATE symbol is detected at dlopen time and the NSS module is ignored (at least for now).
>
i think RTLD_NOW wont help me, i run ldconfig in the
chroot with mixed old and new glibc libs and ldconfig
fails to process libnss_nis.so.2
chroot /tmp/tmp6YjWM3/chroot sudo /sbin/ldconfig
sudo: relocation error: /lib/aarch64-linux-gnu/libnss_nis.so.2: symbol _nsl_default_nss version GLIBC_PRIVATE not defined in file libnsl.so.1
with link time reference
i guess i will work this around in the chroot build script.
(i assume it's enough to remove the obsolete nss libs
and potentially update the /etc/nsswitch.conf if things
dont work with the old one)
On 31/01/18 15:07, Szabolcs Nagy wrote:
> On 31/01/18 12:53, Florian Weimer wrote:
>> On 01/31/2018 12:21 PM, Szabolcs Nagy wrote:
>>> if i install glibc-2.27 on top of an earlier glibc install
>>> without removing the previous libnss_nis.so.2, which references
>>> _nsl_default_nss, then the new libnsl.so.1 will not have that
>>> symbol so old libnss_nis.so.2 no longer works.
>>>
>>> either i have to --enable-obsolete-nsl in the new libc or
>>> remove the old libnss_nis.so.2 (and hope nothing needs it)
>>> before i run the new ldconfig.
>>>
>>> i thought 'installing over' previous libc is a valid use
>>> (i do this when testing in chroot)
>>
>> A similar thing happens if you install a glibc over another glibc with different build flags, e.g. one that is using AT_PLATFORM directories.
>>
>> We can certainly revert the change and reapply it for 2.28, maybe this time with a change which loads the NSS modules with RTLD_NOW, so that
>> the missing GLIBC_PRIVATE symbol is detected at dlopen time and the NSS module is ignored (at least for now).
>>
>
> i think RTLD_NOW wont help me, i run ldconfig in the
> chroot with mixed old and new glibc libs and ldconfig
> fails to process libnss_nis.so.2
>
> chroot /tmp/tmp6YjWM3/chroot sudo /sbin/ldconfig
> sudo: relocation error: /lib/aarch64-linux-gnu/libnss_nis.so.2: symbol _nsl_default_nss version GLIBC_PRIVATE not defined in file libnsl.so.1
> with link time reference
>
sorry you were right, it's sudo that fails, so RTLD_NOW
would make the dlopen fail and then there would be no
runtime failure.
(i thought it's ldconfig that tries to load the library somehow)
anyway i'll have a workaround for this so either way is
fine for me (revert or keep).
> i guess i will work this around in the chroot build script.
> (i assume it's enough to remove the obsolete nss libs
> and potentially update the /etc/nsswitch.conf if things
> dont work with the old one)
On 31/01/18 15:34, Szabolcs Nagy wrote:
> On 31/01/18 15:07, Szabolcs Nagy wrote:
>> On 31/01/18 12:53, Florian Weimer wrote:
>>> A similar thing happens if you install a glibc over another glibc with different build flags, e.g. one that is using AT_PLATFORM directories.
>>>
>>> We can certainly revert the change and reapply it for 2.28, maybe this time with a change which loads the NSS modules with RTLD_NOW, so that
>>> the missing GLIBC_PRIVATE symbol is detected at dlopen time and the NSS module is ignored (at least for now).
>>
>> chroot /tmp/tmp6YjWM3/chroot sudo /sbin/ldconfig
>> sudo: relocation error: /lib/aarch64-linux-gnu/libnss_nis.so.2: symbol _nsl_default_nss version GLIBC_PRIVATE not defined in file libnsl.so.1
>> with link time reference
>
> sorry you were right, it's sudo that fails, so RTLD_NOW
> would make the dlopen fail and then there would be no
> runtime failure.
>
i opened
https://sourceware.org/bugzilla/show_bug.cgi?id=22766
@@ -42,6 +42,7 @@ libnsl_hidden_proto (nis_remove)
libnsl_hidden_proto (nis_add)
libnsl_hidden_proto (__nis_default_owner)
libnsl_hidden_proto (__nis_default_group)
+libnsl_hidden_proto (__nis_default_ttl)
libnsl_hidden_proto (__nis_default_access)
libnsl_hidden_proto (nis_clone_object)
libnsl_hidden_proto (nis_clone_result)
@@ -3,6 +3,9 @@
# ifndef _ISOMAC
+struct ypall_callback;
+bool_t xdr_ypall (XDR *, struct ypall_callback *);
+
libnsl_hidden_proto (xdr_ypstat)
libnsl_hidden_proto (xdr_ypxfrstat)
libnsl_hidden_proto (xdr_domainname)
@@ -28,6 +31,7 @@ libnsl_hidden_proto (xdr_ypreq_xfr)
libnsl_hidden_proto (xdr_ypresp_xfr)
libnsl_hidden_proto (xdr_yppushresp_xfr)
libnsl_hidden_proto (xdr_ypbind_setdom)
+libnsl_hidden_proto (xdr_ypall)
# endif /* !_ISOMAC */
#endif
@@ -3,6 +3,9 @@
# ifndef _ISOMAC
+struct ypmaplist;
+int yp_maplist (const char *, struct ypmaplist **) __THROW;
+
libnsl_hidden_proto (ypbinderr_string)
libnsl_hidden_proto (yp_bind)
libnsl_hidden_proto (yp_get_default_domain)
@@ -17,6 +20,7 @@ libnsl_hidden_proto (yp_next)
libnsl_hidden_proto (yp_match)
libnsl_hidden_proto (yp_all)
libnsl_hidden_proto (__yp_check)
+libnsl_hidden_proto (yp_maplist)
# endif /* !_ISOMAC */
#endif
@@ -58,9 +58,10 @@ libnsl-routines = yp_xdr ypclnt ypupdate_xdr \
nis_print_group_entry nis_domain_of nis_domain_of_r\
nis_modify nis_remove nis_add nis_defaults\
nis_findserv nis_callback nis_clone_dir nis_clone_obj\
- nis_clone_res nss-default
+ nis_clone_res
ifeq ($(build-obsolete-nsl),yes)
+libnsl-routines += nss-default
libnss_nis-routines := $(addprefix nis-,$(databases)) nis-initgroups \
nss-nis
libnss_nis-inhibit-o = $(filter-out .os,$(object-suffixes))
@@ -428,6 +428,7 @@ __nis_default_ttl (char *defaults)
return searchttl (cptr);
}
+libnsl_hidden_nolink_def (__nis_default_ttl, GLIBC_2_1)
/* Default access rights are ----rmcdr---r---, but we could change
this with the NIS_DEFAULTS variable. */
@@ -76,9 +76,6 @@ extern const char *ypbinderr_string (const int) __THROW;
extern int ypprot_err (const int) __THROW;
extern int yp_update (char *, char *, unsigned int, char *,
int, char *, int) __THROW;
-#if 0
-extern int yp_maplist (const char *, struct ypmaplist **) __THROW;
-#endif
/* This functions exists only under BSD and Linux systems. */
extern int __yp_check (char **) __THROW;
@@ -327,4 +327,4 @@ xdr_ypall(XDR *xdrs, struct ypall_callback *incallback)
return FALSE;
}
}
-/* XXX libnsl_hidden_nolink_def(xdr_ypall, GLIBC_2_2) */
+libnsl_hidden_nolink_def (xdr_ypall, GLIBC_2_2)
@@ -813,6 +813,7 @@ yp_maplist (const char *indomain, struct ypmaplist **outmaplist)
return result;
}
+libnsl_hidden_nolink_def (yp_maplist, GLIBC_2_0)
const char *
yperr_string (const int error)