[PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Florian Weimer-5
2018-01-11  Florian Weimer  <[hidden email]>

        [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.

diff --git a/include/rpcsvc/nislib.h b/include/rpcsvc/nislib.h
index 91dab1d171..ad4d499911 100644
--- a/include/rpcsvc/nislib.h
+++ b/include/rpcsvc/nislib.h
@@ -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)
diff --git a/include/rpcsvc/yp.h b/include/rpcsvc/yp.h
index 9078854d40..87cd3827a7 100644
--- a/include/rpcsvc/yp.h
+++ b/include/rpcsvc/yp.h
@@ -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
diff --git a/include/rpcsvc/ypclnt.h b/include/rpcsvc/ypclnt.h
index df2a03d9c5..c6a724814c 100644
--- a/include/rpcsvc/ypclnt.h
+++ b/include/rpcsvc/ypclnt.h
@@ -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
diff --git a/nis/Makefile b/nis/Makefile
index fae30d5da1..b828c5ec4d 100644
--- a/nis/Makefile
+++ b/nis/Makefile
@@ -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))
diff --git a/nis/nis_defaults.c b/nis/nis_defaults.c
index 58e64a8e98..0be47aa65c 100644
--- a/nis/nis_defaults.c
+++ b/nis/nis_defaults.c
@@ -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. */
diff --git a/nis/rpcsvc/ypclnt.h b/nis/rpcsvc/ypclnt.h
index b96cb3b40e..af904fccb2 100644
--- a/nis/rpcsvc/ypclnt.h
+++ b/nis/rpcsvc/ypclnt.h
@@ -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;
diff --git a/nis/yp_xdr.c b/nis/yp_xdr.c
index 0081b4c926..3b576731da 100644
--- a/nis/yp_xdr.c
+++ b/nis/yp_xdr.c
@@ -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)
diff --git a/nis/ypclnt.c b/nis/ypclnt.c
index 95215e2f67..11a17db98d 100644
--- a/nis/ypclnt.c
+++ b/nis/ypclnt.c
@@ -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)
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Andreas Schwab
On Jan 11 2018, [hidden email] (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.

--
Andreas Schwab, SUSE Labs, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Florian Weimer-5
On 01/29/2018 02:30 PM, Andreas Schwab wrote:

> On Jan 11 2018, [hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Dmitry V. Levin
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, [hidden email] (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.


--
ldv

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Joseph Myers
In reply to this post by Florian Weimer-5
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.

--
Joseph S. Myers
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

H.J. Lu-30
On Mon, Jan 29, 2018 at 5:01 PM, Joseph Myers <[hidden email]> 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.

--
H.J.
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Joseph Myers
On Mon, 29 Jan 2018, H.J. Lu wrote:

> On Mon, Jan 29, 2018 at 5:01 PM, Joseph Myers <[hidden email]> 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.

--
Joseph S. Myers
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Carlos O'Donell-6
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 <[hidden email]> 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.

--
Cheers,
Carlos.
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Florian Weimer-5
In reply to this post by Joseph Myers
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

nss.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Joseph Myers
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.

--
Joseph S. Myers
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Dmitry V. Levin
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.


--
ldv

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Florian Weimer-5
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
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Szabolcs Nagy-2
In reply to this post by Florian Weimer-5
On 29/01/18 13:32, Florian Weimer wrote:

> On 01/29/2018 02:30 PM, Andreas Schwab wrote:
>> On Jan 11 2018, [hidden email] (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)
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Florian Weimer-5
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, [hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Szabolcs Nagy-2
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, [hidden email] (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)
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Szabolcs Nagy-2
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)

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] libnsl: Turn remaining symbols into compat symbols [BZ #22701]

Szabolcs Nagy-2
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