This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

diff --git a/nss/bug17079.c b/nss/bug17079.c
index f3e88b349d..5f358f815a 100644
--- a/nss/bug17079.c
+++ b/nss/bug17079.c
@@ -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);
diff --git a/nss/tst-nss-getpwent.c b/nss/tst-nss-getpwent.c
index cdaef767fe..ff9c3d062e 100644
--- a/nss/tst-nss-getpwent.c
+++ b/nss/tst-nss-getpwent.c
@@ -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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]