From patchwork Fri Jun 5 16:53:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 39486 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 02FD538930DF; Fri, 5 Jun 2020 16:54:15 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 44D21383E828 for ; Fri, 5 Jun 2020 16:54:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 44D21383E828 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=pvorel@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 523B3ACE3; Fri, 5 Jun 2020 16:54:11 +0000 (UTC) From: Petr Vorel To: libc-alpha@sourceware.org Subject: [RFC PATCH v2 1/2] configure: Remove --enable-obsolete-nsl Date: Fri, 5 Jun 2020 18:53:54 +0200 Message-Id: <20200605165355.27797-2-pvorel@suse.cz> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200605165355.27797-1-pvorel@suse.cz> References: <20200605165355.27797-1-pvorel@suse.cz> MIME-Version: 1.0 X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Weimer , Andreas Jaeger , Thorsten Kukuk , Steve Dickson , debian-glibc@lists.debian.org, Joseph Myers Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" this means that *always* libnsl is only built as shared library for backward compatibility and the NSS modules libnss_compat, libnss_nis and libnss_nisplus are not built at all, libnsl's headers aren't installed. This compatibility is kept only for architectures and ABIs that have been added in or before version 2.28. Replacement implementations based on TIRPC, which additionally support IPv6, are available from . Signed-off-by: Petr Vorel --- INSTALL | 9 ------- NEWS | 8 ++++++ config.h.in | 4 --- config.make.in | 1 - configure | 20 +------------- configure.ac | 11 -------- grp/initgroups.c | 8 +----- include/libc-symbols.h | 9 +------ manual/install.texi | 10 ------- manual/nss.texi | 14 +++------- nis/Makefile | 52 +----------------------------------- nscd/initgrcache.c | 8 +----- nss/grp-lookup.c | 6 +---- nss/nsswitch.c | 14 +++------- nss/pwd-lookup.c | 6 +---- nss/spwd-lookup.c | 6 +---- scripts/build-many-glibcs.py | 6 ++--- 17 files changed, 25 insertions(+), 167 deletions(-) diff --git a/INSTALL b/INSTALL index 62e78725f5..3f5575e23e 100644 --- a/INSTALL +++ b/INSTALL @@ -227,15 +227,6 @@ if 'CFLAGS' is specified it must enable optimization. For example: colon-separated list in a single environment variable 'GLIBC_TUNABLES'. -'--enable-obsolete-nsl' - By default, libnsl is only built as shared library for backward - compatibility and the NSS modules libnss_compat, libnss_nis and - libnss_nisplus are not built at all. Use this option to enable - libnsl with all depending NSS modules and header files. For - architectures and ABIs that have been added after version 2.28 of - the GNU C Library this option is not available, and the libnsl - compatibility library is not built. - '--disable-crypt' Do not install the passphrase-hashing library 'libcrypt' or the header file 'crypt.h'. 'unistd.h' will still declare the function diff --git a/NEWS b/NEWS index a660fc59a8..cfaf50c816 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,14 @@ Major new features: Deprecated and removed features, and other changes affecting compatibility: +* Remove configure option --enable-obsolete-nsl. libnsl is only built as shared + library for backward compatibility and the NSS modules libnss_compat, + libnss_nis and libnss_nisplus are not built at all, libnsl's headers aren't + installed. This compatibility is kept only for architectures and ABIs that + have been added in or before version 2.28. Replacement implementations based + on TI-RPC, which additionally support IPv6, are available from + . + * The deprecated header and the sysctl function have been removed. To support old binaries, the sysctl function continues to exist as a compatibility symbol (on those architectures which had it), diff --git a/config.h.in b/config.h.in index 831eca2fe1..9eb71a81b7 100644 --- a/config.h.in +++ b/config.h.in @@ -161,10 +161,6 @@ to link against. */ #undef LINK_OBSOLETE_RPC -/* Define if obsolete libnsl code should be made available for user-level - code to link against. */ -#undef LINK_OBSOLETE_NSL - /* Define if Systemtap probes should be defined. */ #undef USE_STAP_PROBE diff --git a/config.make.in b/config.make.in index 2fed3da773..cefb6d4a90 100644 --- a/config.make.in +++ b/config.make.in @@ -97,7 +97,6 @@ build-static-nss = @static_nss@ cross-compiling = @cross_compiling@ force-install = @force_install@ link-obsolete-rpc = @link_obsolete_rpc@ -build-obsolete-nsl = @build_obsolete_nsl@ build-crypt = @build_crypt@ build-nscd = @build_nscd@ use-nscd = @use_nscd@ diff --git a/configure b/configure index b8ef8c7a51..793c0068cc 100755 --- a/configure +++ b/configure @@ -673,7 +673,6 @@ base_machine have_tunables build_pt_chown build_nscd -build_obsolete_nsl link_obsolete_rpc libc_cv_static_nss_crypt libc_cv_nss_crypt @@ -786,7 +785,6 @@ enable_experimental_malloc enable_crypt enable_nss_crypt enable_obsolete_rpc -enable_obsolete_nsl enable_systemtap enable_build_nscd enable_nscd @@ -1459,8 +1457,6 @@ Optional Features: --enable-nss-crypt enable libcrypt to use nss --enable-obsolete-rpc build and install the obsolete RPC code for link-time usage - --enable-obsolete-nsl build and install the obsolete libnsl library and - depending NSS modules --enable-systemtap enable systemtap static probe points [default=no] --disable-build-nscd disable building and installing the nscd daemon --disable-nscd library functions will not contact the nscd daemon @@ -3654,20 +3650,6 @@ if test "$link_obsolete_rpc" = yes; then fi -# Check whether --enable-obsolete-nsl was given. -if test "${enable_obsolete_nsl+set}" = set; then : - enableval=$enable_obsolete_nsl; build_obsolete_nsl=$enableval -else - build_obsolete_nsl=no -fi - - - -if test "$build_obsolete_nsl" = yes; then - $as_echo "#define LINK_OBSOLETE_NSL 1" >>confdefs.h - -fi - # Check whether --enable-systemtap was given. if test "${enable_systemtap+set}" = set; then : enableval=$enable_systemtap; systemtap=$enableval @@ -3785,7 +3767,7 @@ main () { #ifndef __CET__ -#error no CET compiler support +# error no CET compiler support #endif ; return 0; diff --git a/configure.ac b/configure.ac index ff00591fd4..33a1189804 100644 --- a/configure.ac +++ b/configure.ac @@ -387,17 +387,6 @@ if test "$link_obsolete_rpc" = yes; then AC_DEFINE(LINK_OBSOLETE_RPC) fi -AC_ARG_ENABLE([obsolete-nsl], - AC_HELP_STRING([--enable-obsolete-nsl], - [build and install the obsolete libnsl library and depending NSS modules]), - [build_obsolete_nsl=$enableval], - [build_obsolete_nsl=no]) -AC_SUBST(build_obsolete_nsl) - -if test "$build_obsolete_nsl" = yes; then - AC_DEFINE(LINK_OBSOLETE_NSL) -fi - AC_ARG_ENABLE([systemtap], [AS_HELP_STRING([--enable-systemtap], [enable systemtap static probe points @<:@default=no@:>@])], diff --git a/grp/initgroups.c b/grp/initgroups.c index f4c4e986e9..0c17141117 100644 --- a/grp/initgroups.c +++ b/grp/initgroups.c @@ -31,12 +31,6 @@ #include "../nscd/nscd-client.h" #include "../nscd/nscd_proto.h" -#ifdef LINK_OBSOLETE_NSL -# define DEFAULT_CONFIG "compat [NOTFOUND=return] files" -#else -# define DEFAULT_CONFIG "files" -#endif - /* Type of the lookup function. */ typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t, long int *, long int *, @@ -83,7 +77,7 @@ internal_getgrouplist (const char *user, gid_t group, long int *size, &__nss_initgroups_database) < 0) { if (__nss_group_database == NULL) - no_more = __nss_database_lookup2 ("group", NULL, DEFAULT_CONFIG, + no_more = __nss_database_lookup2 ("group", NULL, "files", &__nss_group_database); __nss_initgroups_database = __nss_group_database; diff --git a/include/libc-symbols.h b/include/libc-symbols.h index b2f36bc44b..9b8a6f11ec 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -833,13 +833,7 @@ for linking") # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) # define libnsl_hidden_tls_proto(name, attrs...) \ hidden_tls_proto (name, ##attrs) -# ifdef LINK_OBSOLETE_NSL - /* libnsl_hidden_nolink should only get used in libnsl code. */ -# define libnsl_hidden_nolink_def(name, version) libnsl_hidden_def (name) -# else -# define libnsl_hidden_nolink_def(name, version) hidden_nolink (name, libnsl, version) -# endif -# define libnsl_hidden_def(name) hidden_def (name) +# define libnsl_hidden_nolink_def(name, version) hidden_nolink (name, libnsl, version) # define libnsl_hidden_weak(name) hidden_weak (name) # define libnsl_hidden_ver(local, name) hidden_ver (local, name) # define libnsl_hidden_data_def(name) hidden_data_def (name) @@ -849,7 +843,6 @@ for linking") #else # define libnsl_hidden_proto(name, attrs...) # define libnsl_hidden_tls_proto(name, attrs...) -# define libnsl_hidden_def(name) # define libnsl_hidden_weak(name) # define libnsl_hidden_ver(local, name) # define libnsl_hidden_data_def(name) diff --git a/manual/install.texi b/manual/install.texi index c1e49a94fe..ea0059a4ec 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -257,16 +257,6 @@ This frontend allows users to specify tunables as a colon-separated list in a single environment variable @env{GLIBC_TUNABLES}. @end table -@item --enable-obsolete-nsl -By default, libnsl is only built as shared library for backward -compatibility and the NSS modules libnss_compat, libnss_nis and -libnss_nisplus are not built at all. -Use this option to enable libnsl with all depending NSS modules and -header files. -For architectures and ABIs that have been added after version 2.28 of -@theglibc{} this option is not available, and the libnsl compatibility -library is not built. - @item --disable-crypt Do not install the passphrase-hashing library @file{libcrypt} or the header file @file{crypt.h}. @file{unistd.h} will still declare the diff --git a/manual/nss.texi b/manual/nss.texi index 821469a78a..7cb307246a 100644 --- a/manual/nss.texi +++ b/manual/nss.texi @@ -328,17 +328,11 @@ For the @code{hosts} and @code{networks} databases the default value is the DNS service not to be available but if it is available the answer it returns is definitive. -The @code{passwd}, @code{group}, and @code{shadow} databases are +The @code{passwd}, @code{group}, and @code{shadow} databases was traditionally handled in a special way. The appropriate files in the -@file{/etc} directory are read but if an entry with a name starting -with a @code{+} character is found NIS is used. This kind of lookup -remains possible if @theglibc{} was configured with the -@code{--enable-obsolete-nsl} option and the special lookup service -@code{compat} is used. If @theglibc{} was configured with the -@code{--enable-obsolete-nsl} option the default value for the three -databases above is @code{compat [NOTFOUND=return] files}. If the -@code{--enable-obsolete-nsl} option was not used the default value -for the services is @code{files}. +@file{/etc} directory were read but if an entry with a name starting +with a @code{+} character was found NIS was used. This kind of lookup +was removed and now the default value for the services is @code{files}. For all other databases the default value is @code{files} unless @theglibc{} was configured with @code{--enable-obsolete-rpc} option, in diff --git a/nis/Makefile b/nis/Makefile index 6ce2199459..8c6028a3ca 100644 --- a/nis/Makefile +++ b/nis/Makefile @@ -22,40 +22,13 @@ subdir := nis include ../Makeconfig -ifndef have-GLIBC_2.28 - -ifeq ($(build-obsolete-nsl),yes) -$(error --enabe-obsolete-nsl is not available) -endif - -else - -ifeq ($(build-obsolete-nsl),yes) -headers := $(wildcard rpcsvc/*.[hx]) - -# These are the databases available for the nis (and perhaps later nisplus) -# service. This must be a superset of the services in nss. -databases = proto service hosts network grp pwd rpc ethers \ - spwd netgrp alias publickey - -# Specify rules for the nss_* modules. -services := nis nisplus -endif +ifdef have-GLIBC_2.28 extra-libs = libnsl -ifeq ($(build-obsolete-nsl),yes) -extra-libs += $(services:%=libnss_%) -endif # These libraries will be built in the `others' pass rather than # the `lib' pass, because they depend on libc.so being built already. extra-libs-others = $(extra-libs) -ifeq ($(build-obsolete-nsl),yes) -# The sources are found in the appropriate subdir. -subdir-dirs = $(services:%=nss_%) -vpath %.c $(subdir-dirs) -endif - libnsl-routines = yp_xdr ypclnt ypupdate_xdr \ nis_subr nis_local_names nis_free nis_file \ nis_print nis_error nis_call nis_lookup\ @@ -68,17 +41,6 @@ libnsl-routines = yp_xdr ypclnt ypupdate_xdr \ nis_findserv nis_callback nis_clone_dir nis_clone_obj\ 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)) - -libnss_nisplus-routines := $(addprefix nisplus-,$(databases)) nisplus-parser \ - nss-nisplus nisplus-initgroups -libnss_nisplus-inhibit-o = $(filter-out .os,$(object-suffixes)) - -else # not $(build-obsolete-nsl) # Pretend that libnsl.so is a linker script, so that the symbolic link # is not installed. install-lib-ldscripts = libnsl.so @@ -86,19 +48,11 @@ $(inst_libdir)/libnsl.so: # Build only shared libnsl. libnsl-inhibit-o = $(filter-out .os,$(object-suffixes)) -endif # not $(build-obsolete-nsl) - endif # have-GLIBC_2.28 include ../Rules -ifeq ($(build-obsolete-nsl),yes) -$(objpfx)libnss_nis.so: $(objpfx)libnsl.so$(libnsl.so-version) \ - $(common-objpfx)nss/libnss_files.so -$(objpfx)libnss_nisplus.so: $(objpfx)libnsl.so$(libnsl.so-version) -endif - libnsl-libc = $(common-objpfx)linkobj/libc.so # Target-specific variable setting to link objects using deprecated # RPC interfaces with the version of libc.so that makes them available @@ -109,8 +63,4 @@ $(services:%=$(objpfx)libnss_%.so) $(objpfx)libnsl.so: \ ifeq ($(build-shared),yes) $(others:%=$(objpfx)%): $(objpfx)libnsl.so$(libnsl.so-version) -else -ifeq ($(build-obsolete-nsl),yes) -$(others:%=$(objpfx)%): $(objpfx)libnsl.a -endif endif diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c index a9f230bfb0..a1102e4e46 100644 --- a/nscd/initgrcache.c +++ b/nscd/initgrcache.c @@ -32,12 +32,6 @@ #include "../nss/nsswitch.h" -#ifdef LINK_OBSOLETE_NSL -# define DEFAULT_CONFIG "compat [NOTFOUND=return] files" -#else -# define DEFAULT_CONFIG "files" -#endif - /* Type of the lookup function. */ typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t, long int *, long int *, @@ -88,7 +82,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, int no_more; if (group_database == NULL) - no_more = __nss_database_lookup2 ("group", NULL, DEFAULT_CONFIG, + no_more = __nss_database_lookup2 ("group", NULL, "files", &group_database); else no_more = 0; diff --git a/nss/grp-lookup.c b/nss/grp-lookup.c index d147201b0a..f65da2089b 100644 --- a/nss/grp-lookup.c +++ b/nss/grp-lookup.c @@ -19,10 +19,6 @@ #include #define DATABASE_NAME group -#ifdef LINK_OBSOLETE_NSL -# define DEFAULT_CONFIG "compat [NOTFOUND=return] files" -#else -# define DEFAULT_CONFIG "files" -#endif +#define DEFAULT_CONFIG "files" #include "XXX-lookup.c" diff --git a/nss/nsswitch.c b/nss/nsswitch.c index 319e22c3fc..8d7b69d4bc 100644 --- a/nss/nsswitch.c +++ b/nss/nsswitch.c @@ -42,14 +42,6 @@ #include #include -#ifdef LINK_OBSOLETE_NSL -# define DEFAULT_CONFIG "compat [NOTFOUND=return] files" -# define DEFAULT_DEFCONFIG "nis [NOTFOUND=return] files" -#else -# define DEFAULT_CONFIG "files" -# define DEFAULT_DEFCONFIG "files" -#endif - /* Prototypes for the local functions. */ static name_database *nss_parse_file (const char *fname); static name_database_entry *nss_getline (char *line); @@ -161,7 +153,7 @@ __nss_database_lookup2 (const char *database, const char *alternate_name, or null to use the most common default. */ if (*ni == NULL) { - *ni = nss_parse_service_list (defconfig ?: DEFAULT_DEFCONFIG); + *ni = nss_parse_service_list (defconfig ?: "files"); if (*ni != NULL) { /* Record the memory we've just allocated in defconfig_entries list, @@ -845,8 +837,8 @@ __nss_disable_nscd (void (*cb) (size_t, struct traced_file *)) is_nscd = true; /* Find all the relevant modules so that the init functions are called. */ - nss_load_all_libraries ("passwd", DEFAULT_CONFIG); - nss_load_all_libraries ("group", DEFAULT_CONFIG); + nss_load_all_libraries ("passwd", "files"); + nss_load_all_libraries ("group", "files"); nss_load_all_libraries ("hosts", "dns [!UNAVAIL=return] files"); nss_load_all_libraries ("services", NULL); diff --git a/nss/pwd-lookup.c b/nss/pwd-lookup.c index 401306785d..e15e150019 100644 --- a/nss/pwd-lookup.c +++ b/nss/pwd-lookup.c @@ -19,10 +19,6 @@ #include #define DATABASE_NAME passwd -#ifdef LINK_OBSOLETE_NSL -# define DEFAULT_CONFIG "compat [NOTFOUND=return] files" -#else -# define DEFAULT_CONFIG "files" -#endif +#define DEFAULT_CONFIG "files" #include "XXX-lookup.c" diff --git a/nss/spwd-lookup.c b/nss/spwd-lookup.c index c7ca74fa44..21ea0afe75 100644 --- a/nss/spwd-lookup.c +++ b/nss/spwd-lookup.c @@ -20,10 +20,6 @@ #define DATABASE_NAME shadow #define ALTERNATE_NAME passwd -#ifdef LINK_OBSOLETE_NSL -# define DEFAULT_CONFIG "compat [NOTFOUND=return] files" -#else -# define DEFAULT_CONFIG "files" -#endif +#define DEFAULT_CONFIG "files" #include "XXX-lookup.c" diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index 6c6615b200..95c7fba3b8 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -396,8 +396,7 @@ class Context(object): extra_glibcs=[{'variant': 'disable-multi-arch', 'cfg': ['--disable-multi-arch']}, {'variant': 'enable-obsolete', - 'cfg': ['--enable-obsolete-rpc', - '--enable-obsolete-nsl']}, + 'cfg': ['--enable-obsolete-rpc']}, {'variant': 'static-pie', 'cfg': ['--enable-static-pie']}, {'variant': 'x32-static-pie', @@ -414,8 +413,7 @@ class Context(object): {'variant': 'enable-obsolete', 'arch': 'i686', 'ccopts': '-m32 -march=i686', - 'cfg': ['--enable-obsolete-rpc', - '--enable-obsolete-nsl']}, + 'cfg': ['--enable-obsolete-rpc']}, {'arch': 'i486', 'ccopts': '-m32 -march=i486'}, {'arch': 'i586',