public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/16] Consolidate NSS functionality into nss subdir
@ 2023-10-02 12:55 Arjun Shankar
  2023-10-02 12:55 ` [PATCH 01/16] inet: Rearrange and sort Makefile variables Arjun Shankar
                   ` (15 more replies)
  0 siblings, 16 replies; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

Hi all!

This patch series follows...
https://sourceware.org/pipermail/libc-alpha/2023-June/149446.html
...which I posted in June in order to see if I can gather consensus around
moving NSS entry points scattered across the glibc source tree into the
nss/ subdirectory.  At the time, DJ reviewed it and nobody else appeared to
oppose the change, but I held off on pushing it due to the upcoming release
at the time.

This series of patches aims to move the majority of NSS entry points into
nss/.  The first two patches are simply Makefile changes to allow for easy
to read differences in the actual moves that follow.

I'm working through finding and moving other entry points, but I thought I'd
already post this patch series with work that's been done so far.

Once this is done, I'll work on and post a patch to provide a new statically
linked library to allow static NSS.  Details on that here:

Avoiding dlopen in statically linked applications that use nss [#27959]:
https://sourceware.org/pipermail/libc-alpha/2023-May/148682.html

Cheers,
Arjun



^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 01/16] inet: Rearrange and sort Makefile variables
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-02 14:11   ` Siddhesh Poyarekar
  2023-10-02 12:55 ` [PATCH 02/16] nss: " Arjun Shankar
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

Rearrange lists of routines, tests, etc. into one-per-line in
inet/Makefile and sort them using scripts/sort-makefile-lines.py.
---
 inet/Makefile | 142 +++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 112 insertions(+), 30 deletions(-)

diff --git a/inet/Makefile b/inet/Makefile
index f5249ab2b1..9db7f941c6 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -22,41 +22,123 @@ subdir	:= inet
 
 include ../Makeconfig
 
-headers	:= netinet/ether.h netinet/in.h netinet/in_systm.h \
-	   netinet/if_ether.h netinet/igmp.h \
-	   netinet/tcp.h netinet/ip.h $(wildcard arpa/*.h protocols/*.h) \
-	   aliases.h ifaddrs.h netinet/ip6.h netinet/icmp6.h bits/in.h \
-	   rpc/netdb.h
-
-routines := htonl htons		\
-	    inet_lnaof inet_mkadr	\
-	    inet_netof inet_ntoa inet_net herrno herrno-loc \
-	    gethstbyad gethstbyad_r gethstbynm gethstbynm2 gethstbynm2_r \
-	    gethstbynm_r gethstent gethstent_r \
-	    getnetbyad getnetbyad_r getnetbynm getnetent getnetent_r \
-	    getnetbynm_r \
-	    getproto getproto_r getprtent getprtent_r getprtname getprtname_r \
-	    getsrvbynm getsrvbynm_r getsrvbypt getsrvbypt_r getservent \
-	    getservent_r getrpcent getrpcbyname getrpcbynumber \
-	    getrpcent_r getrpcbyname_r getrpcbynumber_r \
-	    ether_aton ether_aton_r ether_hton ether_line \
-	    ether_ntoa ether_ntoa_r ether_ntoh \
-	    rcmd rexec ruserpass bindresvport \
-	    getnetgrent_r getnetgrent \
-	    getaliasent_r getaliasent getaliasname getaliasname_r \
-	    in6_addr getnameinfo if_index ifaddrs inet6_option \
-	    getipv4sourcefilter setipv4sourcefilter \
-	    getsourcefilter setsourcefilter inet6_opt inet6_rth \
-	    inet6_scopeid_pton deadline idna idna_name_classify
+headers := \
+  $(wildcard arpa/*.h protocols/*.h) \
+  aliases.h \
+  bits/in.h \
+  ifaddrs.h \
+  netinet/ether.h \
+  netinet/icmp6.h \
+  netinet/if_ether.h \
+  netinet/igmp.h \
+  netinet/in.h \
+  netinet/in_systm.h \
+  netinet/ip.h \
+  netinet/ip6.h \
+  netinet/tcp.h \
+  rpc/netdb.h \
+  # headers
+
+routines := \
+  bindresvport \
+  deadline \
+  ether_aton \
+  ether_aton_r \
+  ether_hton \
+  ether_line \
+  ether_ntoa \
+  ether_ntoa_r \
+  ether_ntoh \
+  getaliasent \
+  getaliasent_r \
+  getaliasname \
+  getaliasname_r \
+  gethstbyad \
+  gethstbyad_r \
+  gethstbynm \
+  gethstbynm2 \
+  gethstbynm2_r \
+  gethstbynm_r \
+  gethstent \
+  gethstent_r \
+  getipv4sourcefilter \
+  getnameinfo \
+  getnetbyad \
+  getnetbyad_r \
+  getnetbynm \
+  getnetbynm_r \
+  getnetent \
+  getnetent_r \
+  getnetgrent \
+  getnetgrent_r \
+  getproto \
+  getproto_r \
+  getprtent \
+  getprtent_r \
+  getprtname \
+  getprtname_r \
+  getrpcbyname \
+  getrpcbyname_r \
+  getrpcbynumber \
+  getrpcbynumber_r \
+  getrpcent \
+  getrpcent_r \
+  getservent \
+  getservent_r \
+  getsourcefilter \
+  getsrvbynm \
+  getsrvbynm_r \
+  getsrvbypt \
+  getsrvbypt_r \
+  herrno \
+  herrno-loc \
+  htonl \
+  htons \
+  idna \
+  idna_name_classify \
+  if_index \
+  ifaddrs \
+  in6_addr \
+  inet6_opt \
+  inet6_option \
+  inet6_rth \
+  inet6_scopeid_pton \
+  inet_lnaof \
+  inet_mkadr \
+  inet_net \
+  inet_netof \
+  inet_ntoa \
+  rcmd \
+  rexec \
+  ruserpass \
+  setipv4sourcefilter \
+  setsourcefilter \
+  # routines
 
 install-others = $(inst_sysconfdir)/rpc
 
 aux := check_pf check_native ifreq
 
-tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \
-	 tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \
-	 tst-getni1 tst-getni2 tst-inet6_rth tst-checks tst-checks-posix \
-	 tst-sockaddr test-hnto-types tst-if_index-long
+tests := \
+  bug-if1 \
+  htontest \
+  test-hnto-types \
+  test-ifaddrs \
+  test-inet6_opt \
+  test_ifindex \
+  tst-checks \
+  tst-checks-posix \
+  tst-ether_aton \
+  tst-ether_line \
+  tst-gethnm \
+  tst-getni1 \
+  tst-getni2 \
+  tst-if_index-long \
+  tst-inet6_rth \
+  tst-network \
+  tst-ntoa \
+  tst-sockaddr \
+  # tests
 
 # tst-deadline must be linked statically so that we can access
 # internal functions.
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 02/16] nss: Rearrange and sort Makefile variables
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
  2023-10-02 12:55 ` [PATCH 01/16] inet: Rearrange and sort Makefile variables Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-02 14:12   ` Siddhesh Poyarekar
  2023-10-02 12:55 ` [PATCH 03/16] Remove 'grp' and merge into 'nss' and 'posix' Arjun Shankar
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

Rearrange lists of routines, tests, etc. into one-per-line in
nss/Makefile and sort them using scripts/sort-makefile-lines.py.
---
 nss/Makefile | 55 +++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 41 insertions(+), 14 deletions(-)

diff --git a/nss/Makefile b/nss/Makefile
index 668ba34b18..32764b74c0 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -22,23 +22,50 @@ subdir	:= nss
 
 include ../Makeconfig
 
-headers			:= nss.h
+headers := \
+  nss.h \
+  # headers
 
 # This is the trivial part which goes into libc itself.
-routines		= nsswitch getnssent getnssent_r digits_dots \
-			  valid_field valid_list_field rewrite_field \
-			  $(addsuffix -lookup,$(databases)) \
-			  compat-lookup nss_hash nss_files_fopen \
-			  nss_readline nss_parse_line_result \
-			  nss_fgetent_r nss_module nss_action \
-			  nss_action_parse nss_database nss_files_data \
-			  nss_files_functions
+routines = \
+  $(addsuffix -lookup,$(databases)) \
+  compat-lookup \
+  digits_dots \
+  getnssent \
+  getnssent_r \
+  nss_action \
+  nss_action_parse \
+  nss_database \
+  nss_fgetent_r \
+  nss_files_data \
+  nss_files_fopen \
+  nss_files_functions \
+  nss_hash \
+  nss_module \
+  nss_parse_line_result \
+  nss_readline \
+  nsswitch \
+  rewrite_field \
+  valid_field \
+  valid_list_field \
+  # routines
 
 # These are the databases that go through nss dispatch.
 # Caution: if you add a database here, you must add its real name
 # in databases.def, too.
-databases		= proto service hosts network grp pwd ethers \
-			  spwd netgrp alias sgrp
+databases = \
+  alias \
+  ethers \
+  grp \
+  hosts \
+  netgrp \
+  network \
+  proto \
+  pwd \
+  service \
+  sgrp \
+  spwd \
+  # databases
 
 ifneq (,$(filter sunrpc,$(subdirs)))
 databases		+= key rpc
@@ -68,7 +95,7 @@ tests := \
   tst-nss-test4 \
   tst-nss-test5 \
   tst-nss-test_errno \
-# tests
+  # tests
 
 xtests = bug-erange
 
@@ -79,11 +106,11 @@ tests-container := \
   tst-nss-files-hosts-long \
   tst-nss-files-hosts-v4mapped \
   tst-nss-gai-actions \
+  tst-nss-gai-hv2-canonname \
   tst-nss-test3 \
   tst-reload1 \
   tst-reload2 \
-  tst-nss-gai-hv2-canonname \
-# tests-container
+  # tests-container
 
 # Tests which need libdl
 ifeq (yes,$(build-shared))
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 03/16] Remove 'grp' and merge into 'nss' and 'posix'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
  2023-10-02 12:55 ` [PATCH 01/16] inet: Rearrange and sort Makefile variables Arjun Shankar
  2023-10-02 12:55 ` [PATCH 02/16] nss: " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-19 17:55   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 04/16] Remove 'gshadow' and merge into 'nss' Arjun Shankar
                   ` (12 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

The majority of grp routines are entry points for nss functionality.
This commit removes the 'grp' subdirectory and moves all nss-relevant
functionality and all tests to 'nss', and the 'setgroups' stub into
'posix' (alongside the 'getgroups' stub).  References to grp/ are
accordingly changed.  In addition, compat-initgroups.c, a fallback
implementation of initgroups is renamed to initgroups-fallback.c so that
the build system does not confuse it for nss_compat/compat-initgroups.c.

Build time improves very slightly; e.g. down from an average of 45.5s to
44.5s on an 8-thread mobile x86_64 CPU.
---
 Makeconfig                                    |  2 +-
 grp/Makefile                                  | 70 -------------------
 grp/Versions                                  | 34 ---------
 include/grp-merge.h                           |  2 +-
 include/grp.h                                 |  2 +-
 nscd/initgrcache.c                            |  2 +-
 nss/Makefile                                  | 43 +++++++++++-
 nss/Versions                                  | 30 ++++++++
 {grp => nss}/fgetgrent.c                      |  0
 {grp => nss}/fgetgrent_r.c                    |  0
 {grp => nss}/getgrent.c                       |  0
 {grp => nss}/getgrent_r.c                     |  0
 {grp => nss}/getgrgid.c                       |  0
 {grp => nss}/getgrgid_r.c                     |  0
 {grp => nss}/getgrnam.c                       |  0
 {grp => nss}/getgrnam_r.c                     |  0
 {grp => nss}/grp-merge.c                      |  0
 {grp => nss}/grp-merge.h                      |  0
 {grp => nss}/grp.h                            |  0
 .../initgroups-fallback.c                     |  0
 {grp => nss}/initgroups.c                     |  2 +-
 {grp => nss}/putgrent.c                       |  0
 {grp => nss}/testgrp.c                        |  0
 {grp => nss}/tst-initgroups1.c                |  0
 {grp => nss}/tst-initgroups1.root/etc/group   |  0
 .../tst-initgroups1.root/etc/nsswitch.conf    |  0
 {grp => nss}/tst-initgroups1.root/etc/passwd  |  0
 {grp => nss}/tst-initgroups2.c                |  0
 {grp => nss}/tst-initgroups2.root/etc/group   |  0
 .../tst-initgroups2.root/etc/nsswitch.conf    |  0
 {grp => nss}/tst-initgroups2.root/etc/passwd  |  0
 {grp => nss}/tst-putgrent.c                   |  0
 {grp => nss}/tst_fgetgrent.c                  |  0
 {grp => nss}/tst_fgetgrent.sh                 | 10 +--
 posix/Makefile                                |  1 +
 posix/Versions                                |  2 +-
 {grp => posix}/setgroups.c                    |  0
 scripts/update-copyrights                     |  2 +-
 38 files changed, 85 insertions(+), 117 deletions(-)
 delete mode 100644 grp/Makefile
 delete mode 100644 grp/Versions
 rename {grp => nss}/fgetgrent.c (100%)
 rename {grp => nss}/fgetgrent_r.c (100%)
 rename {grp => nss}/getgrent.c (100%)
 rename {grp => nss}/getgrent_r.c (100%)
 rename {grp => nss}/getgrgid.c (100%)
 rename {grp => nss}/getgrgid_r.c (100%)
 rename {grp => nss}/getgrnam.c (100%)
 rename {grp => nss}/getgrnam_r.c (100%)
 rename {grp => nss}/grp-merge.c (100%)
 rename {grp => nss}/grp-merge.h (100%)
 rename {grp => nss}/grp.h (100%)
 rename grp/compat-initgroups.c => nss/initgroups-fallback.c (100%)
 rename {grp => nss}/initgroups.c (99%)
 rename {grp => nss}/putgrent.c (100%)
 rename {grp => nss}/testgrp.c (100%)
 rename {grp => nss}/tst-initgroups1.c (100%)
 rename {grp => nss}/tst-initgroups1.root/etc/group (100%)
 rename {grp => nss}/tst-initgroups1.root/etc/nsswitch.conf (100%)
 rename {grp => nss}/tst-initgroups1.root/etc/passwd (100%)
 rename {grp => nss}/tst-initgroups2.c (100%)
 rename {grp => nss}/tst-initgroups2.root/etc/group (100%)
 rename {grp => nss}/tst-initgroups2.root/etc/nsswitch.conf (100%)
 rename {grp => nss}/tst-initgroups2.root/etc/passwd (100%)
 rename {grp => nss}/tst-putgrent.c (100%)
 rename {grp => nss}/tst_fgetgrent.c (100%)
 rename {grp => nss}/tst_fgetgrent.sh (76%)
 rename {grp => posix}/setgroups.c (100%)

diff --git a/Makeconfig b/Makeconfig
index c48fcc59e8..9ff6a902e9 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1352,7 +1352,7 @@ endif
 # dependencies and generate sorted-subdirs dynamically.
 all-subdirs = csu assert ctype locale intl catgets math setjmp signal	    \
 	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
-	      grp pwd posix io termios resource misc socket sysvipc gmon    \
+	      pwd posix io termios resource misc socket sysvipc gmon        \
 	      gnulib iconv iconvdata wctype manual shadow gshadow po argp   \
 	      localedata timezone rt conform debug mathvec support	    \
 	      dlfcn elf
diff --git a/grp/Makefile b/grp/Makefile
deleted file mode 100644
index 38006fb5c3..0000000000
--- a/grp/Makefile
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (C) 1991-2023 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <https://www.gnu.org/licenses/>.
-
-#
-#	Sub-makefile for grp portion of the library.
-#
-subdir	:= grp
-
-include ../Makeconfig
-
-headers := grp.h
-
-routines := fgetgrent initgroups setgroups \
-	    getgrent getgrgid getgrnam putgrent \
-	    getgrent_r getgrgid_r getgrnam_r fgetgrent_r \
-	    grp-merge
-
-tests := testgrp tst-putgrent
-
-tests-container = \
-	tst-initgroups1 \
-	tst-initgroups2
-
-ifeq (yes,$(build-shared))
-test-srcs :=  tst_fgetgrent
-ifeq ($(run-built-tests),yes)
-tests-special += $(objpfx)tst_fgetgrent.out
-endif
-endif
-
-
-include ../Rules
-
-ifeq ($(have-thread-library),yes)
-
-CFLAGS-getgrgid_r.c += -fexceptions
-CFLAGS-getgrnam_r.c += -fexceptions
-CFLAGS-getgrent_r.c += -fexceptions
-CFLAGS-getgrent.c += -fexceptions
-CFLAGS-fgetgrent.c += -fexceptions
-CFLAGS-fgetgrent_r.c += -fexceptions $(libio-mtsafe)
-CFLAGS-putgrent.c += -fexceptions $(libio-mtsafe)
-CFLAGS-initgroups.c += -fexceptions
-CFLAGS-getgrgid.c += -fexceptions
-
-endif
-
-ifeq ($(run-built-tests),yes)
-# tst_fgetgrent currently only works with shared libraries
-ifeq (yes,$(build-shared))
-$(objpfx)tst_fgetgrent.out: tst_fgetgrent.sh $(objpfx)tst_fgetgrent
-	$(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
-	$(evaluate-test)
-
-endif
-endif
diff --git a/grp/Versions b/grp/Versions
deleted file mode 100644
index 096caa47c5..0000000000
--- a/grp/Versions
+++ /dev/null
@@ -1,34 +0,0 @@
-libc {
-  GLIBC_2.0 {
-    # e*
-    endgrent;
-
-    # f*
-    fgetgrent; fgetgrent_r;
-
-    # g*
-    getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
-    getgroups;
-
-    # i*
-    initgroups;
-
-    # s*
-    setgrent; setgroups;
-  }
-  GLIBC_2.1 {
-    # p*
-    putgrent;
-  }
-  GLIBC_2.1.2 {
-    # g*
-    getgrent_r; getgrgid_r; getgrnam_r;
-  }
-  GLIBC_2.2.4 {
-    # g*
-    getgrouplist;
-  }
-  GLIBC_PRIVATE {
-    __merge_grp; __copy_grp;
-  }
-}
diff --git a/include/grp-merge.h b/include/grp-merge.h
index 331ac20ea9..fc9a25df01 100644
--- a/include/grp-merge.h
+++ b/include/grp-merge.h
@@ -1,5 +1,5 @@
 #ifndef _GRP_MERGE_H
-#include <grp/grp-merge.h>
+#include <nss/grp-merge.h>
 
 libc_hidden_proto (__copy_grp)
 libc_hidden_proto (__merge_grp)
diff --git a/include/grp.h b/include/grp.h
index 2cd2475534..96b98a3cde 100644
--- a/include/grp.h
+++ b/include/grp.h
@@ -1,5 +1,5 @@
 #ifndef _GRP_H
-#include <grp/grp.h>
+#include <nss/grp.h>
 
 #ifndef _ISOMAC
 libc_hidden_proto (setgroups)
diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c
index be44951bd6..8d8e1c2dbf 100644
--- a/nscd/initgrcache.c
+++ b/nscd/initgrcache.c
@@ -45,7 +45,7 @@ static const initgr_response_header notfound =
 };
 
 
-#include "../grp/compat-initgroups.c"
+#include "../nss/initgroups-fallback.c"
 
 
 static time_t
diff --git a/nss/Makefile b/nss/Makefile
index 32764b74c0..baf7d9d0ab 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -23,6 +23,7 @@ subdir	:= nss
 include ../Makeconfig
 
 headers := \
+  grp.h \
   nss.h \
   # headers
 
@@ -50,6 +51,34 @@ routines = \
   valid_list_field \
   # routines
 
+# grp routines:
+routines += \
+  fgetgrent \
+  fgetgrent_r \
+  getgrent \
+  getgrent_r \
+  getgrgid \
+  getgrgid_r \
+  getgrnam \
+  getgrnam_r \
+  grp-merge \
+  initgroups \
+  putgrent \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-fgetgrent.c += -fexceptions
+CFLAGS-fgetgrent_r.c += -fexceptions $(libio-mtsafe)
+CFLAGS-getgrent.c += -fexceptions
+CFLAGS-getgrent_r.c += -fexceptions
+CFLAGS-getgrgid.c += -fexceptions
+CFLAGS-getgrgid_r.c += -fexceptions
+CFLAGS-getgrnam.c += -fexceptions
+CFLAGS-getgrnam_r.c += -fexceptions
+CFLAGS-initgroups.c += -fexceptions
+CFLAGS-putgrent.c += -fexceptions $(libio-mtsafe)
+endif
+
 # These are the databases that go through nss dispatch.
 # Caution: if you add a database here, you must add its real name
 # in databases.def, too.
@@ -88,6 +117,7 @@ tests := \
   bug17079 \
   test-digits-dots \
   test-netdb \
+  testgrp \
   tst-nss-getpwent \
   tst-nss-hash \
   tst-nss-test1 \
@@ -95,11 +125,14 @@ tests := \
   tst-nss-test4 \
   tst-nss-test5 \
   tst-nss-test_errno \
+  tst-putgrent \
   # tests
 
 xtests = bug-erange
 
 tests-container := \
+  tst-initgroups1 \
+  tst-initgroups2 \
   tst-nss-compat1 \
   tst-nss-db-endgrent \
   tst-nss-db-endpwent \
@@ -112,13 +145,21 @@ tests-container := \
   tst-reload2 \
   # tests-container
 
-# Tests which need libdl
 ifeq (yes,$(build-shared))
+# Tests which need libdl
 tests += tst-nss-files-hosts-erange
 tests += tst-nss-files-hosts-multi
 tests += tst-nss-files-hosts-getent
 tests += tst-nss-files-alias-leak
 tests += tst-nss-files-alias-truncated
+# tst_fgetgrent currently only works with shared libraries
+test-srcs :=  tst_fgetgrent
+ifeq ($(run-built-tests),yes)
+tests-special += $(objpfx)tst_fgetgrent.out
+$(objpfx)tst_fgetgrent.out: tst_fgetgrent.sh $(objpfx)tst_fgetgrent
+	$(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
+	$(evaluate-test)
+endif
 endif
 
 # If we have a thread library then we can test cancellation against
diff --git a/nss/Versions b/nss/Versions
index e551524aa9..5401829911 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -5,10 +5,38 @@ libc {
     # Functions exported as no-op compat symbols.
     __nss_passwd_lookup; __nss_group_lookup; __nss_hosts_lookup; __nss_next;
     __nss_database_lookup;
+
+    # e*
+    endgrent;
+
+    # f*
+    fgetgrent; fgetgrent_r;
+
+    # g*
+    getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
+    getgroups;
+
+    # i*
+    initgroups;
+
+    # s*
+    setgrent;
+  }
+  GLIBC_2.1 {
+    # p*
+    putgrent;
+  }
+  GLIBC_2.1.2 {
+    # g*
+    getgrent_r; getgrgid_r; getgrnam_r;
   }
   GLIBC_2.2.2 {
     __nss_hostname_digits_dots;
   }
+  GLIBC_2.2.4 {
+    # g*
+    getgrouplist;
+  }
   GLIBC_2.27 {
   }
   GLIBC_PRIVATE {
@@ -107,6 +135,8 @@ libc {
     _nss_files_initgroups_dyn;
 
     _nss_files_init;
+
+    __merge_grp; __copy_grp;
   }
 }
 
diff --git a/grp/fgetgrent.c b/nss/fgetgrent.c
similarity index 100%
rename from grp/fgetgrent.c
rename to nss/fgetgrent.c
diff --git a/grp/fgetgrent_r.c b/nss/fgetgrent_r.c
similarity index 100%
rename from grp/fgetgrent_r.c
rename to nss/fgetgrent_r.c
diff --git a/grp/getgrent.c b/nss/getgrent.c
similarity index 100%
rename from grp/getgrent.c
rename to nss/getgrent.c
diff --git a/grp/getgrent_r.c b/nss/getgrent_r.c
similarity index 100%
rename from grp/getgrent_r.c
rename to nss/getgrent_r.c
diff --git a/grp/getgrgid.c b/nss/getgrgid.c
similarity index 100%
rename from grp/getgrgid.c
rename to nss/getgrgid.c
diff --git a/grp/getgrgid_r.c b/nss/getgrgid_r.c
similarity index 100%
rename from grp/getgrgid_r.c
rename to nss/getgrgid_r.c
diff --git a/grp/getgrnam.c b/nss/getgrnam.c
similarity index 100%
rename from grp/getgrnam.c
rename to nss/getgrnam.c
diff --git a/grp/getgrnam_r.c b/nss/getgrnam_r.c
similarity index 100%
rename from grp/getgrnam_r.c
rename to nss/getgrnam_r.c
diff --git a/grp/grp-merge.c b/nss/grp-merge.c
similarity index 100%
rename from grp/grp-merge.c
rename to nss/grp-merge.c
diff --git a/grp/grp-merge.h b/nss/grp-merge.h
similarity index 100%
rename from grp/grp-merge.h
rename to nss/grp-merge.h
diff --git a/grp/grp.h b/nss/grp.h
similarity index 100%
rename from grp/grp.h
rename to nss/grp.h
diff --git a/grp/compat-initgroups.c b/nss/initgroups-fallback.c
similarity index 100%
rename from grp/compat-initgroups.c
rename to nss/initgroups-fallback.c
diff --git a/grp/initgroups.c b/nss/initgroups.c
similarity index 99%
rename from grp/initgroups.c
rename to nss/initgroups.c
index 2ebd623d7b..e803cecebc 100644
--- a/grp/initgroups.c
+++ b/nss/initgroups.c
@@ -39,7 +39,7 @@ typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
 static bool use_initgroups_entry;
 
 
-#include "compat-initgroups.c"
+#include "initgroups-fallback.c"
 
 
 static int
diff --git a/grp/putgrent.c b/nss/putgrent.c
similarity index 100%
rename from grp/putgrent.c
rename to nss/putgrent.c
diff --git a/grp/testgrp.c b/nss/testgrp.c
similarity index 100%
rename from grp/testgrp.c
rename to nss/testgrp.c
diff --git a/grp/tst-initgroups1.c b/nss/tst-initgroups1.c
similarity index 100%
rename from grp/tst-initgroups1.c
rename to nss/tst-initgroups1.c
diff --git a/grp/tst-initgroups1.root/etc/group b/nss/tst-initgroups1.root/etc/group
similarity index 100%
rename from grp/tst-initgroups1.root/etc/group
rename to nss/tst-initgroups1.root/etc/group
diff --git a/grp/tst-initgroups1.root/etc/nsswitch.conf b/nss/tst-initgroups1.root/etc/nsswitch.conf
similarity index 100%
rename from grp/tst-initgroups1.root/etc/nsswitch.conf
rename to nss/tst-initgroups1.root/etc/nsswitch.conf
diff --git a/grp/tst-initgroups1.root/etc/passwd b/nss/tst-initgroups1.root/etc/passwd
similarity index 100%
rename from grp/tst-initgroups1.root/etc/passwd
rename to nss/tst-initgroups1.root/etc/passwd
diff --git a/grp/tst-initgroups2.c b/nss/tst-initgroups2.c
similarity index 100%
rename from grp/tst-initgroups2.c
rename to nss/tst-initgroups2.c
diff --git a/grp/tst-initgroups2.root/etc/group b/nss/tst-initgroups2.root/etc/group
similarity index 100%
rename from grp/tst-initgroups2.root/etc/group
rename to nss/tst-initgroups2.root/etc/group
diff --git a/grp/tst-initgroups2.root/etc/nsswitch.conf b/nss/tst-initgroups2.root/etc/nsswitch.conf
similarity index 100%
rename from grp/tst-initgroups2.root/etc/nsswitch.conf
rename to nss/tst-initgroups2.root/etc/nsswitch.conf
diff --git a/grp/tst-initgroups2.root/etc/passwd b/nss/tst-initgroups2.root/etc/passwd
similarity index 100%
rename from grp/tst-initgroups2.root/etc/passwd
rename to nss/tst-initgroups2.root/etc/passwd
diff --git a/grp/tst-putgrent.c b/nss/tst-putgrent.c
similarity index 100%
rename from grp/tst-putgrent.c
rename to nss/tst-putgrent.c
diff --git a/grp/tst_fgetgrent.c b/nss/tst_fgetgrent.c
similarity index 100%
rename from grp/tst_fgetgrent.c
rename to nss/tst_fgetgrent.c
diff --git a/grp/tst_fgetgrent.sh b/nss/tst_fgetgrent.sh
similarity index 76%
rename from grp/tst_fgetgrent.sh
rename to nss/tst_fgetgrent.sh
index 1775a6bc61..fb6b0c4179 100644
--- a/grp/tst_fgetgrent.sh
+++ b/nss/tst_fgetgrent.sh
@@ -21,20 +21,20 @@ set -e
 common_objpfx=$1; shift
 test_program_prefix=$1; shift
 
-testout=${common_objpfx}/grp/tst_fgetgrent.out
+testout=${common_objpfx}/nss/tst_fgetgrent.out
 
 result=0
 
 ${test_program_prefix} \
-${common_objpfx}grp/tst_fgetgrent 0 > ${testout} || result=1
+${common_objpfx}nss/tst_fgetgrent 0 > ${testout} || result=1
 
 ${test_program_prefix} \
-${common_objpfx}grp/tst_fgetgrent 1 >> ${testout} || result=1
+${common_objpfx}nss/tst_fgetgrent 1 >> ${testout} || result=1
 
 ${test_program_prefix} \
-${common_objpfx}grp/tst_fgetgrent 2 >> ${testout} || result=1
+${common_objpfx}nss/tst_fgetgrent 2 >> ${testout} || result=1
 
 ${test_program_prefix} \
-${common_objpfx}grp/tst_fgetgrent 3 >> ${testout} || result=1
+${common_objpfx}nss/tst_fgetgrent 3 >> ${testout} || result=1
 
 exit $result
diff --git a/posix/Makefile b/posix/Makefile
index c36b9d981e..be7d319394 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -137,6 +137,7 @@ routines := \
   sched_sets \
   sched_yield \
   setgid \
+  setgroups \
   setpgid \
   setpgrp \
   setresgid \
diff --git a/posix/Versions b/posix/Versions
index 3753810864..2eedbc3e79 100644
--- a/posix/Versions
+++ b/posix/Versions
@@ -53,7 +53,7 @@ libc {
     sched_get_priority_max; sched_get_priority_min; sched_getparam;
     sched_getscheduler; sched_rr_get_interval; sched_setparam;
     sched_setscheduler; sched_yield; setegid; seteuid; setgid;
-    setpgid; setpgrp; setsid; setuid; sleep; sysconf;
+    setgroups; setpgid; setpgrp; setsid; setuid; sleep; sysconf;
 
     # t*
     times;
diff --git a/grp/setgroups.c b/posix/setgroups.c
similarity index 100%
rename from grp/setgroups.c
rename to posix/setgroups.c
diff --git a/scripts/update-copyrights b/scripts/update-copyrights
index f6ef6fa33b..a582fa1476 100755
--- a/scripts/update-copyrights
+++ b/scripts/update-copyrights
@@ -65,7 +65,7 @@ for f in $files; do
 	"$update_script" "$f"
       fi
       ;;
-    grp/initgroups.c | misc/bits/stab.def | posix/regex.h \
+    nss/initgroups.c | misc/bits/stab.def | posix/regex.h \
       | sysdeps/wordsize-32/divdi3.c)
       # Pre-1991 gaps in copyright years, so cannot use a single range.
       UPDATE_COPYRIGHT_USE_INTERVALS=1 "$update_script" "$f"
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 04/16] Remove 'gshadow' and merge into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (2 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 03/16] Remove 'grp' and merge into 'nss' and 'posix' Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-19 18:15   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 05/16] Remove 'pwd' " Arjun Shankar
                   ` (11 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

The majority of gshadow routines are entry points for nss functionality.
This commit removes the 'gshadow' subdirectory and moves all
functionality and tests to 'nss'.  References to gshadow/ are
accordingly changed.
---
 Makeconfig                         |  2 +-
 gshadow/Makefile                   | 39 ------------------------------
 gshadow/Versions                   | 21 ----------------
 include/gshadow.h                  |  2 +-
 nss/Makefile                       | 28 +++++++++++++++++++++
 nss/Versions                       | 19 +++++++++++++++
 {gshadow => nss}/fgetsgent.c       |  0
 {gshadow => nss}/fgetsgent_r.c     |  0
 {gshadow => nss}/getsgent.c        |  0
 {gshadow => nss}/getsgent_r.c      |  0
 {gshadow => nss}/getsgnam.c        |  0
 {gshadow => nss}/getsgnam_r.c      |  0
 {gshadow => nss}/gshadow.h         |  0
 {gshadow => nss}/putsgent.c        |  0
 {gshadow => nss}/sgetsgent.c       |  0
 {gshadow => nss}/sgetsgent_r.c     |  0
 {gshadow => nss}/tst-fgetsgent_r.c |  0
 {gshadow => nss}/tst-gshadow.c     |  0
 {gshadow => nss}/tst-putsgent.c    |  0
 {gshadow => nss}/tst-sgetsgent.c   |  0
 20 files changed, 49 insertions(+), 62 deletions(-)
 delete mode 100644 gshadow/Makefile
 delete mode 100644 gshadow/Versions
 rename {gshadow => nss}/fgetsgent.c (100%)
 rename {gshadow => nss}/fgetsgent_r.c (100%)
 rename {gshadow => nss}/getsgent.c (100%)
 rename {gshadow => nss}/getsgent_r.c (100%)
 rename {gshadow => nss}/getsgnam.c (100%)
 rename {gshadow => nss}/getsgnam_r.c (100%)
 rename {gshadow => nss}/gshadow.h (100%)
 rename {gshadow => nss}/putsgent.c (100%)
 rename {gshadow => nss}/sgetsgent.c (100%)
 rename {gshadow => nss}/sgetsgent_r.c (100%)
 rename {gshadow => nss}/tst-fgetsgent_r.c (100%)
 rename {gshadow => nss}/tst-gshadow.c (100%)
 rename {gshadow => nss}/tst-putsgent.c (100%)
 rename {gshadow => nss}/tst-sgetsgent.c (100%)

diff --git a/Makeconfig b/Makeconfig
index 9ff6a902e9..ac7fa3dbb3 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1353,7 +1353,7 @@ endif
 all-subdirs = csu assert ctype locale intl catgets math setjmp signal	    \
 	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
 	      pwd posix io termios resource misc socket sysvipc gmon        \
-	      gnulib iconv iconvdata wctype manual shadow gshadow po argp   \
+	      gnulib iconv iconvdata wctype manual shadow po argp           \
 	      localedata timezone rt conform debug mathvec support	    \
 	      dlfcn elf
 
diff --git a/gshadow/Makefile b/gshadow/Makefile
deleted file mode 100644
index a95524593a..0000000000
--- a/gshadow/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2009-2023 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <https://www.gnu.org/licenses/>.
-
-#
-#	Makefile for gshadow.
-#
-subdir	:= gshadow
-
-include ../Makeconfig
-
-headers		= gshadow.h
-routines	= getsgent getsgnam sgetsgent fgetsgent putsgent \
-		  getsgent_r getsgnam_r sgetsgent_r fgetsgent_r
-
-tests = tst-gshadow tst-putsgent tst-fgetsgent_r tst-sgetsgent
-
-CFLAGS-getsgent_r.c += -fexceptions
-CFLAGS-getsgent.c += -fexceptions
-CFLAGS-fgetsgent.c += -fexceptions
-CFLAGS-fgetsgent_r.c += -fexceptions $(libio-mtsafe)
-CFLAGS-putsgent.c += -fexceptions $(libio-mtsafe)
-CFLAGS-getsgnam.c += -fexceptions
-CFLAGS-getsgnam_r.c += -fexceptions
-
-include ../Rules
diff --git a/gshadow/Versions b/gshadow/Versions
deleted file mode 100644
index 1dba0c5f19..0000000000
--- a/gshadow/Versions
+++ /dev/null
@@ -1,21 +0,0 @@
-libc {
-  GLIBC_2.10 {
-    # e*
-    endsgent;
-
-    # f*
-    fgetsgent; fgetsgent_r;
-
-    # g*
-    getsgent; getsgent_r; getsgnam; getsgnam_r;
-
-    # p*
-    putsgent;
-
-    # s*
-    setsgent;
-
-    # s*
-    sgetsgent; sgetsgent_r;
-  }
-}
diff --git a/include/gshadow.h b/include/gshadow.h
index 1cefcfc641..95f8f950a9 100644
--- a/include/gshadow.h
+++ b/include/gshadow.h
@@ -1,5 +1,5 @@
 #ifndef _GSHADOW_H
-#include <gshadow/gshadow.h>
+#include <nss/gshadow.h>
 
 # ifndef _ISOMAC
 
diff --git a/nss/Makefile b/nss/Makefile
index baf7d9d0ab..5256b90f8b 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -24,6 +24,7 @@ include ../Makeconfig
 
 headers := \
   grp.h \
+  gshadow.h \
   nss.h \
   # headers
 
@@ -79,6 +80,29 @@ CFLAGS-initgroups.c += -fexceptions
 CFLAGS-putgrent.c += -fexceptions $(libio-mtsafe)
 endif
 
+# gshadow routines:
+routines += \
+  fgetsgent \
+  fgetsgent_r \
+  getsgent \
+  getsgent_r \
+  getsgnam \
+  getsgnam_r \
+  putsgent \
+  sgetsgent \
+  sgetsgent_r \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-getsgent_r.c += -fexceptions
+CFLAGS-getsgent.c += -fexceptions
+CFLAGS-fgetsgent.c += -fexceptions
+CFLAGS-fgetsgent_r.c += -fexceptions $(libio-mtsafe)
+CFLAGS-putsgent.c += -fexceptions $(libio-mtsafe)
+CFLAGS-getsgnam.c += -fexceptions
+CFLAGS-getsgnam_r.c += -fexceptions
+endif
+
 # These are the databases that go through nss dispatch.
 # Caution: if you add a database here, you must add its real name
 # in databases.def, too.
@@ -118,6 +142,8 @@ tests := \
   test-digits-dots \
   test-netdb \
   testgrp \
+  tst-fgetsgent_r \
+  tst-gshadow \
   tst-nss-getpwent \
   tst-nss-hash \
   tst-nss-test1 \
@@ -126,6 +152,8 @@ tests := \
   tst-nss-test5 \
   tst-nss-test_errno \
   tst-putgrent \
+  tst-putsgent \
+  tst-sgetsgent \
   # tests
 
 xtests = bug-erange
diff --git a/nss/Versions b/nss/Versions
index 5401829911..6204ac0af1 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -37,6 +37,25 @@ libc {
     # g*
     getgrouplist;
   }
+  GLIBC_2.10 {
+    # e*
+    endsgent;
+
+    # f*
+    fgetsgent; fgetsgent_r;
+
+    # g*
+    getsgent; getsgent_r; getsgnam; getsgnam_r;
+
+    # p*
+    putsgent;
+
+    # s*
+    setsgent;
+
+    # s*
+    sgetsgent; sgetsgent_r;
+  }
   GLIBC_2.27 {
   }
   GLIBC_PRIVATE {
diff --git a/gshadow/fgetsgent.c b/nss/fgetsgent.c
similarity index 100%
rename from gshadow/fgetsgent.c
rename to nss/fgetsgent.c
diff --git a/gshadow/fgetsgent_r.c b/nss/fgetsgent_r.c
similarity index 100%
rename from gshadow/fgetsgent_r.c
rename to nss/fgetsgent_r.c
diff --git a/gshadow/getsgent.c b/nss/getsgent.c
similarity index 100%
rename from gshadow/getsgent.c
rename to nss/getsgent.c
diff --git a/gshadow/getsgent_r.c b/nss/getsgent_r.c
similarity index 100%
rename from gshadow/getsgent_r.c
rename to nss/getsgent_r.c
diff --git a/gshadow/getsgnam.c b/nss/getsgnam.c
similarity index 100%
rename from gshadow/getsgnam.c
rename to nss/getsgnam.c
diff --git a/gshadow/getsgnam_r.c b/nss/getsgnam_r.c
similarity index 100%
rename from gshadow/getsgnam_r.c
rename to nss/getsgnam_r.c
diff --git a/gshadow/gshadow.h b/nss/gshadow.h
similarity index 100%
rename from gshadow/gshadow.h
rename to nss/gshadow.h
diff --git a/gshadow/putsgent.c b/nss/putsgent.c
similarity index 100%
rename from gshadow/putsgent.c
rename to nss/putsgent.c
diff --git a/gshadow/sgetsgent.c b/nss/sgetsgent.c
similarity index 100%
rename from gshadow/sgetsgent.c
rename to nss/sgetsgent.c
diff --git a/gshadow/sgetsgent_r.c b/nss/sgetsgent_r.c
similarity index 100%
rename from gshadow/sgetsgent_r.c
rename to nss/sgetsgent_r.c
diff --git a/gshadow/tst-fgetsgent_r.c b/nss/tst-fgetsgent_r.c
similarity index 100%
rename from gshadow/tst-fgetsgent_r.c
rename to nss/tst-fgetsgent_r.c
diff --git a/gshadow/tst-gshadow.c b/nss/tst-gshadow.c
similarity index 100%
rename from gshadow/tst-gshadow.c
rename to nss/tst-gshadow.c
diff --git a/gshadow/tst-putsgent.c b/nss/tst-putsgent.c
similarity index 100%
rename from gshadow/tst-putsgent.c
rename to nss/tst-putsgent.c
diff --git a/gshadow/tst-sgetsgent.c b/nss/tst-sgetsgent.c
similarity index 100%
rename from gshadow/tst-sgetsgent.c
rename to nss/tst-sgetsgent.c
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 05/16] Remove 'pwd' and merge into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (3 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 04/16] Remove 'gshadow' and merge into 'nss' Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-19 18:29   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 06/16] Remove 'shadow' " Arjun Shankar
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

The majority of pwd routines are entry points for nss functionality.
This commit removes the 'pwd' subdirectory and moves all functionality
and tests to 'nss'.  References to pwd/ are accordingly changed.
---
 Makeconfig                  |  2 +-
 include/pwd.h               |  2 +-
 nss/Makefile                | 24 +++++++++++++++++++++
 nss/Versions                |  8 +++++++
 {pwd => nss}/fgetpwent.c    |  0
 {pwd => nss}/fgetpwent_r.c  |  0
 {pwd => nss}/getpw.c        |  0
 {pwd => nss}/getpwent.c     |  0
 {pwd => nss}/getpwent_r.c   |  0
 {pwd => nss}/getpwnam.c     |  0
 {pwd => nss}/getpwnam_r.c   |  0
 {pwd => nss}/getpwuid.c     |  0
 {pwd => nss}/getpwuid_r.c   |  0
 {pwd => nss}/putpwent.c     |  0
 {pwd => nss}/pwd.h          |  0
 {pwd => nss}/tst-getpw.c    |  0
 {pwd => nss}/tst-putpwent.c |  0
 pwd/Makefile                | 42 -------------------------------------
 pwd/Versions                | 19 -----------------
 19 files changed, 34 insertions(+), 63 deletions(-)
 rename {pwd => nss}/fgetpwent.c (100%)
 rename {pwd => nss}/fgetpwent_r.c (100%)
 rename {pwd => nss}/getpw.c (100%)
 rename {pwd => nss}/getpwent.c (100%)
 rename {pwd => nss}/getpwent_r.c (100%)
 rename {pwd => nss}/getpwnam.c (100%)
 rename {pwd => nss}/getpwnam_r.c (100%)
 rename {pwd => nss}/getpwuid.c (100%)
 rename {pwd => nss}/getpwuid_r.c (100%)
 rename {pwd => nss}/putpwent.c (100%)
 rename {pwd => nss}/pwd.h (100%)
 rename {pwd => nss}/tst-getpw.c (100%)
 rename {pwd => nss}/tst-putpwent.c (100%)
 delete mode 100644 pwd/Makefile
 delete mode 100644 pwd/Versions

diff --git a/Makeconfig b/Makeconfig
index ac7fa3dbb3..e5badddbc4 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1352,7 +1352,7 @@ endif
 # dependencies and generate sorted-subdirs dynamically.
 all-subdirs = csu assert ctype locale intl catgets math setjmp signal	    \
 	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
-	      pwd posix io termios resource misc socket sysvipc gmon        \
+	      posix io termios resource misc socket sysvipc gmon            \
 	      gnulib iconv iconvdata wctype manual shadow po argp           \
 	      localedata timezone rt conform debug mathvec support	    \
 	      dlfcn elf
diff --git a/include/pwd.h b/include/pwd.h
index f8975d4957..c4ca8bab33 100644
--- a/include/pwd.h
+++ b/include/pwd.h
@@ -1,5 +1,5 @@
 #ifndef _PWD_H
-#include <pwd/pwd.h>
+#include <nss/pwd.h>
 
 #ifndef _ISOMAC
 /* Now define the internal interfaces.  */
diff --git a/nss/Makefile b/nss/Makefile
index 5256b90f8b..28648ea884 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -26,6 +26,7 @@ headers := \
   grp.h \
   gshadow.h \
   nss.h \
+  pwd.h \
   # headers
 
 # This is the trivial part which goes into libc itself.
@@ -103,6 +104,27 @@ CFLAGS-getsgnam.c += -fexceptions
 CFLAGS-getsgnam_r.c += -fexceptions
 endif
 
+# pwd routines:
+routines += \
+  fgetpwent \
+  fgetpwent_r \
+  getpw \
+  getpwent \
+  getpwent_r \
+  getpwnam \
+  getpwnam_r \
+  getpwuid \
+  getpwuid_r \
+  putpwent \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-fgetpwent_r.c += $(libio-mtsafe)
+CFLAGS-getpw.c += -fexceptions
+CFLAGS-getpwent.c += -fexceptions
+CFLAGS-getpwent_r.c += -fexceptions
+endif
+
 # These are the databases that go through nss dispatch.
 # Caution: if you add a database here, you must add its real name
 # in databases.def, too.
@@ -143,6 +165,7 @@ tests := \
   test-netdb \
   testgrp \
   tst-fgetsgent_r \
+  tst-getpw \
   tst-gshadow \
   tst-nss-getpwent \
   tst-nss-hash \
@@ -152,6 +175,7 @@ tests := \
   tst-nss-test5 \
   tst-nss-test_errno \
   tst-putgrent \
+  tst-putpwent \
   tst-putsgent \
   tst-sgetsgent \
   # tests
diff --git a/nss/Versions b/nss/Versions
index 6204ac0af1..58ca73c9df 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -8,19 +8,26 @@ libc {
 
     # e*
     endgrent;
+    endpwent;
 
     # f*
     fgetgrent; fgetgrent_r;
+    fgetpwent; fgetpwent_r;
 
     # g*
     getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
     getgroups;
+    getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
 
     # i*
     initgroups;
 
+    # p*
+    putpwent;
+
     # s*
     setgrent;
+    setpwent;
   }
   GLIBC_2.1 {
     # p*
@@ -29,6 +36,7 @@ libc {
   GLIBC_2.1.2 {
     # g*
     getgrent_r; getgrgid_r; getgrnam_r;
+    getpwent_r; getpwuid_r; getpwnam_r;
   }
   GLIBC_2.2.2 {
     __nss_hostname_digits_dots;
diff --git a/pwd/fgetpwent.c b/nss/fgetpwent.c
similarity index 100%
rename from pwd/fgetpwent.c
rename to nss/fgetpwent.c
diff --git a/pwd/fgetpwent_r.c b/nss/fgetpwent_r.c
similarity index 100%
rename from pwd/fgetpwent_r.c
rename to nss/fgetpwent_r.c
diff --git a/pwd/getpw.c b/nss/getpw.c
similarity index 100%
rename from pwd/getpw.c
rename to nss/getpw.c
diff --git a/pwd/getpwent.c b/nss/getpwent.c
similarity index 100%
rename from pwd/getpwent.c
rename to nss/getpwent.c
diff --git a/pwd/getpwent_r.c b/nss/getpwent_r.c
similarity index 100%
rename from pwd/getpwent_r.c
rename to nss/getpwent_r.c
diff --git a/pwd/getpwnam.c b/nss/getpwnam.c
similarity index 100%
rename from pwd/getpwnam.c
rename to nss/getpwnam.c
diff --git a/pwd/getpwnam_r.c b/nss/getpwnam_r.c
similarity index 100%
rename from pwd/getpwnam_r.c
rename to nss/getpwnam_r.c
diff --git a/pwd/getpwuid.c b/nss/getpwuid.c
similarity index 100%
rename from pwd/getpwuid.c
rename to nss/getpwuid.c
diff --git a/pwd/getpwuid_r.c b/nss/getpwuid_r.c
similarity index 100%
rename from pwd/getpwuid_r.c
rename to nss/getpwuid_r.c
diff --git a/pwd/putpwent.c b/nss/putpwent.c
similarity index 100%
rename from pwd/putpwent.c
rename to nss/putpwent.c
diff --git a/pwd/pwd.h b/nss/pwd.h
similarity index 100%
rename from pwd/pwd.h
rename to nss/pwd.h
diff --git a/pwd/tst-getpw.c b/nss/tst-getpw.c
similarity index 100%
rename from pwd/tst-getpw.c
rename to nss/tst-getpw.c
diff --git a/pwd/tst-putpwent.c b/nss/tst-putpwent.c
similarity index 100%
rename from pwd/tst-putpwent.c
rename to nss/tst-putpwent.c
diff --git a/pwd/Makefile b/pwd/Makefile
deleted file mode 100644
index d85842af3e..0000000000
--- a/pwd/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (C) 1991-2023 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <https://www.gnu.org/licenses/>.
-
-#
-#	Sub-makefile for pwd portion of the library.
-#
-subdir	:= pwd
-
-include ../Makeconfig
-
-headers := pwd.h
-
-routines := fgetpwent getpw putpwent \
-	    getpwent getpwnam getpwuid \
-	    getpwent_r getpwnam_r getpwuid_r fgetpwent_r
-
-tests := tst-getpw tst-putpwent
-
-include ../Rules
-
-ifeq ($(have-thread-library),yes)
-
-CFLAGS-getpwent_r.c += -fexceptions
-CFLAGS-getpwent.c += -fexceptions
-CFLAGS-getpw.c += -fexceptions
-CFLAGS-fgetpwent_r.c += $(libio-mtsafe)
-
-endif
diff --git a/pwd/Versions b/pwd/Versions
deleted file mode 100644
index b56970019a..0000000000
--- a/pwd/Versions
+++ /dev/null
@@ -1,19 +0,0 @@
-libc {
-  GLIBC_2.0 {
-    # e*
-    endpwent;
-
-    # f*
-    fgetpwent; fgetpwent_r;
-
-    # g*
-    getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
-
-    # p*
-    putpwent; setpwent;
-  }
-  GLIBC_2.1.2 {
-    # g*
-    getpwent_r; getpwuid_r; getpwnam_r;
-  }
-}
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 06/16] Remove 'shadow' and merge into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (4 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 05/16] Remove 'pwd' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-19 18:44   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 07/16] Move 'aliases' routines from 'inet' " Arjun Shankar
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

The majority of shadow routines are entry points for nss functionality.
This commit removes the 'shadow' subdirectory and moves all
functionality and tests to 'nss'.  References to shadow/ are accordingly
changed.
---
 Makeconfig                     |  2 +-
 include/shadow.h               |  2 +-
 nss/Makefile                   | 27 +++++++++++++++++++++++
 nss/Versions                   | 13 +++++++++++
 {shadow => nss}/fgetspent.c    |  0
 {shadow => nss}/fgetspent_r.c  |  0
 {shadow => nss}/getspent.c     |  0
 {shadow => nss}/getspent_r.c   |  0
 {shadow => nss}/getspnam.c     |  0
 {shadow => nss}/getspnam_r.c   |  0
 {shadow => nss}/lckpwdf.c      |  0
 {shadow => nss}/putspent.c     |  0
 {shadow => nss}/sgetspent.c    |  0
 {shadow => nss}/sgetspent_r.c  |  0
 {shadow => nss}/shadow.h       |  0
 {shadow => nss}/tst-putspent.c |  0
 {shadow => nss}/tst-shadow.c   |  0
 shadow/Makefile                | 40 ----------------------------------
 shadow/Versions                | 31 --------------------------
 19 files changed, 42 insertions(+), 73 deletions(-)
 rename {shadow => nss}/fgetspent.c (100%)
 rename {shadow => nss}/fgetspent_r.c (100%)
 rename {shadow => nss}/getspent.c (100%)
 rename {shadow => nss}/getspent_r.c (100%)
 rename {shadow => nss}/getspnam.c (100%)
 rename {shadow => nss}/getspnam_r.c (100%)
 rename {shadow => nss}/lckpwdf.c (100%)
 rename {shadow => nss}/putspent.c (100%)
 rename {shadow => nss}/sgetspent.c (100%)
 rename {shadow => nss}/sgetspent_r.c (100%)
 rename {shadow => nss}/shadow.h (100%)
 rename {shadow => nss}/tst-putspent.c (100%)
 rename {shadow => nss}/tst-shadow.c (100%)
 delete mode 100644 shadow/Makefile
 delete mode 100644 shadow/Versions

diff --git a/Makeconfig b/Makeconfig
index e5badddbc4..fc35aee10b 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1353,7 +1353,7 @@ endif
 all-subdirs = csu assert ctype locale intl catgets math setjmp signal	    \
 	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
 	      posix io termios resource misc socket sysvipc gmon            \
-	      gnulib iconv iconvdata wctype manual shadow po argp           \
+	      gnulib iconv iconvdata wctype manual po argp                  \
 	      localedata timezone rt conform debug mathvec support	    \
 	      dlfcn elf
 
diff --git a/include/shadow.h b/include/shadow.h
index fb1681909f..bbb8be2ff0 100644
--- a/include/shadow.h
+++ b/include/shadow.h
@@ -1,5 +1,5 @@
 #ifndef _SHADOW_H
-#include <shadow/shadow.h>
+#include <nss/shadow.h>
 
 # ifndef _ISOMAC
 
diff --git a/nss/Makefile b/nss/Makefile
index 28648ea884..84cf62af2b 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -27,6 +27,7 @@ headers := \
   gshadow.h \
   nss.h \
   pwd.h \
+  shadow.h \
   # headers
 
 # This is the trivial part which goes into libc itself.
@@ -125,6 +126,30 @@ CFLAGS-getpwent.c += -fexceptions
 CFLAGS-getpwent_r.c += -fexceptions
 endif
 
+# shadow routines
+routines += \
+  fgetspent \
+  fgetspent_r \
+  getspent \
+  getspent_r \
+  getspnam \
+  getspnam_r \
+  lckpwdf \
+  putspent \
+  sgetspent \
+  sgetspent_r \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-getspent_r.c += -fexceptions
+CFLAGS-getspent.c += -fexceptions
+CFLAGS-fgetspent.c += -fexceptions
+CFLAGS-fgetspent_r.c += -fexceptions $(libio-mtsafe)
+CFLAGS-putspent.c += -fexceptions $(libio-mtsafe)
+CFLAGS-getspnam.c += -fexceptions
+CFLAGS-getspnam_r.c += -fexceptions
+endif
+
 # These are the databases that go through nss dispatch.
 # Caution: if you add a database here, you must add its real name
 # in databases.def, too.
@@ -177,7 +202,9 @@ tests := \
   tst-putgrent \
   tst-putpwent \
   tst-putsgent \
+  tst-putspent \
   tst-sgetsgent \
+  tst-shadow \
   # tests
 
 xtests = bug-erange
diff --git a/nss/Versions b/nss/Versions
index 58ca73c9df..632af25be4 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -9,25 +9,37 @@ libc {
     # e*
     endgrent;
     endpwent;
+    endspent;
 
     # f*
     fgetgrent; fgetgrent_r;
     fgetpwent; fgetpwent_r;
+    fgetspent; fgetspent_r;
 
     # g*
     getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
     getgroups;
     getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
+    getspent; getspent_r; getspnam; getspnam_r;
 
     # i*
     initgroups;
 
+    # l*
+    lckpwdf;
+
     # p*
     putpwent;
+    putspent;
 
     # s*
     setgrent;
     setpwent;
+    setspent;
+    sgetspent; sgetspent_r;
+
+    # u*
+    ulckpwdf;
   }
   GLIBC_2.1 {
     # p*
@@ -37,6 +49,7 @@ libc {
     # g*
     getgrent_r; getgrgid_r; getgrnam_r;
     getpwent_r; getpwuid_r; getpwnam_r;
+    getspent_r; getspnam_r;
   }
   GLIBC_2.2.2 {
     __nss_hostname_digits_dots;
diff --git a/shadow/fgetspent.c b/nss/fgetspent.c
similarity index 100%
rename from shadow/fgetspent.c
rename to nss/fgetspent.c
diff --git a/shadow/fgetspent_r.c b/nss/fgetspent_r.c
similarity index 100%
rename from shadow/fgetspent_r.c
rename to nss/fgetspent_r.c
diff --git a/shadow/getspent.c b/nss/getspent.c
similarity index 100%
rename from shadow/getspent.c
rename to nss/getspent.c
diff --git a/shadow/getspent_r.c b/nss/getspent_r.c
similarity index 100%
rename from shadow/getspent_r.c
rename to nss/getspent_r.c
diff --git a/shadow/getspnam.c b/nss/getspnam.c
similarity index 100%
rename from shadow/getspnam.c
rename to nss/getspnam.c
diff --git a/shadow/getspnam_r.c b/nss/getspnam_r.c
similarity index 100%
rename from shadow/getspnam_r.c
rename to nss/getspnam_r.c
diff --git a/shadow/lckpwdf.c b/nss/lckpwdf.c
similarity index 100%
rename from shadow/lckpwdf.c
rename to nss/lckpwdf.c
diff --git a/shadow/putspent.c b/nss/putspent.c
similarity index 100%
rename from shadow/putspent.c
rename to nss/putspent.c
diff --git a/shadow/sgetspent.c b/nss/sgetspent.c
similarity index 100%
rename from shadow/sgetspent.c
rename to nss/sgetspent.c
diff --git a/shadow/sgetspent_r.c b/nss/sgetspent_r.c
similarity index 100%
rename from shadow/sgetspent_r.c
rename to nss/sgetspent_r.c
diff --git a/shadow/shadow.h b/nss/shadow.h
similarity index 100%
rename from shadow/shadow.h
rename to nss/shadow.h
diff --git a/shadow/tst-putspent.c b/nss/tst-putspent.c
similarity index 100%
rename from shadow/tst-putspent.c
rename to nss/tst-putspent.c
diff --git a/shadow/tst-shadow.c b/nss/tst-shadow.c
similarity index 100%
rename from shadow/tst-shadow.c
rename to nss/tst-shadow.c
diff --git a/shadow/Makefile b/shadow/Makefile
deleted file mode 100644
index 0102a4d0e3..0000000000
--- a/shadow/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (C) 1996-2023 Free Software Foundation, Inc.
-# This file is part of the GNU C Library.
-
-# The GNU C Library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-
-# The GNU C Library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-
-# You should have received a copy of the GNU Lesser General Public
-# License along with the GNU C Library; if not, see
-# <https://www.gnu.org/licenses/>.
-
-#
-#	Makefile for shadow.
-#
-subdir	:= shadow
-
-include ../Makeconfig
-
-headers		= shadow.h
-routines	= getspent getspnam sgetspent fgetspent putspent \
-		  getspent_r getspnam_r sgetspent_r fgetspent_r \
-		  lckpwdf
-
-tests = tst-shadow tst-putspent
-
-CFLAGS-getspent_r.c += -fexceptions
-CFLAGS-getspent.c += -fexceptions
-CFLAGS-fgetspent.c += -fexceptions
-CFLAGS-fgetspent_r.c += -fexceptions $(libio-mtsafe)
-CFLAGS-putspent.c += -fexceptions $(libio-mtsafe)
-CFLAGS-getspnam.c += -fexceptions
-CFLAGS-getspnam_r.c += -fexceptions
-
-include ../Rules
diff --git a/shadow/Versions b/shadow/Versions
deleted file mode 100644
index 38ab368fff..0000000000
--- a/shadow/Versions
+++ /dev/null
@@ -1,31 +0,0 @@
-libc {
-  GLIBC_2.0 {
-    # e*
-    endspent;
-
-    # f*
-    fgetspent; fgetspent_r;
-
-    # g*
-    getspent; getspent_r; getspnam; getspnam_r;
-
-    # l*
-    lckpwdf;
-
-    # p*
-    putspent;
-
-    # s*
-    setspent;
-
-    # s*
-    sgetspent; sgetspent_r;
-
-    # u*
-    ulckpwdf;
-  }
-  GLIBC_2.1.2 {
-    # g*
-    getspent_r; getspnam_r;
-  }
-}
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 07/16] Move 'aliases' routines from 'inet' into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (5 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 06/16] Remove 'shadow' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-19 19:23   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 08/16] Move 'ethers' " Arjun Shankar
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

The aliases routines are entry points for nss functionality.  This
commit moves aliases.h and the aliases routines from the 'inet'
subdirectory to 'nss', and adjusts any external references.
---
 include/aliases.h              |  2 +-
 inet/Makefile                  |  7 -------
 inet/Versions                  |  1 -
 nss/Makefile                   | 14 ++++++++++++++
 nss/Versions                   |  1 +
 {inet => nss}/aliases.h        |  0
 {inet => nss}/getaliasent.c    |  0
 {inet => nss}/getaliasent_r.c  |  0
 {inet => nss}/getaliasname.c   |  0
 {inet => nss}/getaliasname_r.c |  0
 10 files changed, 16 insertions(+), 9 deletions(-)
 rename {inet => nss}/aliases.h (100%)
 rename {inet => nss}/getaliasent.c (100%)
 rename {inet => nss}/getaliasent_r.c (100%)
 rename {inet => nss}/getaliasname.c (100%)
 rename {inet => nss}/getaliasname_r.c (100%)

diff --git a/include/aliases.h b/include/aliases.h
index db82588630..2c7756efe8 100644
--- a/include/aliases.h
+++ b/include/aliases.h
@@ -1,5 +1,5 @@
 #ifndef _ALIASES_H
-#include <inet/aliases.h>
+#include <nss/aliases.h>
 
 # ifndef _ISOMAC
 
diff --git a/inet/Makefile b/inet/Makefile
index 9db7f941c6..bd3dc58322 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -24,7 +24,6 @@ include ../Makeconfig
 
 headers := \
   $(wildcard arpa/*.h protocols/*.h) \
-  aliases.h \
   bits/in.h \
   ifaddrs.h \
   netinet/ether.h \
@@ -49,10 +48,6 @@ routines := \
   ether_ntoa \
   ether_ntoa_r \
   ether_ntoh \
-  getaliasent \
-  getaliasent_r \
-  getaliasname \
-  getaliasname_r \
   gethstbyad \
   gethstbyad_r \
   gethstbynm \
@@ -176,8 +171,6 @@ CFLAGS-getnetbyad_r.c += -fexceptions
 CFLAGS-getnetbyad.c += -fexceptions
 CFLAGS-getnetent_r.c += -fexceptions
 CFLAGS-getnetent.c += -fexceptions
-CFLAGS-getaliasent_r.c += -fexceptions
-CFLAGS-getaliasent.c += -fexceptions
 CFLAGS-getrpcent_r.c += -fexceptions
 CFLAGS-getrpcent.c += -fexceptions
 CFLAGS-getservent_r.c += -fexceptions
diff --git a/inet/Versions b/inet/Versions
index 84cbe847cd..e6d1e6f1ba 100644
--- a/inet/Versions
+++ b/inet/Versions
@@ -14,7 +14,6 @@ libc {
     ether_ntoa_r; ether_ntohost;
 
     # g*
-    getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r;
     getdomainname; gethostbyaddr; gethostbyaddr_r; gethostbyname;
     gethostbyname2; gethostbyname2_r; gethostbyname_r; gethostent;
     gethostent_r; getnetbyaddr; getnetbyaddr_r; getnetbyname;
diff --git a/nss/Makefile b/nss/Makefile
index 84cf62af2b..2dfa7ebef9 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -23,6 +23,7 @@ subdir	:= nss
 include ../Makeconfig
 
 headers := \
+  aliases.h \
   grp.h \
   gshadow.h \
   nss.h \
@@ -54,6 +55,19 @@ routines = \
   valid_list_field \
   # routines
 
+# alias routines:
+routines += \
+  getaliasent \
+  getaliasent_r \
+  getaliasname \
+  getaliasname_r \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-getaliasent_r.c += -fexceptions
+CFLAGS-getaliasent.c += -fexceptions
+endif
+
 # grp routines:
 routines += \
   fgetgrent \
diff --git a/nss/Versions b/nss/Versions
index 632af25be4..5d1b1dac3d 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -17,6 +17,7 @@ libc {
     fgetspent; fgetspent_r;
 
     # g*
+    getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r;
     getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
     getgroups;
     getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
diff --git a/inet/aliases.h b/nss/aliases.h
similarity index 100%
rename from inet/aliases.h
rename to nss/aliases.h
diff --git a/inet/getaliasent.c b/nss/getaliasent.c
similarity index 100%
rename from inet/getaliasent.c
rename to nss/getaliasent.c
diff --git a/inet/getaliasent_r.c b/nss/getaliasent_r.c
similarity index 100%
rename from inet/getaliasent_r.c
rename to nss/getaliasent_r.c
diff --git a/inet/getaliasname.c b/nss/getaliasname.c
similarity index 100%
rename from inet/getaliasname.c
rename to nss/getaliasname.c
diff --git a/inet/getaliasname_r.c b/nss/getaliasname_r.c
similarity index 100%
rename from inet/getaliasname_r.c
rename to nss/getaliasname_r.c
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 08/16] Move 'ethers' routines from 'inet' into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (6 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 07/16] Move 'aliases' routines from 'inet' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-19 19:39   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 09/16] Move 'hosts' " Arjun Shankar
                   ` (7 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

ether_hostton and ether_ntohost are entry points for nss functionality.
This commit moves them from the 'inet' subdirectory to 'nss', and
adjusts any references accordingly.
---
 inet/Makefile              | 2 --
 inet/Versions              | 4 ++--
 nss/Makefile               | 6 ++++++
 nss/Versions               | 1 +
 {inet => nss}/ether_hton.c | 2 +-
 {inet => nss}/ether_ntoh.c | 2 +-
 6 files changed, 11 insertions(+), 6 deletions(-)
 rename {inet => nss}/ether_hton.c (98%)
 rename {inet => nss}/ether_ntoh.c (98%)

diff --git a/inet/Makefile b/inet/Makefile
index bd3dc58322..4d053de748 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -43,11 +43,9 @@ routines := \
   deadline \
   ether_aton \
   ether_aton_r \
-  ether_hton \
   ether_line \
   ether_ntoa \
   ether_ntoa_r \
-  ether_ntoh \
   gethstbyad \
   gethstbyad_r \
   gethstbynm \
diff --git a/inet/Versions b/inet/Versions
index e6d1e6f1ba..a7c1a0fb6f 100644
--- a/inet/Versions
+++ b/inet/Versions
@@ -10,8 +10,8 @@ libc {
     endaliasent; endhostent; endnetent; endnetgrent; endprotoent; endservent;
 
     # e*
-    ether_aton; ether_aton_r; ether_hostton; ether_line; ether_ntoa;
-    ether_ntoa_r; ether_ntohost;
+    ether_aton; ether_aton_r; ether_line; ether_ntoa;
+    ether_ntoa_r;
 
     # g*
     getdomainname; gethostbyaddr; gethostbyaddr_r; gethostbyname;
diff --git a/nss/Makefile b/nss/Makefile
index 2dfa7ebef9..148c6dc1cf 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -68,6 +68,12 @@ CFLAGS-getaliasent_r.c += -fexceptions
 CFLAGS-getaliasent.c += -fexceptions
 endif
 
+# ethers routines:
+routines += \
+  ether_hton \
+  ether_ntoh \
+  # routines
+
 # grp routines:
 routines += \
   fgetgrent \
diff --git a/nss/Versions b/nss/Versions
index 5d1b1dac3d..99208cb9df 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -10,6 +10,7 @@ libc {
     endgrent;
     endpwent;
     endspent;
+    ether_hostton; ether_ntohost;
 
     # f*
     fgetgrent; fgetgrent_r;
diff --git a/inet/ether_hton.c b/nss/ether_hton.c
similarity index 98%
rename from inet/ether_hton.c
rename to nss/ether_hton.c
index 1b49a57f48..5419464756 100644
--- a/inet/ether_hton.c
+++ b/nss/ether_hton.c
@@ -20,7 +20,7 @@
 #include <netinet/if_ether.h>
 #include <string.h>
 
-#include "../nss/nsswitch.h"
+#include "nsswitch.h"
 
 /* Type of the lookup function we need here.  */
 typedef int (*lookup_function) (const char *, struct etherent *, char *, int,
diff --git a/inet/ether_ntoh.c b/nss/ether_ntoh.c
similarity index 98%
rename from inet/ether_ntoh.c
rename to nss/ether_ntoh.c
index 9f9d7c1a63..2f1eb4ec3d 100644
--- a/inet/ether_ntoh.c
+++ b/nss/ether_ntoh.c
@@ -20,7 +20,7 @@
 #include <netinet/if_ether.h>
 #include <string.h>
 
-#include <nss/nsswitch.h>
+#include <nsswitch.h>
 
 
 /* Type of the lookup function we need here.  */
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 09/16] Move 'hosts' routines from 'inet' into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (7 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 08/16] Move 'ethers' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-19 19:53   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 10/16] Move 'netgroup' " Arjun Shankar
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

The gethostby* and gethostent* routines are entry points for nss
functionality.  This commit moves them from the 'inet' subdirectory to
'nss'.
---
 inet/Makefile                 | 17 -----------------
 inet/Versions                 |  4 +---
 nss/Makefile                  | 24 ++++++++++++++++++++++++
 nss/Versions                  |  2 ++
 {inet => nss}/gethstbyad.c    |  0
 {inet => nss}/gethstbyad_r.c  |  0
 {inet => nss}/gethstbynm.c    |  0
 {inet => nss}/gethstbynm2.c   |  0
 {inet => nss}/gethstbynm2_r.c |  0
 {inet => nss}/gethstbynm_r.c  |  0
 {inet => nss}/gethstent.c     |  0
 {inet => nss}/gethstent_r.c   |  0
 {inet => nss}/tst-gethnm.c    |  0
 13 files changed, 27 insertions(+), 20 deletions(-)
 rename {inet => nss}/gethstbyad.c (100%)
 rename {inet => nss}/gethstbyad_r.c (100%)
 rename {inet => nss}/gethstbynm.c (100%)
 rename {inet => nss}/gethstbynm2.c (100%)
 rename {inet => nss}/gethstbynm2_r.c (100%)
 rename {inet => nss}/gethstbynm_r.c (100%)
 rename {inet => nss}/gethstent.c (100%)
 rename {inet => nss}/gethstent_r.c (100%)
 rename {inet => nss}/tst-gethnm.c (100%)

diff --git a/inet/Makefile b/inet/Makefile
index 4d053de748..d378542549 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -46,14 +46,6 @@ routines := \
   ether_line \
   ether_ntoa \
   ether_ntoa_r \
-  gethstbyad \
-  gethstbyad_r \
-  gethstbynm \
-  gethstbynm2 \
-  gethstbynm2_r \
-  gethstbynm_r \
-  gethstent \
-  gethstent_r \
   getipv4sourcefilter \
   getnameinfo \
   getnetbyad \
@@ -123,7 +115,6 @@ tests := \
   tst-checks-posix \
   tst-ether_aton \
   tst-ether_line \
-  tst-gethnm \
   tst-getni1 \
   tst-getni2 \
   tst-if_index-long \
@@ -154,14 +145,6 @@ include ../gen-locales.mk
 
 ifeq ($(have-thread-library),yes)
 
-CFLAGS-gethstbyad_r.c += -fexceptions
-CFLAGS-gethstbyad.c += -fexceptions
-CFLAGS-gethstbynm_r.c += -fexceptions
-CFLAGS-gethstbynm.c += -fexceptions
-CFLAGS-gethstbynm2_r.c += -fexceptions
-CFLAGS-gethstbynm2.c += -fexceptions
-CFLAGS-gethstent_r.c += -fexceptions
-CFLAGS-gethstent.c += -fexceptions
 CFLAGS-rcmd.c += -fexceptions
 CFLAGS-getnetbynm_r.c += -fexceptions
 CFLAGS-getnetbynm.c += -fexceptions
diff --git a/inet/Versions b/inet/Versions
index a7c1a0fb6f..d937e9835c 100644
--- a/inet/Versions
+++ b/inet/Versions
@@ -14,9 +14,7 @@ libc {
     ether_ntoa_r;
 
     # g*
-    getdomainname; gethostbyaddr; gethostbyaddr_r; gethostbyname;
-    gethostbyname2; gethostbyname2_r; gethostbyname_r; gethostent;
-    gethostent_r; getnetbyaddr; getnetbyaddr_r; getnetbyname;
+    getdomainname; getnetbyaddr; getnetbyaddr_r; getnetbyname;
     getnetbyname_r; getnetent; getnetent_r; getnetgrent; getnetgrent_r;
     getprotobyname; getprotobyname_r; getprotobynumber;
     getprotobynumber_r; getprotoent; getprotoent_r;
diff --git a/nss/Makefile b/nss/Makefile
index 148c6dc1cf..d0b564a033 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -125,6 +125,29 @@ CFLAGS-getsgnam.c += -fexceptions
 CFLAGS-getsgnam_r.c += -fexceptions
 endif
 
+# hosts routines:
+routines += \
+  gethstbyad \
+  gethstbyad_r \
+  gethstbynm \
+  gethstbynm2 \
+  gethstbynm2_r \
+  gethstbynm_r \
+  gethstent \
+  gethstent_r \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-gethstbyad.c += -fexceptions
+CFLAGS-gethstbyad_r.c += -fexceptions
+CFLAGS-gethstbynm.c += -fexceptions
+CFLAGS-gethstbynm_r.c += -fexceptions
+CFLAGS-gethstbynm2.c += -fexceptions
+CFLAGS-gethstbynm2_r.c += -fexceptions
+CFLAGS-gethstent.c += -fexceptions
+CFLAGS-gethstent_r.c += -fexceptions
+endif
+
 # pwd routines:
 routines += \
   fgetpwent \
@@ -210,6 +233,7 @@ tests := \
   test-netdb \
   testgrp \
   tst-fgetsgent_r \
+  tst-gethnm \
   tst-getpw \
   tst-gshadow \
   tst-nss-getpwent \
diff --git a/nss/Versions b/nss/Versions
index 99208cb9df..74ba4470d8 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -21,6 +21,8 @@ libc {
     getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r;
     getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
     getgroups;
+    gethostbyaddr; gethostbyaddr_r; gethostbyname; gethostbyname2;
+    gethostbyname2_r; gethostbyname_r; gethostent; gethostent_r;
     getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
     getspent; getspent_r; getspnam; getspnam_r;
 
diff --git a/inet/gethstbyad.c b/nss/gethstbyad.c
similarity index 100%
rename from inet/gethstbyad.c
rename to nss/gethstbyad.c
diff --git a/inet/gethstbyad_r.c b/nss/gethstbyad_r.c
similarity index 100%
rename from inet/gethstbyad_r.c
rename to nss/gethstbyad_r.c
diff --git a/inet/gethstbynm.c b/nss/gethstbynm.c
similarity index 100%
rename from inet/gethstbynm.c
rename to nss/gethstbynm.c
diff --git a/inet/gethstbynm2.c b/nss/gethstbynm2.c
similarity index 100%
rename from inet/gethstbynm2.c
rename to nss/gethstbynm2.c
diff --git a/inet/gethstbynm2_r.c b/nss/gethstbynm2_r.c
similarity index 100%
rename from inet/gethstbynm2_r.c
rename to nss/gethstbynm2_r.c
diff --git a/inet/gethstbynm_r.c b/nss/gethstbynm_r.c
similarity index 100%
rename from inet/gethstbynm_r.c
rename to nss/gethstbynm_r.c
diff --git a/inet/gethstent.c b/nss/gethstent.c
similarity index 100%
rename from inet/gethstent.c
rename to nss/gethstent.c
diff --git a/inet/gethstent_r.c b/nss/gethstent_r.c
similarity index 100%
rename from inet/gethstent_r.c
rename to nss/gethstent_r.c
diff --git a/inet/tst-gethnm.c b/nss/tst-gethnm.c
similarity index 100%
rename from inet/tst-gethnm.c
rename to nss/tst-gethnm.c
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 10/16] Move 'netgroup' routines from 'inet' into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (8 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 09/16] Move 'hosts' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-20 12:00   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 11/16] Move 'networks' " Arjun Shankar
                   ` (5 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

These netgroup routines are entry points for nss functionality.
This commit moves them along with netgroup.h from the 'inet'
subdirectory to 'nss', and adjusts any references accordingly.
---
 include/netdb.h               |  2 +-
 include/netgroup.h            |  2 +-
 inet/Makefile                 |  4 ----
 inet/Versions                 | 12 ++++--------
 nscd/netgroupcache.c          |  2 +-
 nss/Makefile                  | 11 +++++++++++
 nss/Versions                  |  7 +++++++
 {inet => nss}/getnetgrent.c   |  0
 {inet => nss}/getnetgrent_r.c |  0
 {inet => nss}/netgroup.h      |  0
 10 files changed, 25 insertions(+), 15 deletions(-)
 rename {inet => nss}/getnetgrent.c (100%)
 rename {inet => nss}/getnetgrent_r.c (100%)
 rename {inet => nss}/netgroup.h (100%)

diff --git a/include/netdb.h b/include/netdb.h
index 4dcdbb8cd4..1b25837b4b 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -211,7 +211,7 @@ libanl_hidden_proto (__gai_suspend_time64)
 
 #define AI_DEFAULT    (AI_V4MAPPED | AI_ADDRCONFIG)
 
-#include <inet/netgroup.h>
+#include <nss/netgroup.h>
 
 extern enum nss_status _nss_netgroup_parseline (char **cursor,
 						struct __netgrent *result,
diff --git a/include/netgroup.h b/include/netgroup.h
index 4b2b284cdb..40a5d1a65e 100644
--- a/include/netgroup.h
+++ b/include/netgroup.h
@@ -1 +1 @@
-#include <inet/netgroup.h>
+#include <nss/netgroup.h>
diff --git a/inet/Makefile b/inet/Makefile
index d378542549..9f39f7ff2b 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -54,8 +54,6 @@ routines := \
   getnetbynm_r \
   getnetent \
   getnetent_r \
-  getnetgrent \
-  getnetgrent_r \
   getproto \
   getproto_r \
   getprtent \
@@ -160,8 +158,6 @@ CFLAGS-getprtent_r.c += -fexceptions
 CFLAGS-getprtent.c += -fexceptions
 CFLAGS-either_ntoh.c += -fexceptions
 CFLAGS-either_hton.c += -fexceptions
-CFLAGS-getnetgrent.c += -fexceptions
-CFLAGS-getnetgrent_r.c += -fexceptions
 CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
 CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
 CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
diff --git a/inet/Versions b/inet/Versions
index d937e9835c..1ffa444730 100644
--- a/inet/Versions
+++ b/inet/Versions
@@ -7,7 +7,7 @@ libc {
     rexecoptions;
 
     # e*
-    endaliasent; endhostent; endnetent; endnetgrent; endprotoent; endservent;
+    endaliasent; endhostent; endnetent; endprotoent; endservent;
 
     # e*
     ether_aton; ether_aton_r; ether_line; ether_ntoa;
@@ -15,7 +15,7 @@ libc {
 
     # g*
     getdomainname; getnetbyaddr; getnetbyaddr_r; getnetbyname;
-    getnetbyname_r; getnetent; getnetent_r; getnetgrent; getnetgrent_r;
+    getnetbyname_r; getnetent; getnetent_r;
     getprotobyname; getprotobyname_r; getprotobynumber;
     getprotobynumber_r; getprotoent; getprotoent_r;
     getservbyname; getservbyname_r; getservbyport;
@@ -36,7 +36,7 @@ libc {
     rcmd; rexec; rresvport; ruserok; ruserpass;
 
     # s*
-    setaliasent; setnetent; setnetgrent; setprotoent; setservent;
+    setaliasent; setnetent; setprotoent; setservent;
   }
   GLIBC_2.1 {
     # variables in normal name space
@@ -49,7 +49,7 @@ libc {
     # g*
     getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r;
     gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r;
-    getnetent_r; getnetgrent_r; getprotobyname_r; getprotobynumber_r;
+    getnetent_r; getprotobyname_r; getprotobynumber_r;
     getprotoent_r; getservbyname_r;
     getservbyport_r;
     getservent_r;
@@ -81,10 +81,6 @@ libc {
     inet6_rth_segments; inet6_rth_getaddr;
   }
   GLIBC_PRIVATE {
-    # functions used in other libraries
-    __internal_endnetgrent; __internal_getnetgrent_r;
-    __internal_setnetgrent;
-
     # Used from nscd.
     __inet6_scopeid_pton;
     __idna_to_dns_encoding;
diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
index 06b7d7b6ca..b9174a138c 100644
--- a/nscd/netgroupcache.c
+++ b/nscd/netgroupcache.c
@@ -24,7 +24,7 @@
 #include <unistd.h>
 #include <sys/mman.h>
 
-#include "../inet/netgroup.h"
+#include "../nss/netgroup.h"
 #include "nscd.h"
 #include "dbg_log.h"
 
diff --git a/nss/Makefile b/nss/Makefile
index d0b564a033..2a451f68d9 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -148,6 +148,17 @@ CFLAGS-gethstent.c += -fexceptions
 CFLAGS-gethstent_r.c += -fexceptions
 endif
 
+# netgroup routines:
+routines += \
+  getnetgrent \
+  getnetgrent_r \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-getnetgrent.c += -fexceptions
+CFLAGS-getnetgrent_r.c += -fexceptions
+endif
+
 # pwd routines:
 routines += \
   fgetpwent \
diff --git a/nss/Versions b/nss/Versions
index 74ba4470d8..4ddc018012 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -8,6 +8,7 @@ libc {
 
     # e*
     endgrent;
+    endnetgrent;
     endpwent;
     endspent;
     ether_hostton; ether_ntohost;
@@ -23,6 +24,7 @@ libc {
     getgroups;
     gethostbyaddr; gethostbyaddr_r; gethostbyname; gethostbyname2;
     gethostbyname2_r; gethostbyname_r; gethostent; gethostent_r;
+    getnetgrent; getnetgrent_r;
     getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
     getspent; getspent_r; getspnam; getspnam_r;
 
@@ -38,6 +40,7 @@ libc {
 
     # s*
     setgrent;
+    setnetgrent;
     setpwent;
     setspent;
     sgetspent; sgetspent_r;
@@ -52,6 +55,7 @@ libc {
   GLIBC_2.1.2 {
     # g*
     getgrent_r; getgrgid_r; getgrnam_r;
+    getnetgrent_r;
     getpwent_r; getpwuid_r; getpwnam_r;
     getspent_r; getspnam_r;
   }
@@ -181,6 +185,9 @@ libc {
     _nss_files_init;
 
     __merge_grp; __copy_grp;
+
+    __internal_endnetgrent; __internal_getnetgrent_r;
+    __internal_setnetgrent;
   }
 }
 
diff --git a/inet/getnetgrent.c b/nss/getnetgrent.c
similarity index 100%
rename from inet/getnetgrent.c
rename to nss/getnetgrent.c
diff --git a/inet/getnetgrent_r.c b/nss/getnetgrent_r.c
similarity index 100%
rename from inet/getnetgrent_r.c
rename to nss/getnetgrent_r.c
diff --git a/inet/netgroup.h b/nss/netgroup.h
similarity index 100%
rename from inet/netgroup.h
rename to nss/netgroup.h
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 11/16] Move 'networks' routines from 'inet' into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (9 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 10/16] Move 'netgroup' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-20 12:17   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 12/16] Move 'protocols' " Arjun Shankar
                   ` (4 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

The getnetby* and getnetent* routines are entry points for nss
functionality.  This commit moves them from the 'inet' subdirectory to
'nss'.
---
 inet/Makefile                | 12 ------------
 inet/Versions                |  3 +--
 nss/Makefile                 | 19 +++++++++++++++++++
 nss/Versions                 |  2 ++
 {inet => nss}/getnetbyad.c   |  0
 {inet => nss}/getnetbyad_r.c |  0
 {inet => nss}/getnetbynm.c   |  0
 {inet => nss}/getnetbynm_r.c |  0
 {inet => nss}/getnetent.c    |  0
 {inet => nss}/getnetent_r.c  |  0
 10 files changed, 22 insertions(+), 14 deletions(-)
 rename {inet => nss}/getnetbyad.c (100%)
 rename {inet => nss}/getnetbyad_r.c (100%)
 rename {inet => nss}/getnetbynm.c (100%)
 rename {inet => nss}/getnetbynm_r.c (100%)
 rename {inet => nss}/getnetent.c (100%)
 rename {inet => nss}/getnetent_r.c (100%)

diff --git a/inet/Makefile b/inet/Makefile
index 9f39f7ff2b..776cbfa0fd 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -48,12 +48,6 @@ routines := \
   ether_ntoa_r \
   getipv4sourcefilter \
   getnameinfo \
-  getnetbyad \
-  getnetbyad_r \
-  getnetbynm \
-  getnetbynm_r \
-  getnetent \
-  getnetent_r \
   getproto \
   getproto_r \
   getprtent \
@@ -144,12 +138,6 @@ include ../gen-locales.mk
 ifeq ($(have-thread-library),yes)
 
 CFLAGS-rcmd.c += -fexceptions
-CFLAGS-getnetbynm_r.c += -fexceptions
-CFLAGS-getnetbynm.c += -fexceptions
-CFLAGS-getnetbyad_r.c += -fexceptions
-CFLAGS-getnetbyad.c += -fexceptions
-CFLAGS-getnetent_r.c += -fexceptions
-CFLAGS-getnetent.c += -fexceptions
 CFLAGS-getrpcent_r.c += -fexceptions
 CFLAGS-getrpcent.c += -fexceptions
 CFLAGS-getservent_r.c += -fexceptions
diff --git a/inet/Versions b/inet/Versions
index 1ffa444730..051b305e48 100644
--- a/inet/Versions
+++ b/inet/Versions
@@ -14,8 +14,7 @@ libc {
     ether_ntoa_r;
 
     # g*
-    getdomainname; getnetbyaddr; getnetbyaddr_r; getnetbyname;
-    getnetbyname_r; getnetent; getnetent_r;
+    getdomainname;
     getprotobyname; getprotobyname_r; getprotobynumber;
     getprotobynumber_r; getprotoent; getprotoent_r;
     getservbyname; getservbyname_r; getservbyport;
diff --git a/nss/Makefile b/nss/Makefile
index 2a451f68d9..023a11fa4b 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -159,6 +159,25 @@ CFLAGS-getnetgrent.c += -fexceptions
 CFLAGS-getnetgrent_r.c += -fexceptions
 endif
 
+# networks routines:
+routines += \
+  getnetbyad \
+  getnetbyad_r \
+  getnetbynm \
+  getnetbynm_r \
+  getnetent \
+  getnetent_r \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-getnetbyad.c += -fexceptions
+CFLAGS-getnetbyad_r.c += -fexceptions
+CFLAGS-getnetbynm.c += -fexceptions
+CFLAGS-getnetbynm_r.c += -fexceptions
+CFLAGS-getnetent.c += -fexceptions
+CFLAGS-getnetent_r.c += -fexceptions
+endif
+
 # pwd routines:
 routines += \
   fgetpwent \
diff --git a/nss/Versions b/nss/Versions
index 4ddc018012..95219f0fc7 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -25,6 +25,8 @@ libc {
     gethostbyaddr; gethostbyaddr_r; gethostbyname; gethostbyname2;
     gethostbyname2_r; gethostbyname_r; gethostent; gethostent_r;
     getnetgrent; getnetgrent_r;
+    getnetbyaddr; getnetbyaddr_r; getnetbyname; getnetbyname_r;
+    getnetent; getnetent_r;
     getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
     getspent; getspent_r; getspnam; getspnam_r;
 
diff --git a/inet/getnetbyad.c b/nss/getnetbyad.c
similarity index 100%
rename from inet/getnetbyad.c
rename to nss/getnetbyad.c
diff --git a/inet/getnetbyad_r.c b/nss/getnetbyad_r.c
similarity index 100%
rename from inet/getnetbyad_r.c
rename to nss/getnetbyad_r.c
diff --git a/inet/getnetbynm.c b/nss/getnetbynm.c
similarity index 100%
rename from inet/getnetbynm.c
rename to nss/getnetbynm.c
diff --git a/inet/getnetbynm_r.c b/nss/getnetbynm_r.c
similarity index 100%
rename from inet/getnetbynm_r.c
rename to nss/getnetbynm_r.c
diff --git a/inet/getnetent.c b/nss/getnetent.c
similarity index 100%
rename from inet/getnetent.c
rename to nss/getnetent.c
diff --git a/inet/getnetent_r.c b/nss/getnetent_r.c
similarity index 100%
rename from inet/getnetent_r.c
rename to nss/getnetent_r.c
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 12/16] Move 'protocols' routines from 'inet' into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (10 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 11/16] Move 'networks' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-20 12:32   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 13/16] Move 'rpc' " Arjun Shankar
                   ` (3 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

The getprotoby* and getprotoent* routines are entry points for nss
functionality.  This commit moves them from the 'inet' subdirectory to
'nss'.
---
 inet/Makefile                |  8 --------
 inet/Versions                |  5 +----
 nss/Makefile                 | 15 +++++++++++++++
 nss/Versions                 |  3 +++
 {inet => nss}/getproto.c     |  0
 {inet => nss}/getproto_r.c   |  0
 {inet => nss}/getprtent.c    |  0
 {inet => nss}/getprtent_r.c  |  0
 {inet => nss}/getprtname.c   |  0
 {inet => nss}/getprtname_r.c |  0
 10 files changed, 19 insertions(+), 12 deletions(-)
 rename {inet => nss}/getproto.c (100%)
 rename {inet => nss}/getproto_r.c (100%)
 rename {inet => nss}/getprtent.c (100%)
 rename {inet => nss}/getprtent_r.c (100%)
 rename {inet => nss}/getprtname.c (100%)
 rename {inet => nss}/getprtname_r.c (100%)

diff --git a/inet/Makefile b/inet/Makefile
index 776cbfa0fd..dab7182a11 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -48,12 +48,6 @@ routines := \
   ether_ntoa_r \
   getipv4sourcefilter \
   getnameinfo \
-  getproto \
-  getproto_r \
-  getprtent \
-  getprtent_r \
-  getprtname \
-  getprtname_r \
   getrpcbyname \
   getrpcbyname_r \
   getrpcbynumber \
@@ -142,8 +136,6 @@ CFLAGS-getrpcent_r.c += -fexceptions
 CFLAGS-getrpcent.c += -fexceptions
 CFLAGS-getservent_r.c += -fexceptions
 CFLAGS-getservent.c += -fexceptions
-CFLAGS-getprtent_r.c += -fexceptions
-CFLAGS-getprtent.c += -fexceptions
 CFLAGS-either_ntoh.c += -fexceptions
 CFLAGS-either_hton.c += -fexceptions
 CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
diff --git a/inet/Versions b/inet/Versions
index 051b305e48..c0c64e1543 100644
--- a/inet/Versions
+++ b/inet/Versions
@@ -15,8 +15,6 @@ libc {
 
     # g*
     getdomainname;
-    getprotobyname; getprotobyname_r; getprotobynumber;
-    getprotobynumber_r; getprotoent; getprotoent_r;
     getservbyname; getservbyname_r; getservbyport;
     getservbyport_r; getservent; getservent_r;
 
@@ -48,8 +46,7 @@ libc {
     # g*
     getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r;
     gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r;
-    getnetent_r; getprotobyname_r; getprotobynumber_r;
-    getprotoent_r; getservbyname_r;
+    getnetent_r; getservbyname_r;
     getservbyport_r;
     getservent_r;
   }
diff --git a/nss/Makefile b/nss/Makefile
index 023a11fa4b..df22d3655c 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -178,6 +178,21 @@ CFLAGS-getnetent.c += -fexceptions
 CFLAGS-getnetent_r.c += -fexceptions
 endif
 
+# protocols routines:
+routines += \
+  getproto \
+  getproto_r \
+  getprtent \
+  getprtent_r \
+  getprtname \
+  getprtname_r \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-getprtent_r.c += -fexceptions
+CFLAGS-getprtent.c += -fexceptions
+endif
+
 # pwd routines:
 routines += \
   fgetpwent \
diff --git a/nss/Versions b/nss/Versions
index 95219f0fc7..c5de97fb53 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -27,6 +27,8 @@ libc {
     getnetgrent; getnetgrent_r;
     getnetbyaddr; getnetbyaddr_r; getnetbyname; getnetbyname_r;
     getnetent; getnetent_r;
+    getprotobyname; getprotobyname_r; getprotobynumber;
+    getprotobynumber_r; getprotoent; getprotoent_r;
     getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
     getspent; getspent_r; getspnam; getspnam_r;
 
@@ -58,6 +60,7 @@ libc {
     # g*
     getgrent_r; getgrgid_r; getgrnam_r;
     getnetgrent_r;
+    getprotobyname_r; getprotobynumber_r; getprotoent_r;
     getpwent_r; getpwuid_r; getpwnam_r;
     getspent_r; getspnam_r;
   }
diff --git a/inet/getproto.c b/nss/getproto.c
similarity index 100%
rename from inet/getproto.c
rename to nss/getproto.c
diff --git a/inet/getproto_r.c b/nss/getproto_r.c
similarity index 100%
rename from inet/getproto_r.c
rename to nss/getproto_r.c
diff --git a/inet/getprtent.c b/nss/getprtent.c
similarity index 100%
rename from inet/getprtent.c
rename to nss/getprtent.c
diff --git a/inet/getprtent_r.c b/nss/getprtent_r.c
similarity index 100%
rename from inet/getprtent_r.c
rename to nss/getprtent_r.c
diff --git a/inet/getprtname.c b/nss/getprtname.c
similarity index 100%
rename from inet/getprtname.c
rename to nss/getprtname.c
diff --git a/inet/getprtname_r.c b/nss/getprtname_r.c
similarity index 100%
rename from inet/getprtname_r.c
rename to nss/getprtname_r.c
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 13/16] Move 'rpc' routines from 'inet' into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (11 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 12/16] Move 'protocols' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-20 12:49   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 14/16] Move 'services' " Arjun Shankar
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

The getrpcby* and getrpcent* routines are entry points for nss
functionality.  This commit moves them from the 'inet' subdirectory to
'nss'.  The Versions entries for these routines along with a test,
located in the 'sunrpc' subdirectory, are also moved into 'nss'.
---
 inet/Makefile                    |  8 --------
 nss/Makefile                     | 16 ++++++++++++++++
 nss/Versions                     |  2 ++
 {inet => nss}/getrpcbyname.c     |  0
 {inet => nss}/getrpcbyname_r.c   |  0
 {inet => nss}/getrpcbynumber.c   |  0
 {inet => nss}/getrpcbynumber_r.c |  0
 {inet => nss}/getrpcent.c        |  0
 {inet => nss}/getrpcent_r.c      |  0
 {sunrpc => nss}/test-rpcent.c    |  0
 sunrpc/Makefile                  |  2 +-
 sunrpc/Versions                  |  3 +--
 12 files changed, 20 insertions(+), 11 deletions(-)
 rename {inet => nss}/getrpcbyname.c (100%)
 rename {inet => nss}/getrpcbyname_r.c (100%)
 rename {inet => nss}/getrpcbynumber.c (100%)
 rename {inet => nss}/getrpcbynumber_r.c (100%)
 rename {inet => nss}/getrpcent.c (100%)
 rename {inet => nss}/getrpcent_r.c (100%)
 rename {sunrpc => nss}/test-rpcent.c (100%)

diff --git a/inet/Makefile b/inet/Makefile
index dab7182a11..3c1987877a 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -48,12 +48,6 @@ routines := \
   ether_ntoa_r \
   getipv4sourcefilter \
   getnameinfo \
-  getrpcbyname \
-  getrpcbyname_r \
-  getrpcbynumber \
-  getrpcbynumber_r \
-  getrpcent \
-  getrpcent_r \
   getservent \
   getservent_r \
   getsourcefilter \
@@ -132,8 +126,6 @@ include ../gen-locales.mk
 ifeq ($(have-thread-library),yes)
 
 CFLAGS-rcmd.c += -fexceptions
-CFLAGS-getrpcent_r.c += -fexceptions
-CFLAGS-getrpcent.c += -fexceptions
 CFLAGS-getservent_r.c += -fexceptions
 CFLAGS-getservent.c += -fexceptions
 CFLAGS-either_ntoh.c += -fexceptions
diff --git a/nss/Makefile b/nss/Makefile
index df22d3655c..cbfd5dc692 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -214,6 +214,21 @@ CFLAGS-getpwent.c += -fexceptions
 CFLAGS-getpwent_r.c += -fexceptions
 endif
 
+# rpc routines:
+routines += \
+  getrpcbyname \
+  getrpcbyname_r \
+  getrpcbynumber \
+  getrpcbynumber_r \
+  getrpcent \
+  getrpcent_r \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-getrpcent_r.c += -fexceptions
+CFLAGS-getrpcent.c += -fexceptions
+endif
+
 # shadow routines
 routines += \
   fgetspent \
@@ -276,6 +291,7 @@ tests := \
   bug17079 \
   test-digits-dots \
   test-netdb \
+  test-rpcent \
   testgrp \
   tst-fgetsgent_r \
   tst-gethnm \
diff --git a/nss/Versions b/nss/Versions
index c5de97fb53..b7491154bf 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -30,6 +30,8 @@ libc {
     getprotobyname; getprotobyname_r; getprotobynumber;
     getprotobynumber_r; getprotoent; getprotoent_r;
     getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
+    getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r;
+    getrpcent; getrpcent_r;
     getspent; getspent_r; getspnam; getspnam_r;
 
     # i*
diff --git a/inet/getrpcbyname.c b/nss/getrpcbyname.c
similarity index 100%
rename from inet/getrpcbyname.c
rename to nss/getrpcbyname.c
diff --git a/inet/getrpcbyname_r.c b/nss/getrpcbyname_r.c
similarity index 100%
rename from inet/getrpcbyname_r.c
rename to nss/getrpcbyname_r.c
diff --git a/inet/getrpcbynumber.c b/nss/getrpcbynumber.c
similarity index 100%
rename from inet/getrpcbynumber.c
rename to nss/getrpcbynumber.c
diff --git a/inet/getrpcbynumber_r.c b/nss/getrpcbynumber_r.c
similarity index 100%
rename from inet/getrpcbynumber_r.c
rename to nss/getrpcbynumber_r.c
diff --git a/inet/getrpcent.c b/nss/getrpcent.c
similarity index 100%
rename from inet/getrpcent.c
rename to nss/getrpcent.c
diff --git a/inet/getrpcent_r.c b/nss/getrpcent_r.c
similarity index 100%
rename from inet/getrpcent_r.c
rename to nss/getrpcent_r.c
diff --git a/sunrpc/test-rpcent.c b/nss/test-rpcent.c
similarity index 100%
rename from sunrpc/test-rpcent.c
rename to nss/test-rpcent.c
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index ec2ea04ca9..83a0f2d099 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -64,7 +64,7 @@ routines := auth_none authuxprot clnt_raw clnt_simp \
 shared-only-routines = $(routines)
 endif
 
-tests = tst-xdrmem tst-xdrmem2 test-rpcent tst-udp-error tst-udp-timeout \
+tests = tst-xdrmem tst-xdrmem2 tst-udp-error tst-udp-timeout \
   tst-udp-nonblocking tst-bug22542 tst-bug28768
 
 xtests := tst-getmyaddr
diff --git a/sunrpc/Versions b/sunrpc/Versions
index 77bc6a4c9b..cba6e36422 100644
--- a/sunrpc/Versions
+++ b/sunrpc/Versions
@@ -26,8 +26,7 @@ libc {
 
     # g*
     get_myaddress; getpublickey; getsecretkey;
-    getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r;
-    getrpcent; getrpcent_r; getrpcport;
+    getrpcport;
 
     # p*
     pmap_getmaps; pmap_getport; pmap_rmtcall; pmap_set; pmap_unset;
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 14/16] Move 'services' routines from 'inet' into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (12 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 13/16] Move 'rpc' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-20 13:19   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 15/16] Move getaddrinfo from 'posix' " Arjun Shankar
  2023-10-02 12:55 ` [PATCH 16/16] Move getnameinfo from 'inet' to 'nss' Arjun Shankar
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

The getservby* and getservent* routines are entry points for nss
functionality.  This commit moves them from the 'inet' subdirectory to
'nss'.
---
 inet/Makefile                |  8 --------
 inet/Versions                |  6 +-----
 nss/Makefile                 | 15 +++++++++++++++
 nss/Versions                 |  3 +++
 {inet => nss}/getservent.c   |  0
 {inet => nss}/getservent_r.c |  0
 {inet => nss}/getsrvbynm.c   |  0
 {inet => nss}/getsrvbynm_r.c |  0
 {inet => nss}/getsrvbypt.c   |  0
 {inet => nss}/getsrvbypt_r.c |  0
 10 files changed, 19 insertions(+), 13 deletions(-)
 rename {inet => nss}/getservent.c (100%)
 rename {inet => nss}/getservent_r.c (100%)
 rename {inet => nss}/getsrvbynm.c (100%)
 rename {inet => nss}/getsrvbynm_r.c (100%)
 rename {inet => nss}/getsrvbypt.c (100%)
 rename {inet => nss}/getsrvbypt_r.c (100%)

diff --git a/inet/Makefile b/inet/Makefile
index 3c1987877a..d275f51b3f 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -48,13 +48,7 @@ routines := \
   ether_ntoa_r \
   getipv4sourcefilter \
   getnameinfo \
-  getservent \
-  getservent_r \
   getsourcefilter \
-  getsrvbynm \
-  getsrvbynm_r \
-  getsrvbypt \
-  getsrvbypt_r \
   herrno \
   herrno-loc \
   htonl \
@@ -126,8 +120,6 @@ include ../gen-locales.mk
 ifeq ($(have-thread-library),yes)
 
 CFLAGS-rcmd.c += -fexceptions
-CFLAGS-getservent_r.c += -fexceptions
-CFLAGS-getservent.c += -fexceptions
 CFLAGS-either_ntoh.c += -fexceptions
 CFLAGS-either_hton.c += -fexceptions
 CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
diff --git a/inet/Versions b/inet/Versions
index c0c64e1543..7765cb7722 100644
--- a/inet/Versions
+++ b/inet/Versions
@@ -15,8 +15,6 @@ libc {
 
     # g*
     getdomainname;
-    getservbyname; getservbyname_r; getservbyport;
-    getservbyport_r; getservent; getservent_r;
 
     # h*
     htonl; htons;
@@ -46,9 +44,7 @@ libc {
     # g*
     getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r;
     gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r;
-    getnetent_r; getservbyname_r;
-    getservbyport_r;
-    getservent_r;
+    getnetent_r;
   }
   GLIBC_2.2 {
     # i*
diff --git a/nss/Makefile b/nss/Makefile
index cbfd5dc692..e88754bf51 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -229,6 +229,21 @@ CFLAGS-getrpcent_r.c += -fexceptions
 CFLAGS-getrpcent.c += -fexceptions
 endif
 
+# services routines:
+routines += \
+  getservent \
+  getservent_r \
+  getsrvbynm \
+  getsrvbynm_r \
+  getsrvbypt \
+  getsrvbypt_r \
+  # routines
+
+ifeq ($(have-thread-library),yes)
+CFLAGS-getservent_r.c += -fexceptions
+CFLAGS-getservent.c += -fexceptions
+endif
+
 # shadow routines
 routines += \
   fgetspent \
diff --git a/nss/Versions b/nss/Versions
index b7491154bf..d8c4e373c9 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -32,6 +32,8 @@ libc {
     getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
     getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r;
     getrpcent; getrpcent_r;
+    getservbyname; getservbyname_r; getservbyport;
+    getservbyport_r; getservent; getservent_r;
     getspent; getspent_r; getspnam; getspnam_r;
 
     # i*
@@ -64,6 +66,7 @@ libc {
     getnetgrent_r;
     getprotobyname_r; getprotobynumber_r; getprotoent_r;
     getpwent_r; getpwuid_r; getpwnam_r;
+    getservbyname_r; getservbyport_r; getservent_r;
     getspent_r; getspnam_r;
   }
   GLIBC_2.2.2 {
diff --git a/inet/getservent.c b/nss/getservent.c
similarity index 100%
rename from inet/getservent.c
rename to nss/getservent.c
diff --git a/inet/getservent_r.c b/nss/getservent_r.c
similarity index 100%
rename from inet/getservent_r.c
rename to nss/getservent_r.c
diff --git a/inet/getsrvbynm.c b/nss/getsrvbynm.c
similarity index 100%
rename from inet/getsrvbynm.c
rename to nss/getsrvbynm.c
diff --git a/inet/getsrvbynm_r.c b/nss/getsrvbynm_r.c
similarity index 100%
rename from inet/getsrvbynm_r.c
rename to nss/getsrvbynm_r.c
diff --git a/inet/getsrvbypt.c b/nss/getsrvbypt.c
similarity index 100%
rename from inet/getsrvbypt.c
rename to nss/getsrvbypt.c
diff --git a/inet/getsrvbypt_r.c b/nss/getsrvbypt_r.c
similarity index 100%
rename from inet/getsrvbypt_r.c
rename to nss/getsrvbypt_r.c
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 15/16] Move getaddrinfo from 'posix' into 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (13 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 14/16] Move 'services' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-20 13:51   ` Adhemerval Zanella Netto
  2023-10-02 12:55 ` [PATCH 16/16] Move getnameinfo from 'inet' to 'nss' Arjun Shankar
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

getaddrinfo is an entry point for nss functionality.  This commit moves
it from 'sysdeps/posix' to 'nss', gets rid of the stub in 'posix', and
moves all associated tests as well.
---
 nss/Makefile                         | 19 ++++++++++++--
 nss/Versions                         |  1 +
 {sysdeps/posix => nss}/getaddrinfo.c |  0
 {posix => nss}/tst-getaddrinfo.c     |  0
 {posix => nss}/tst-getaddrinfo2.c    |  0
 {posix => nss}/tst-getaddrinfo3.c    |  0
 {posix => nss}/tst-getaddrinfo4.c    |  0
 {posix => nss}/tst-getaddrinfo5.c    |  0
 {posix => nss}/tst-rfc3484-2.c       |  2 +-
 {posix => nss}/tst-rfc3484-3.c       |  2 +-
 {posix => nss}/tst-rfc3484.c         |  2 +-
 posix/Makefile                       | 10 --------
 posix/Versions                       |  2 +-
 posix/getaddrinfo.c                  | 38 ----------------------------
 14 files changed, 22 insertions(+), 54 deletions(-)
 rename {sysdeps/posix => nss}/getaddrinfo.c (100%)
 rename {posix => nss}/tst-getaddrinfo.c (100%)
 rename {posix => nss}/tst-getaddrinfo2.c (100%)
 rename {posix => nss}/tst-getaddrinfo3.c (100%)
 rename {posix => nss}/tst-getaddrinfo4.c (100%)
 rename {posix => nss}/tst-getaddrinfo5.c (100%)
 rename {posix => nss}/tst-rfc3484-2.c (99%)
 rename {posix => nss}/tst-rfc3484-3.c (98%)
 rename {posix => nss}/tst-rfc3484.c (98%)
 delete mode 100644 posix/getaddrinfo.c

diff --git a/nss/Makefile b/nss/Makefile
index e88754bf51..da5bd207aa 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -127,6 +127,7 @@ endif
 
 # hosts routines:
 routines += \
+  getaddrinfo \
   gethstbyad \
   gethstbyad_r \
   gethstbynm \
@@ -138,6 +139,7 @@ routines += \
   # routines
 
 ifeq ($(have-thread-library),yes)
+CFLAGS-getaddrinfo.c += -fexceptions
 CFLAGS-gethstbyad.c += -fexceptions
 CFLAGS-gethstbyad_r.c += -fexceptions
 CFLAGS-gethstbynm.c += -fexceptions
@@ -300,7 +302,13 @@ others-extras		= $(makedb-modules)
 extra-objs		+= $(makedb-modules:=.o)
 
 tests-static            = tst-field
-tests-internal		= tst-field
+
+tests-internal := \
+  tst-field \
+  tst-rfc3484 \
+  tst-rfc3484-2 \
+  tst-rfc3484-3 \
+  # tests-internal
 
 tests := \
   bug17079 \
@@ -309,6 +317,9 @@ tests := \
   test-rpcent \
   testgrp \
   tst-fgetsgent_r \
+  tst-getaddrinfo \
+  tst-getaddrinfo2 \
+  tst-getaddrinfo3 \
   tst-gethnm \
   tst-getpw \
   tst-gshadow \
@@ -327,7 +338,11 @@ tests := \
   tst-shadow \
   # tests
 
-xtests = bug-erange
+xtests := \
+  bug-erange \
+  tst-getaddrinfo4 \
+  tst-getaddrinfo5 \
+  # xtests
 
 tests-container := \
   tst-initgroups1 \
diff --git a/nss/Versions b/nss/Versions
index d8c4e373c9..158a9175a4 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -19,6 +19,7 @@ libc {
     fgetspent; fgetspent_r;
 
     # g*
+    getaddrinfo;
     getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r;
     getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
     getgroups;
diff --git a/sysdeps/posix/getaddrinfo.c b/nss/getaddrinfo.c
similarity index 100%
rename from sysdeps/posix/getaddrinfo.c
rename to nss/getaddrinfo.c
diff --git a/posix/tst-getaddrinfo.c b/nss/tst-getaddrinfo.c
similarity index 100%
rename from posix/tst-getaddrinfo.c
rename to nss/tst-getaddrinfo.c
diff --git a/posix/tst-getaddrinfo2.c b/nss/tst-getaddrinfo2.c
similarity index 100%
rename from posix/tst-getaddrinfo2.c
rename to nss/tst-getaddrinfo2.c
diff --git a/posix/tst-getaddrinfo3.c b/nss/tst-getaddrinfo3.c
similarity index 100%
rename from posix/tst-getaddrinfo3.c
rename to nss/tst-getaddrinfo3.c
diff --git a/posix/tst-getaddrinfo4.c b/nss/tst-getaddrinfo4.c
similarity index 100%
rename from posix/tst-getaddrinfo4.c
rename to nss/tst-getaddrinfo4.c
diff --git a/posix/tst-getaddrinfo5.c b/nss/tst-getaddrinfo5.c
similarity index 100%
rename from posix/tst-getaddrinfo5.c
rename to nss/tst-getaddrinfo5.c
diff --git a/posix/tst-rfc3484-2.c b/nss/tst-rfc3484-2.c
similarity index 99%
rename from posix/tst-rfc3484-2.c
rename to nss/tst-rfc3484-2.c
index ce8ccd5f38..a5f8f82c04 100644
--- a/posix/tst-rfc3484-2.c
+++ b/nss/tst-rfc3484-2.c
@@ -57,7 +57,7 @@ _res_hconf_init (void)
 }
 
 #undef	USE_NSCD
-#include "../sysdeps/posix/getaddrinfo.c"
+#include "getaddrinfo.c"
 
 nss_action_list __nss_hosts_database attribute_hidden;
 
diff --git a/posix/tst-rfc3484-3.c b/nss/tst-rfc3484-3.c
similarity index 98%
rename from posix/tst-rfc3484-3.c
rename to nss/tst-rfc3484-3.c
index ecb163963f..edf0b7db2e 100644
--- a/posix/tst-rfc3484-3.c
+++ b/nss/tst-rfc3484-3.c
@@ -57,7 +57,7 @@ _res_hconf_init (void)
 }
 
 #undef	USE_NSCD
-#include "../sysdeps/posix/getaddrinfo.c"
+#include "getaddrinfo.c"
 
 nss_action_list __nss_hosts_database attribute_hidden;
 
diff --git a/posix/tst-rfc3484.c b/nss/tst-rfc3484.c
similarity index 98%
rename from posix/tst-rfc3484.c
rename to nss/tst-rfc3484.c
index 3b2052eb54..5b4a0c5b82 100644
--- a/posix/tst-rfc3484.c
+++ b/nss/tst-rfc3484.c
@@ -57,7 +57,7 @@ _res_hconf_init (void)
 }
 
 #undef	USE_NSCD
-#include "../sysdeps/posix/getaddrinfo.c"
+#include "getaddrinfo.c"
 
 nss_action_list __nss_hosts_database attribute_hidden;
 
diff --git a/posix/Makefile b/posix/Makefile
index be7d319394..3ab124d040 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -88,7 +88,6 @@ routines := \
   fpathconf \
   gai_strerror \
   get_child_max \
-  getaddrinfo \
   getegid \
   geteuid \
   getgid \
@@ -287,9 +286,6 @@ tests := \
   tst-fnmatch7 \
   tst-fork \
   tst-gai_strerror \
-  tst-getaddrinfo \
-  tst-getaddrinfo2 \
-  tst-getaddrinfo3 \
   tst-getopt_long1 \
   tst-glob-tilde \
   tst-glob_symlinks \
@@ -351,9 +347,6 @@ tests-internal := \
   bug-regex5 \
   bug-regex20 \
   bug-regex33 \
-  tst-rfc3484 \
-  tst-rfc3484-2 \
-  tst-rfc3484-3 \
   # tests-internal
 
 tests-container := \
@@ -368,8 +361,6 @@ tests-time64 := \
   # tests-time64
 
 xtests	:= \
-  tst-getaddrinfo4 \
-  tst-getaddrinfo5 \
   tst-sched_rr_get_interval \
   # xtests
 
@@ -556,7 +547,6 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
 	   '$(config-machine)-$(config-vendor)' > $@.new
 	mv -f $@.new $@
 
-CFLAGS-getaddrinfo.c += -fexceptions
 CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
 CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
 CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
diff --git a/posix/Versions b/posix/Versions
index 2eedbc3e79..b24c7c87ff 100644
--- a/posix/Versions
+++ b/posix/Versions
@@ -34,7 +34,7 @@ libc {
     fnmatch; fork; fpathconf; freeaddrinfo;
 
     # g*
-    getaddrinfo; getdtablesize; getegid; geteuid; getgid; getopt; getopt_long;
+    getdtablesize; getegid; geteuid; getgid; getopt; getopt_long;
     getopt_long_only; getpgid; getpgrp; getpid; getppid; getsid; getuid; glob;
     glob_pattern_p; globfree; group_member;
 
diff --git a/posix/getaddrinfo.c b/posix/getaddrinfo.c
deleted file mode 100644
index 0e36a4564c..0000000000
--- a/posix/getaddrinfo.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Stub version of getaddrinfo function.
-   Copyright (C) 1996-2023 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <errno.h>
-#include <netdb.h>
-
-int
-getaddrinfo (const char *name, const char *service, const struct addrinfo *req,
-	     struct addrinfo **pai)
-{
-  __set_errno (ENOSYS);
-  return EAI_SYSTEM;
-}
-stub_warning (getaddrinfo)
-libc_hidden_def (getaddrinfo)
-
-void
-freeaddrinfo (struct addrinfo *ai)
-{
-  /* Nothing.  */
-}
-stub_warning (freeaddrinfo)
-libc_hidden_def (freeaddrinfo)
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH 16/16] Move getnameinfo from 'inet' to 'nss'
  2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
                   ` (14 preceding siblings ...)
  2023-10-02 12:55 ` [PATCH 15/16] Move getaddrinfo from 'posix' " Arjun Shankar
@ 2023-10-02 12:55 ` Arjun Shankar
  2023-10-20 15:08   ` Adhemerval Zanella Netto
  15 siblings, 1 reply; 35+ messages in thread
From: Arjun Shankar @ 2023-10-02 12:55 UTC (permalink / raw)
  To: libc-alpha, Arjun Shankar

getnameinfo is an entry points for nss functionality.  This commit moves
it from the 'inet' subdirectory to 'nss'.  The corresponding Versions
entry is also moved from 'posix' into 'nss'.
---
 inet/Makefile               | 1 -
 nss/Makefile                | 1 +
 nss/Versions                | 3 +++
 {inet => nss}/getnameinfo.c | 2 +-
 posix/Versions              | 2 +-
 5 files changed, 6 insertions(+), 3 deletions(-)
 rename {inet => nss}/getnameinfo.c (99%)

diff --git a/inet/Makefile b/inet/Makefile
index d275f51b3f..b691fef921 100644
--- a/inet/Makefile
+++ b/inet/Makefile
@@ -47,7 +47,6 @@ routines := \
   ether_ntoa \
   ether_ntoa_r \
   getipv4sourcefilter \
-  getnameinfo \
   getsourcefilter \
   herrno \
   herrno-loc \
diff --git a/nss/Makefile b/nss/Makefile
index da5bd207aa..213b68720b 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -136,6 +136,7 @@ routines += \
   gethstbynm_r \
   gethstent \
   gethstent_r \
+  getnameinfo \
   # routines
 
 ifeq ($(have-thread-library),yes)
diff --git a/nss/Versions b/nss/Versions
index 158a9175a4..d765e1d3b6 100644
--- a/nss/Versions
+++ b/nss/Versions
@@ -58,6 +58,9 @@ libc {
     ulckpwdf;
   }
   GLIBC_2.1 {
+    # g*
+    getnameinfo;
+
     # p*
     putgrent;
   }
diff --git a/inet/getnameinfo.c b/nss/getnameinfo.c
similarity index 99%
rename from inet/getnameinfo.c
rename to nss/getnameinfo.c
index 40c20b4be6..062652c229 100644
--- a/inet/getnameinfo.c
+++ b/nss/getnameinfo.c
@@ -71,7 +71,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <sys/utsname.h>
 #include <libc-lock.h>
 #include <scratch_buffer.h>
-#include <net-internal.h>
+#include <inet/net-internal.h>
 #include <set-freeres.h>
 
 #ifndef min
diff --git a/posix/Versions b/posix/Versions
index b24c7c87ff..0624d24bcc 100644
--- a/posix/Versions
+++ b/posix/Versions
@@ -72,7 +72,7 @@ libc {
     __pread64; __pwrite64;
 
     # g*
-    gai_strerror; getnameinfo; glob64; globfree64;
+    gai_strerror; glob64; globfree64;
 
     # p*
     pread; pread64; pwrite; pwrite64;
-- 
2.41.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 01/16] inet: Rearrange and sort Makefile variables
  2023-10-02 12:55 ` [PATCH 01/16] inet: Rearrange and sort Makefile variables Arjun Shankar
@ 2023-10-02 14:11   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 35+ messages in thread
From: Siddhesh Poyarekar @ 2023-10-02 14:11 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha

On 2023-10-02 08:55, Arjun Shankar wrote:
> Rearrange lists of routines, tests, etc. into one-per-line in
> inet/Makefile and sort them using scripts/sort-makefile-lines.py.
> ---

This is a trivial, independent cleanup, please push.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

>   inet/Makefile | 142 +++++++++++++++++++++++++++++++++++++++-----------
>   1 file changed, 112 insertions(+), 30 deletions(-)
> 
> diff --git a/inet/Makefile b/inet/Makefile
> index f5249ab2b1..9db7f941c6 100644
> --- a/inet/Makefile
> +++ b/inet/Makefile
> @@ -22,41 +22,123 @@ subdir	:= inet
>   
>   include ../Makeconfig
>   
> -headers	:= netinet/ether.h netinet/in.h netinet/in_systm.h \
> -	   netinet/if_ether.h netinet/igmp.h \
> -	   netinet/tcp.h netinet/ip.h $(wildcard arpa/*.h protocols/*.h) \
> -	   aliases.h ifaddrs.h netinet/ip6.h netinet/icmp6.h bits/in.h \
> -	   rpc/netdb.h
> -
> -routines := htonl htons		\
> -	    inet_lnaof inet_mkadr	\
> -	    inet_netof inet_ntoa inet_net herrno herrno-loc \
> -	    gethstbyad gethstbyad_r gethstbynm gethstbynm2 gethstbynm2_r \
> -	    gethstbynm_r gethstent gethstent_r \
> -	    getnetbyad getnetbyad_r getnetbynm getnetent getnetent_r \
> -	    getnetbynm_r \
> -	    getproto getproto_r getprtent getprtent_r getprtname getprtname_r \
> -	    getsrvbynm getsrvbynm_r getsrvbypt getsrvbypt_r getservent \
> -	    getservent_r getrpcent getrpcbyname getrpcbynumber \
> -	    getrpcent_r getrpcbyname_r getrpcbynumber_r \
> -	    ether_aton ether_aton_r ether_hton ether_line \
> -	    ether_ntoa ether_ntoa_r ether_ntoh \
> -	    rcmd rexec ruserpass bindresvport \
> -	    getnetgrent_r getnetgrent \
> -	    getaliasent_r getaliasent getaliasname getaliasname_r \
> -	    in6_addr getnameinfo if_index ifaddrs inet6_option \
> -	    getipv4sourcefilter setipv4sourcefilter \
> -	    getsourcefilter setsourcefilter inet6_opt inet6_rth \
> -	    inet6_scopeid_pton deadline idna idna_name_classify
> +headers := \
> +  $(wildcard arpa/*.h protocols/*.h) \
> +  aliases.h \
> +  bits/in.h \
> +  ifaddrs.h \
> +  netinet/ether.h \
> +  netinet/icmp6.h \
> +  netinet/if_ether.h \
> +  netinet/igmp.h \
> +  netinet/in.h \
> +  netinet/in_systm.h \
> +  netinet/ip.h \
> +  netinet/ip6.h \
> +  netinet/tcp.h \
> +  rpc/netdb.h \
> +  # headers
> +
> +routines := \
> +  bindresvport \
> +  deadline \
> +  ether_aton \
> +  ether_aton_r \
> +  ether_hton \
> +  ether_line \
> +  ether_ntoa \
> +  ether_ntoa_r \
> +  ether_ntoh \
> +  getaliasent \
> +  getaliasent_r \
> +  getaliasname \
> +  getaliasname_r \
> +  gethstbyad \
> +  gethstbyad_r \
> +  gethstbynm \
> +  gethstbynm2 \
> +  gethstbynm2_r \
> +  gethstbynm_r \
> +  gethstent \
> +  gethstent_r \
> +  getipv4sourcefilter \
> +  getnameinfo \
> +  getnetbyad \
> +  getnetbyad_r \
> +  getnetbynm \
> +  getnetbynm_r \
> +  getnetent \
> +  getnetent_r \
> +  getnetgrent \
> +  getnetgrent_r \
> +  getproto \
> +  getproto_r \
> +  getprtent \
> +  getprtent_r \
> +  getprtname \
> +  getprtname_r \
> +  getrpcbyname \
> +  getrpcbyname_r \
> +  getrpcbynumber \
> +  getrpcbynumber_r \
> +  getrpcent \
> +  getrpcent_r \
> +  getservent \
> +  getservent_r \
> +  getsourcefilter \
> +  getsrvbynm \
> +  getsrvbynm_r \
> +  getsrvbypt \
> +  getsrvbypt_r \
> +  herrno \
> +  herrno-loc \
> +  htonl \
> +  htons \
> +  idna \
> +  idna_name_classify \
> +  if_index \
> +  ifaddrs \
> +  in6_addr \
> +  inet6_opt \
> +  inet6_option \
> +  inet6_rth \
> +  inet6_scopeid_pton \
> +  inet_lnaof \
> +  inet_mkadr \
> +  inet_net \
> +  inet_netof \
> +  inet_ntoa \
> +  rcmd \
> +  rexec \
> +  ruserpass \
> +  setipv4sourcefilter \
> +  setsourcefilter \
> +  # routines
>   
>   install-others = $(inst_sysconfdir)/rpc
>   
>   aux := check_pf check_native ifreq
>   
> -tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \
> -	 tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \
> -	 tst-getni1 tst-getni2 tst-inet6_rth tst-checks tst-checks-posix \
> -	 tst-sockaddr test-hnto-types tst-if_index-long
> +tests := \
> +  bug-if1 \
> +  htontest \
> +  test-hnto-types \
> +  test-ifaddrs \
> +  test-inet6_opt \
> +  test_ifindex \
> +  tst-checks \
> +  tst-checks-posix \
> +  tst-ether_aton \
> +  tst-ether_line \
> +  tst-gethnm \
> +  tst-getni1 \
> +  tst-getni2 \
> +  tst-if_index-long \
> +  tst-inet6_rth \
> +  tst-network \
> +  tst-ntoa \
> +  tst-sockaddr \
> +  # tests
>   
>   # tst-deadline must be linked statically so that we can access
>   # internal functions.

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 02/16] nss: Rearrange and sort Makefile variables
  2023-10-02 12:55 ` [PATCH 02/16] nss: " Arjun Shankar
@ 2023-10-02 14:12   ` Siddhesh Poyarekar
  0 siblings, 0 replies; 35+ messages in thread
From: Siddhesh Poyarekar @ 2023-10-02 14:12 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha

On 2023-10-02 08:55, Arjun Shankar wrote:
> Rearrange lists of routines, tests, etc. into one-per-line in
> nss/Makefile and sort them using scripts/sort-makefile-lines.py.
> ---

This is a trivial, independent cleanup, please push.  Oh, and apologies 
for putting the hv2-canonname test in the wrong place :)

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

>   nss/Makefile | 55 +++++++++++++++++++++++++++++++++++++++-------------
>   1 file changed, 41 insertions(+), 14 deletions(-)
> 
> diff --git a/nss/Makefile b/nss/Makefile
> index 668ba34b18..32764b74c0 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -22,23 +22,50 @@ subdir	:= nss
>   
>   include ../Makeconfig
>   
> -headers			:= nss.h
> +headers := \
> +  nss.h \
> +  # headers
>   
>   # This is the trivial part which goes into libc itself.
> -routines		= nsswitch getnssent getnssent_r digits_dots \
> -			  valid_field valid_list_field rewrite_field \
> -			  $(addsuffix -lookup,$(databases)) \
> -			  compat-lookup nss_hash nss_files_fopen \
> -			  nss_readline nss_parse_line_result \
> -			  nss_fgetent_r nss_module nss_action \
> -			  nss_action_parse nss_database nss_files_data \
> -			  nss_files_functions
> +routines = \
> +  $(addsuffix -lookup,$(databases)) \
> +  compat-lookup \
> +  digits_dots \
> +  getnssent \
> +  getnssent_r \
> +  nss_action \
> +  nss_action_parse \
> +  nss_database \
> +  nss_fgetent_r \
> +  nss_files_data \
> +  nss_files_fopen \
> +  nss_files_functions \
> +  nss_hash \
> +  nss_module \
> +  nss_parse_line_result \
> +  nss_readline \
> +  nsswitch \
> +  rewrite_field \
> +  valid_field \
> +  valid_list_field \
> +  # routines
>   
>   # These are the databases that go through nss dispatch.
>   # Caution: if you add a database here, you must add its real name
>   # in databases.def, too.
> -databases		= proto service hosts network grp pwd ethers \
> -			  spwd netgrp alias sgrp
> +databases = \
> +  alias \
> +  ethers \
> +  grp \
> +  hosts \
> +  netgrp \
> +  network \
> +  proto \
> +  pwd \
> +  service \
> +  sgrp \
> +  spwd \
> +  # databases
>   
>   ifneq (,$(filter sunrpc,$(subdirs)))
>   databases		+= key rpc
> @@ -68,7 +95,7 @@ tests := \
>     tst-nss-test4 \
>     tst-nss-test5 \
>     tst-nss-test_errno \
> -# tests
> +  # tests
>   
>   xtests = bug-erange
>   
> @@ -79,11 +106,11 @@ tests-container := \
>     tst-nss-files-hosts-long \
>     tst-nss-files-hosts-v4mapped \
>     tst-nss-gai-actions \
> +  tst-nss-gai-hv2-canonname \
>     tst-nss-test3 \
>     tst-reload1 \
>     tst-reload2 \
> -  tst-nss-gai-hv2-canonname \
> -# tests-container
> +  # tests-container
>   
>   # Tests which need libdl
>   ifeq (yes,$(build-shared))

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 03/16] Remove 'grp' and merge into 'nss' and 'posix'
  2023-10-02 12:55 ` [PATCH 03/16] Remove 'grp' and merge into 'nss' and 'posix' Arjun Shankar
@ 2023-10-19 17:55   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-19 17:55 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> The majority of grp routines are entry points for nss functionality.
> This commit removes the 'grp' subdirectory and moves all nss-relevant
> functionality and all tests to 'nss', and the 'setgroups' stub into
> 'posix' (alongside the 'getgroups' stub).  References to grp/ are
> accordingly changed.  In addition, compat-initgroups.c, a fallback
> implementation of initgroups is renamed to initgroups-fallback.c so that
> the build system does not confuse it for nss_compat/compat-initgroups.c.
> 
> Build time improves very slightly; e.g. down from an average of 45.5s to
> 44.5s on an 8-thread mobile x86_64 CPU.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  Makeconfig                                    |  2 +-
>  grp/Makefile                                  | 70 -------------------
>  grp/Versions                                  | 34 ---------
>  include/grp-merge.h                           |  2 +-
>  include/grp.h                                 |  2 +-
>  nscd/initgrcache.c                            |  2 +-
>  nss/Makefile                                  | 43 +++++++++++-
>  nss/Versions                                  | 30 ++++++++
>  {grp => nss}/fgetgrent.c                      |  0
>  {grp => nss}/fgetgrent_r.c                    |  0
>  {grp => nss}/getgrent.c                       |  0
>  {grp => nss}/getgrent_r.c                     |  0
>  {grp => nss}/getgrgid.c                       |  0
>  {grp => nss}/getgrgid_r.c                     |  0
>  {grp => nss}/getgrnam.c                       |  0
>  {grp => nss}/getgrnam_r.c                     |  0
>  {grp => nss}/grp-merge.c                      |  0
>  {grp => nss}/grp-merge.h                      |  0
>  {grp => nss}/grp.h                            |  0
>  .../initgroups-fallback.c                     |  0
>  {grp => nss}/initgroups.c                     |  2 +-
>  {grp => nss}/putgrent.c                       |  0
>  {grp => nss}/testgrp.c                        |  0
>  {grp => nss}/tst-initgroups1.c                |  0
>  {grp => nss}/tst-initgroups1.root/etc/group   |  0
>  .../tst-initgroups1.root/etc/nsswitch.conf    |  0
>  {grp => nss}/tst-initgroups1.root/etc/passwd  |  0
>  {grp => nss}/tst-initgroups2.c                |  0
>  {grp => nss}/tst-initgroups2.root/etc/group   |  0
>  .../tst-initgroups2.root/etc/nsswitch.conf    |  0
>  {grp => nss}/tst-initgroups2.root/etc/passwd  |  0
>  {grp => nss}/tst-putgrent.c                   |  0
>  {grp => nss}/tst_fgetgrent.c                  |  0
>  {grp => nss}/tst_fgetgrent.sh                 | 10 +--
>  posix/Makefile                                |  1 +
>  posix/Versions                                |  2 +-
>  {grp => posix}/setgroups.c                    |  0
>  scripts/update-copyrights                     |  2 +-
>  38 files changed, 85 insertions(+), 117 deletions(-)
>  delete mode 100644 grp/Makefile
>  delete mode 100644 grp/Versions
>  rename {grp => nss}/fgetgrent.c (100%)
>  rename {grp => nss}/fgetgrent_r.c (100%)
>  rename {grp => nss}/getgrent.c (100%)
>  rename {grp => nss}/getgrent_r.c (100%)
>  rename {grp => nss}/getgrgid.c (100%)
>  rename {grp => nss}/getgrgid_r.c (100%)
>  rename {grp => nss}/getgrnam.c (100%)
>  rename {grp => nss}/getgrnam_r.c (100%)
>  rename {grp => nss}/grp-merge.c (100%)
>  rename {grp => nss}/grp-merge.h (100%)
>  rename {grp => nss}/grp.h (100%)
>  rename grp/compat-initgroups.c => nss/initgroups-fallback.c (100%)
>  rename {grp => nss}/initgroups.c (99%)
>  rename {grp => nss}/putgrent.c (100%)
>  rename {grp => nss}/testgrp.c (100%)
>  rename {grp => nss}/tst-initgroups1.c (100%)
>  rename {grp => nss}/tst-initgroups1.root/etc/group (100%)
>  rename {grp => nss}/tst-initgroups1.root/etc/nsswitch.conf (100%)
>  rename {grp => nss}/tst-initgroups1.root/etc/passwd (100%)
>  rename {grp => nss}/tst-initgroups2.c (100%)
>  rename {grp => nss}/tst-initgroups2.root/etc/group (100%)
>  rename {grp => nss}/tst-initgroups2.root/etc/nsswitch.conf (100%)
>  rename {grp => nss}/tst-initgroups2.root/etc/passwd (100%)
>  rename {grp => nss}/tst-putgrent.c (100%)
>  rename {grp => nss}/tst_fgetgrent.c (100%)
>  rename {grp => nss}/tst_fgetgrent.sh (76%)
>  rename {grp => posix}/setgroups.c (100%)
> 
> diff --git a/Makeconfig b/Makeconfig
> index c48fcc59e8..9ff6a902e9 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -1352,7 +1352,7 @@ endif
>  # dependencies and generate sorted-subdirs dynamically.
>  all-subdirs = csu assert ctype locale intl catgets math setjmp signal	    \
>  	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
> -	      grp pwd posix io termios resource misc socket sysvipc gmon    \
> +	      pwd posix io termios resource misc socket sysvipc gmon        \
>  	      gnulib iconv iconvdata wctype manual shadow gshadow po argp   \
>  	      localedata timezone rt conform debug mathvec support	    \
>  	      dlfcn elf
> diff --git a/grp/Makefile b/grp/Makefile
> deleted file mode 100644
> index 38006fb5c3..0000000000
> --- a/grp/Makefile
> +++ /dev/null
> @@ -1,70 +0,0 @@
> -# Copyright (C) 1991-2023 Free Software Foundation, Inc.
> -# This file is part of the GNU C Library.
> -
> -# The GNU C Library is free software; you can redistribute it and/or
> -# modify it under the terms of the GNU Lesser General Public
> -# License as published by the Free Software Foundation; either
> -# version 2.1 of the License, or (at your option) any later version.
> -
> -# The GNU C Library is distributed in the hope that it will be useful,
> -# but WITHOUT ANY WARRANTY; without even the implied warranty of
> -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -# Lesser General Public License for more details.
> -
> -# You should have received a copy of the GNU Lesser General Public
> -# License along with the GNU C Library; if not, see
> -# <https://www.gnu.org/licenses/>.
> -
> -#
> -#	Sub-makefile for grp portion of the library.
> -#
> -subdir	:= grp
> -
> -include ../Makeconfig
> -
> -headers := grp.h
> -
> -routines := fgetgrent initgroups setgroups \
> -	    getgrent getgrgid getgrnam putgrent \
> -	    getgrent_r getgrgid_r getgrnam_r fgetgrent_r \
> -	    grp-merge
> -
> -tests := testgrp tst-putgrent
> -
> -tests-container = \
> -	tst-initgroups1 \
> -	tst-initgroups2
> -
> -ifeq (yes,$(build-shared))
> -test-srcs :=  tst_fgetgrent
> -ifeq ($(run-built-tests),yes)
> -tests-special += $(objpfx)tst_fgetgrent.out
> -endif
> -endif
> -
> -
> -include ../Rules
> -
> -ifeq ($(have-thread-library),yes)
> -
> -CFLAGS-getgrgid_r.c += -fexceptions
> -CFLAGS-getgrnam_r.c += -fexceptions
> -CFLAGS-getgrent_r.c += -fexceptions
> -CFLAGS-getgrent.c += -fexceptions
> -CFLAGS-fgetgrent.c += -fexceptions
> -CFLAGS-fgetgrent_r.c += -fexceptions $(libio-mtsafe)
> -CFLAGS-putgrent.c += -fexceptions $(libio-mtsafe)
> -CFLAGS-initgroups.c += -fexceptions
> -CFLAGS-getgrgid.c += -fexceptions
> -
> -endif
> -
> -ifeq ($(run-built-tests),yes)
> -# tst_fgetgrent currently only works with shared libraries
> -ifeq (yes,$(build-shared))
> -$(objpfx)tst_fgetgrent.out: tst_fgetgrent.sh $(objpfx)tst_fgetgrent
> -	$(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
> -	$(evaluate-test)
> -
> -endif
> -endif
> diff --git a/grp/Versions b/grp/Versions
> deleted file mode 100644
> index 096caa47c5..0000000000
> --- a/grp/Versions
> +++ /dev/null
> @@ -1,34 +0,0 @@
> -libc {
> -  GLIBC_2.0 {
> -    # e*
> -    endgrent;
> -
> -    # f*
> -    fgetgrent; fgetgrent_r;
> -
> -    # g*
> -    getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
> -    getgroups;
> -
> -    # i*
> -    initgroups;
> -
> -    # s*
> -    setgrent; setgroups;
> -  }
> -  GLIBC_2.1 {
> -    # p*
> -    putgrent;
> -  }
> -  GLIBC_2.1.2 {
> -    # g*
> -    getgrent_r; getgrgid_r; getgrnam_r;
> -  }
> -  GLIBC_2.2.4 {
> -    # g*
> -    getgrouplist;
> -  }
> -  GLIBC_PRIVATE {
> -    __merge_grp; __copy_grp;
> -  }
> -}
> diff --git a/include/grp-merge.h b/include/grp-merge.h
> index 331ac20ea9..fc9a25df01 100644
> --- a/include/grp-merge.h
> +++ b/include/grp-merge.h
> @@ -1,5 +1,5 @@
>  #ifndef _GRP_MERGE_H
> -#include <grp/grp-merge.h>
> +#include <nss/grp-merge.h>
>  
>  libc_hidden_proto (__copy_grp)
>  libc_hidden_proto (__merge_grp)
> diff --git a/include/grp.h b/include/grp.h
> index 2cd2475534..96b98a3cde 100644
> --- a/include/grp.h
> +++ b/include/grp.h
> @@ -1,5 +1,5 @@
>  #ifndef _GRP_H
> -#include <grp/grp.h>
> +#include <nss/grp.h>
>  
>  #ifndef _ISOMAC
>  libc_hidden_proto (setgroups)
> diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c
> index be44951bd6..8d8e1c2dbf 100644
> --- a/nscd/initgrcache.c
> +++ b/nscd/initgrcache.c
> @@ -45,7 +45,7 @@ static const initgr_response_header notfound =
>  };
>  
>  
> -#include "../grp/compat-initgroups.c"
> +#include "../nss/initgroups-fallback.c"
>  
>  
>  static time_t
> diff --git a/nss/Makefile b/nss/Makefile
> index 32764b74c0..baf7d9d0ab 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -23,6 +23,7 @@ subdir	:= nss
>  include ../Makeconfig
>  
>  headers := \
> +  grp.h \
>    nss.h \
>    # headers
>  
> @@ -50,6 +51,34 @@ routines = \
>    valid_list_field \
>    # routines
>  
> +# grp routines:
> +routines += \
> +  fgetgrent \
> +  fgetgrent_r \
> +  getgrent \
> +  getgrent_r \
> +  getgrgid \
> +  getgrgid_r \
> +  getgrnam \
> +  getgrnam_r \
> +  grp-merge \
> +  initgroups \
> +  putgrent \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-fgetgrent.c += -fexceptions
> +CFLAGS-fgetgrent_r.c += -fexceptions $(libio-mtsafe)
> +CFLAGS-getgrent.c += -fexceptions
> +CFLAGS-getgrent_r.c += -fexceptions
> +CFLAGS-getgrgid.c += -fexceptions
> +CFLAGS-getgrgid_r.c += -fexceptions
> +CFLAGS-getgrnam.c += -fexceptions
> +CFLAGS-getgrnam_r.c += -fexceptions
> +CFLAGS-initgroups.c += -fexceptions
> +CFLAGS-putgrent.c += -fexceptions $(libio-mtsafe)
> +endif
> +
>  # These are the databases that go through nss dispatch.
>  # Caution: if you add a database here, you must add its real name
>  # in databases.def, too.
> @@ -88,6 +117,7 @@ tests := \
>    bug17079 \
>    test-digits-dots \
>    test-netdb \
> +  testgrp \
>    tst-nss-getpwent \
>    tst-nss-hash \
>    tst-nss-test1 \
> @@ -95,11 +125,14 @@ tests := \
>    tst-nss-test4 \
>    tst-nss-test5 \
>    tst-nss-test_errno \
> +  tst-putgrent \
>    # tests
>  
>  xtests = bug-erange
>  
>  tests-container := \
> +  tst-initgroups1 \
> +  tst-initgroups2 \
>    tst-nss-compat1 \
>    tst-nss-db-endgrent \
>    tst-nss-db-endpwent \
> @@ -112,13 +145,21 @@ tests-container := \
>    tst-reload2 \
>    # tests-container
>  
> -# Tests which need libdl
>  ifeq (yes,$(build-shared))
> +# Tests which need libdl
>  tests += tst-nss-files-hosts-erange
>  tests += tst-nss-files-hosts-multi
>  tests += tst-nss-files-hosts-getent
>  tests += tst-nss-files-alias-leak
>  tests += tst-nss-files-alias-truncated
> +# tst_fgetgrent currently only works with shared libraries
> +test-srcs :=  tst_fgetgrent
> +ifeq ($(run-built-tests),yes)
> +tests-special += $(objpfx)tst_fgetgrent.out
> +$(objpfx)tst_fgetgrent.out: tst_fgetgrent.sh $(objpfx)tst_fgetgrent
> +	$(SHELL) $< $(common-objpfx) '$(test-program-prefix)'; \
> +	$(evaluate-test)
> +endif
>  endif
>  
>  # If we have a thread library then we can test cancellation against
> diff --git a/nss/Versions b/nss/Versions
> index e551524aa9..5401829911 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -5,10 +5,38 @@ libc {
>      # Functions exported as no-op compat symbols.
>      __nss_passwd_lookup; __nss_group_lookup; __nss_hosts_lookup; __nss_next;
>      __nss_database_lookup;
> +
> +    # e*
> +    endgrent;
> +
> +    # f*
> +    fgetgrent; fgetgrent_r;
> +
> +    # g*
> +    getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
> +    getgroups;
> +
> +    # i*
> +    initgroups;
> +
> +    # s*
> +    setgrent;
> +  }
> +  GLIBC_2.1 {
> +    # p*
> +    putgrent;
> +  }
> +  GLIBC_2.1.2 {
> +    # g*
> +    getgrent_r; getgrgid_r; getgrnam_r;
>    }
>    GLIBC_2.2.2 {
>      __nss_hostname_digits_dots;
>    }
> +  GLIBC_2.2.4 {
> +    # g*
> +    getgrouplist;
> +  }
>    GLIBC_2.27 {
>    }
>    GLIBC_PRIVATE {
> @@ -107,6 +135,8 @@ libc {
>      _nss_files_initgroups_dyn;
>  
>      _nss_files_init;
> +
> +    __merge_grp; __copy_grp;
>    }
>  }
>  
> diff --git a/grp/fgetgrent.c b/nss/fgetgrent.c
> similarity index 100%
> rename from grp/fgetgrent.c
> rename to nss/fgetgrent.c
> diff --git a/grp/fgetgrent_r.c b/nss/fgetgrent_r.c
> similarity index 100%
> rename from grp/fgetgrent_r.c
> rename to nss/fgetgrent_r.c
> diff --git a/grp/getgrent.c b/nss/getgrent.c
> similarity index 100%
> rename from grp/getgrent.c
> rename to nss/getgrent.c
> diff --git a/grp/getgrent_r.c b/nss/getgrent_r.c
> similarity index 100%
> rename from grp/getgrent_r.c
> rename to nss/getgrent_r.c
> diff --git a/grp/getgrgid.c b/nss/getgrgid.c
> similarity index 100%
> rename from grp/getgrgid.c
> rename to nss/getgrgid.c
> diff --git a/grp/getgrgid_r.c b/nss/getgrgid_r.c
> similarity index 100%
> rename from grp/getgrgid_r.c
> rename to nss/getgrgid_r.c
> diff --git a/grp/getgrnam.c b/nss/getgrnam.c
> similarity index 100%
> rename from grp/getgrnam.c
> rename to nss/getgrnam.c
> diff --git a/grp/getgrnam_r.c b/nss/getgrnam_r.c
> similarity index 100%
> rename from grp/getgrnam_r.c
> rename to nss/getgrnam_r.c
> diff --git a/grp/grp-merge.c b/nss/grp-merge.c
> similarity index 100%
> rename from grp/grp-merge.c
> rename to nss/grp-merge.c
> diff --git a/grp/grp-merge.h b/nss/grp-merge.h
> similarity index 100%
> rename from grp/grp-merge.h
> rename to nss/grp-merge.h
> diff --git a/grp/grp.h b/nss/grp.h
> similarity index 100%
> rename from grp/grp.h
> rename to nss/grp.h
> diff --git a/grp/compat-initgroups.c b/nss/initgroups-fallback.c
> similarity index 100%
> rename from grp/compat-initgroups.c
> rename to nss/initgroups-fallback.c
> diff --git a/grp/initgroups.c b/nss/initgroups.c
> similarity index 99%
> rename from grp/initgroups.c
> rename to nss/initgroups.c
> index 2ebd623d7b..e803cecebc 100644
> --- a/grp/initgroups.c
> +++ b/nss/initgroups.c
> @@ -39,7 +39,7 @@ typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
>  static bool use_initgroups_entry;
>  
>  
> -#include "compat-initgroups.c"
> +#include "initgroups-fallback.c"
>  
>  
>  static int
> diff --git a/grp/putgrent.c b/nss/putgrent.c
> similarity index 100%
> rename from grp/putgrent.c
> rename to nss/putgrent.c
> diff --git a/grp/testgrp.c b/nss/testgrp.c
> similarity index 100%
> rename from grp/testgrp.c
> rename to nss/testgrp.c
> diff --git a/grp/tst-initgroups1.c b/nss/tst-initgroups1.c
> similarity index 100%
> rename from grp/tst-initgroups1.c
> rename to nss/tst-initgroups1.c
> diff --git a/grp/tst-initgroups1.root/etc/group b/nss/tst-initgroups1.root/etc/group
> similarity index 100%
> rename from grp/tst-initgroups1.root/etc/group
> rename to nss/tst-initgroups1.root/etc/group
> diff --git a/grp/tst-initgroups1.root/etc/nsswitch.conf b/nss/tst-initgroups1.root/etc/nsswitch.conf
> similarity index 100%
> rename from grp/tst-initgroups1.root/etc/nsswitch.conf
> rename to nss/tst-initgroups1.root/etc/nsswitch.conf
> diff --git a/grp/tst-initgroups1.root/etc/passwd b/nss/tst-initgroups1.root/etc/passwd
> similarity index 100%
> rename from grp/tst-initgroups1.root/etc/passwd
> rename to nss/tst-initgroups1.root/etc/passwd
> diff --git a/grp/tst-initgroups2.c b/nss/tst-initgroups2.c
> similarity index 100%
> rename from grp/tst-initgroups2.c
> rename to nss/tst-initgroups2.c
> diff --git a/grp/tst-initgroups2.root/etc/group b/nss/tst-initgroups2.root/etc/group
> similarity index 100%
> rename from grp/tst-initgroups2.root/etc/group
> rename to nss/tst-initgroups2.root/etc/group
> diff --git a/grp/tst-initgroups2.root/etc/nsswitch.conf b/nss/tst-initgroups2.root/etc/nsswitch.conf
> similarity index 100%
> rename from grp/tst-initgroups2.root/etc/nsswitch.conf
> rename to nss/tst-initgroups2.root/etc/nsswitch.conf
> diff --git a/grp/tst-initgroups2.root/etc/passwd b/nss/tst-initgroups2.root/etc/passwd
> similarity index 100%
> rename from grp/tst-initgroups2.root/etc/passwd
> rename to nss/tst-initgroups2.root/etc/passwd
> diff --git a/grp/tst-putgrent.c b/nss/tst-putgrent.c
> similarity index 100%
> rename from grp/tst-putgrent.c
> rename to nss/tst-putgrent.c
> diff --git a/grp/tst_fgetgrent.c b/nss/tst_fgetgrent.c
> similarity index 100%
> rename from grp/tst_fgetgrent.c
> rename to nss/tst_fgetgrent.c
> diff --git a/grp/tst_fgetgrent.sh b/nss/tst_fgetgrent.sh
> similarity index 76%
> rename from grp/tst_fgetgrent.sh
> rename to nss/tst_fgetgrent.sh
> index 1775a6bc61..fb6b0c4179 100644
> --- a/grp/tst_fgetgrent.sh
> +++ b/nss/tst_fgetgrent.sh
> @@ -21,20 +21,20 @@ set -e
>  common_objpfx=$1; shift
>  test_program_prefix=$1; shift
>  
> -testout=${common_objpfx}/grp/tst_fgetgrent.out
> +testout=${common_objpfx}/nss/tst_fgetgrent.out
>  
>  result=0
>  
>  ${test_program_prefix} \
> -${common_objpfx}grp/tst_fgetgrent 0 > ${testout} || result=1
> +${common_objpfx}nss/tst_fgetgrent 0 > ${testout} || result=1
>  
>  ${test_program_prefix} \
> -${common_objpfx}grp/tst_fgetgrent 1 >> ${testout} || result=1
> +${common_objpfx}nss/tst_fgetgrent 1 >> ${testout} || result=1
>  
>  ${test_program_prefix} \
> -${common_objpfx}grp/tst_fgetgrent 2 >> ${testout} || result=1
> +${common_objpfx}nss/tst_fgetgrent 2 >> ${testout} || result=1
>  
>  ${test_program_prefix} \
> -${common_objpfx}grp/tst_fgetgrent 3 >> ${testout} || result=1
> +${common_objpfx}nss/tst_fgetgrent 3 >> ${testout} || result=1
>  
>  exit $result
> diff --git a/posix/Makefile b/posix/Makefile
> index c36b9d981e..be7d319394 100644
> --- a/posix/Makefile
> +++ b/posix/Makefile
> @@ -137,6 +137,7 @@ routines := \
>    sched_sets \
>    sched_yield \
>    setgid \
> +  setgroups \
>    setpgid \
>    setpgrp \
>    setresgid \
> diff --git a/posix/Versions b/posix/Versions
> index 3753810864..2eedbc3e79 100644
> --- a/posix/Versions
> +++ b/posix/Versions
> @@ -53,7 +53,7 @@ libc {
>      sched_get_priority_max; sched_get_priority_min; sched_getparam;
>      sched_getscheduler; sched_rr_get_interval; sched_setparam;
>      sched_setscheduler; sched_yield; setegid; seteuid; setgid;
> -    setpgid; setpgrp; setsid; setuid; sleep; sysconf;
> +    setgroups; setpgid; setpgrp; setsid; setuid; sleep; sysconf;
>  
>      # t*
>      times;
> diff --git a/grp/setgroups.c b/posix/setgroups.c
> similarity index 100%
> rename from grp/setgroups.c
> rename to posix/setgroups.c
> diff --git a/scripts/update-copyrights b/scripts/update-copyrights
> index f6ef6fa33b..a582fa1476 100755
> --- a/scripts/update-copyrights
> +++ b/scripts/update-copyrights
> @@ -65,7 +65,7 @@ for f in $files; do
>  	"$update_script" "$f"
>        fi
>        ;;
> -    grp/initgroups.c | misc/bits/stab.def | posix/regex.h \
> +    nss/initgroups.c | misc/bits/stab.def | posix/regex.h \
>        | sysdeps/wordsize-32/divdi3.c)
>        # Pre-1991 gaps in copyright years, so cannot use a single range.
>        UPDATE_COPYRIGHT_USE_INTERVALS=1 "$update_script" "$f"

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 04/16] Remove 'gshadow' and merge into 'nss'
  2023-10-02 12:55 ` [PATCH 04/16] Remove 'gshadow' and merge into 'nss' Arjun Shankar
@ 2023-10-19 18:15   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-19 18:15 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> The majority of gshadow routines are entry points for nss functionality.
> This commit removes the 'gshadow' subdirectory and moves all
> functionality and tests to 'nss'.  References to gshadow/ are
> accordingly changed.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>


> ---
>  Makeconfig                         |  2 +-
>  gshadow/Makefile                   | 39 ------------------------------
>  gshadow/Versions                   | 21 ----------------
>  include/gshadow.h                  |  2 +-
>  nss/Makefile                       | 28 +++++++++++++++++++++
>  nss/Versions                       | 19 +++++++++++++++
>  {gshadow => nss}/fgetsgent.c       |  0
>  {gshadow => nss}/fgetsgent_r.c     |  0
>  {gshadow => nss}/getsgent.c        |  0
>  {gshadow => nss}/getsgent_r.c      |  0
>  {gshadow => nss}/getsgnam.c        |  0
>  {gshadow => nss}/getsgnam_r.c      |  0
>  {gshadow => nss}/gshadow.h         |  0
>  {gshadow => nss}/putsgent.c        |  0
>  {gshadow => nss}/sgetsgent.c       |  0
>  {gshadow => nss}/sgetsgent_r.c     |  0
>  {gshadow => nss}/tst-fgetsgent_r.c |  0
>  {gshadow => nss}/tst-gshadow.c     |  0
>  {gshadow => nss}/tst-putsgent.c    |  0
>  {gshadow => nss}/tst-sgetsgent.c   |  0
>  20 files changed, 49 insertions(+), 62 deletions(-)
>  delete mode 100644 gshadow/Makefile
>  delete mode 100644 gshadow/Versions
>  rename {gshadow => nss}/fgetsgent.c (100%)
>  rename {gshadow => nss}/fgetsgent_r.c (100%)
>  rename {gshadow => nss}/getsgent.c (100%)
>  rename {gshadow => nss}/getsgent_r.c (100%)
>  rename {gshadow => nss}/getsgnam.c (100%)
>  rename {gshadow => nss}/getsgnam_r.c (100%)
>  rename {gshadow => nss}/gshadow.h (100%)
>  rename {gshadow => nss}/putsgent.c (100%)
>  rename {gshadow => nss}/sgetsgent.c (100%)
>  rename {gshadow => nss}/sgetsgent_r.c (100%)
>  rename {gshadow => nss}/tst-fgetsgent_r.c (100%)
>  rename {gshadow => nss}/tst-gshadow.c (100%)
>  rename {gshadow => nss}/tst-putsgent.c (100%)
>  rename {gshadow => nss}/tst-sgetsgent.c (100%)
> 
> diff --git a/Makeconfig b/Makeconfig
> index 9ff6a902e9..ac7fa3dbb3 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -1353,7 +1353,7 @@ endif
>  all-subdirs = csu assert ctype locale intl catgets math setjmp signal	    \
>  	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
>  	      pwd posix io termios resource misc socket sysvipc gmon        \
> -	      gnulib iconv iconvdata wctype manual shadow gshadow po argp   \
> +	      gnulib iconv iconvdata wctype manual shadow po argp           \
>  	      localedata timezone rt conform debug mathvec support	    \
>  	      dlfcn elf
>  
> diff --git a/gshadow/Makefile b/gshadow/Makefile
> deleted file mode 100644
> index a95524593a..0000000000
> --- a/gshadow/Makefile
> +++ /dev/null
> @@ -1,39 +0,0 @@
> -# Copyright (C) 2009-2023 Free Software Foundation, Inc.
> -# This file is part of the GNU C Library.
> -
> -# The GNU C Library is free software; you can redistribute it and/or
> -# modify it under the terms of the GNU Lesser General Public
> -# License as published by the Free Software Foundation; either
> -# version 2.1 of the License, or (at your option) any later version.
> -
> -# The GNU C Library is distributed in the hope that it will be useful,
> -# but WITHOUT ANY WARRANTY; without even the implied warranty of
> -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -# Lesser General Public License for more details.
> -
> -# You should have received a copy of the GNU Lesser General Public
> -# License along with the GNU C Library; if not, see
> -# <https://www.gnu.org/licenses/>.
> -
> -#
> -#	Makefile for gshadow.
> -#
> -subdir	:= gshadow
> -
> -include ../Makeconfig
> -
> -headers		= gshadow.h
> -routines	= getsgent getsgnam sgetsgent fgetsgent putsgent \
> -		  getsgent_r getsgnam_r sgetsgent_r fgetsgent_r
> -
> -tests = tst-gshadow tst-putsgent tst-fgetsgent_r tst-sgetsgent
> -
> -CFLAGS-getsgent_r.c += -fexceptions
> -CFLAGS-getsgent.c += -fexceptions
> -CFLAGS-fgetsgent.c += -fexceptions
> -CFLAGS-fgetsgent_r.c += -fexceptions $(libio-mtsafe)
> -CFLAGS-putsgent.c += -fexceptions $(libio-mtsafe)
> -CFLAGS-getsgnam.c += -fexceptions
> -CFLAGS-getsgnam_r.c += -fexceptions
> -
> -include ../Rules
> diff --git a/gshadow/Versions b/gshadow/Versions
> deleted file mode 100644
> index 1dba0c5f19..0000000000
> --- a/gshadow/Versions
> +++ /dev/null
> @@ -1,21 +0,0 @@
> -libc {
> -  GLIBC_2.10 {
> -    # e*
> -    endsgent;
> -
> -    # f*
> -    fgetsgent; fgetsgent_r;
> -
> -    # g*
> -    getsgent; getsgent_r; getsgnam; getsgnam_r;
> -
> -    # p*
> -    putsgent;
> -
> -    # s*
> -    setsgent;
> -
> -    # s*
> -    sgetsgent; sgetsgent_r;
> -  }
> -}
> diff --git a/include/gshadow.h b/include/gshadow.h
> index 1cefcfc641..95f8f950a9 100644
> --- a/include/gshadow.h
> +++ b/include/gshadow.h
> @@ -1,5 +1,5 @@
>  #ifndef _GSHADOW_H
> -#include <gshadow/gshadow.h>
> +#include <nss/gshadow.h>
>  
>  # ifndef _ISOMAC
>  
> diff --git a/nss/Makefile b/nss/Makefile
> index baf7d9d0ab..5256b90f8b 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -24,6 +24,7 @@ include ../Makeconfig
>  
>  headers := \
>    grp.h \
> +  gshadow.h \
>    nss.h \
>    # headers
>  
> @@ -79,6 +80,29 @@ CFLAGS-initgroups.c += -fexceptions
>  CFLAGS-putgrent.c += -fexceptions $(libio-mtsafe)
>  endif
>  
> +# gshadow routines:
> +routines += \
> +  fgetsgent \
> +  fgetsgent_r \
> +  getsgent \
> +  getsgent_r \
> +  getsgnam \
> +  getsgnam_r \
> +  putsgent \
> +  sgetsgent \
> +  sgetsgent_r \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-getsgent_r.c += -fexceptions
> +CFLAGS-getsgent.c += -fexceptions
> +CFLAGS-fgetsgent.c += -fexceptions
> +CFLAGS-fgetsgent_r.c += -fexceptions $(libio-mtsafe)
> +CFLAGS-putsgent.c += -fexceptions $(libio-mtsafe)
> +CFLAGS-getsgnam.c += -fexceptions
> +CFLAGS-getsgnam_r.c += -fexceptions
> +endif
> +
>  # These are the databases that go through nss dispatch.
>  # Caution: if you add a database here, you must add its real name
>  # in databases.def, too.
> @@ -118,6 +142,8 @@ tests := \
>    test-digits-dots \
>    test-netdb \
>    testgrp \
> +  tst-fgetsgent_r \
> +  tst-gshadow \
>    tst-nss-getpwent \
>    tst-nss-hash \
>    tst-nss-test1 \
> @@ -126,6 +152,8 @@ tests := \
>    tst-nss-test5 \
>    tst-nss-test_errno \
>    tst-putgrent \
> +  tst-putsgent \
> +  tst-sgetsgent \
>    # tests
>  
>  xtests = bug-erange
> diff --git a/nss/Versions b/nss/Versions
> index 5401829911..6204ac0af1 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -37,6 +37,25 @@ libc {
>      # g*
>      getgrouplist;
>    }
> +  GLIBC_2.10 {
> +    # e*
> +    endsgent;
> +
> +    # f*
> +    fgetsgent; fgetsgent_r;
> +
> +    # g*
> +    getsgent; getsgent_r; getsgnam; getsgnam_r;
> +
> +    # p*
> +    putsgent;
> +
> +    # s*
> +    setsgent;
> +
> +    # s*
> +    sgetsgent; sgetsgent_r;
> +  }
>    GLIBC_2.27 {
>    }
>    GLIBC_PRIVATE {
> diff --git a/gshadow/fgetsgent.c b/nss/fgetsgent.c
> similarity index 100%
> rename from gshadow/fgetsgent.c
> rename to nss/fgetsgent.c
> diff --git a/gshadow/fgetsgent_r.c b/nss/fgetsgent_r.c
> similarity index 100%
> rename from gshadow/fgetsgent_r.c
> rename to nss/fgetsgent_r.c
> diff --git a/gshadow/getsgent.c b/nss/getsgent.c
> similarity index 100%
> rename from gshadow/getsgent.c
> rename to nss/getsgent.c
> diff --git a/gshadow/getsgent_r.c b/nss/getsgent_r.c
> similarity index 100%
> rename from gshadow/getsgent_r.c
> rename to nss/getsgent_r.c
> diff --git a/gshadow/getsgnam.c b/nss/getsgnam.c
> similarity index 100%
> rename from gshadow/getsgnam.c
> rename to nss/getsgnam.c
> diff --git a/gshadow/getsgnam_r.c b/nss/getsgnam_r.c
> similarity index 100%
> rename from gshadow/getsgnam_r.c
> rename to nss/getsgnam_r.c
> diff --git a/gshadow/gshadow.h b/nss/gshadow.h
> similarity index 100%
> rename from gshadow/gshadow.h
> rename to nss/gshadow.h
> diff --git a/gshadow/putsgent.c b/nss/putsgent.c
> similarity index 100%
> rename from gshadow/putsgent.c
> rename to nss/putsgent.c
> diff --git a/gshadow/sgetsgent.c b/nss/sgetsgent.c
> similarity index 100%
> rename from gshadow/sgetsgent.c
> rename to nss/sgetsgent.c
> diff --git a/gshadow/sgetsgent_r.c b/nss/sgetsgent_r.c
> similarity index 100%
> rename from gshadow/sgetsgent_r.c
> rename to nss/sgetsgent_r.c
> diff --git a/gshadow/tst-fgetsgent_r.c b/nss/tst-fgetsgent_r.c
> similarity index 100%
> rename from gshadow/tst-fgetsgent_r.c
> rename to nss/tst-fgetsgent_r.c
> diff --git a/gshadow/tst-gshadow.c b/nss/tst-gshadow.c
> similarity index 100%
> rename from gshadow/tst-gshadow.c
> rename to nss/tst-gshadow.c
> diff --git a/gshadow/tst-putsgent.c b/nss/tst-putsgent.c
> similarity index 100%
> rename from gshadow/tst-putsgent.c
> rename to nss/tst-putsgent.c
> diff --git a/gshadow/tst-sgetsgent.c b/nss/tst-sgetsgent.c
> similarity index 100%
> rename from gshadow/tst-sgetsgent.c
> rename to nss/tst-sgetsgent.c

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 05/16] Remove 'pwd' and merge into 'nss'
  2023-10-02 12:55 ` [PATCH 05/16] Remove 'pwd' " Arjun Shankar
@ 2023-10-19 18:29   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-19 18:29 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> The majority of pwd routines are entry points for nss functionality.
> This commit removes the 'pwd' subdirectory and moves all functionality
> and tests to 'nss'.  References to pwd/ are accordingly changed.


LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  Makeconfig                  |  2 +-
>  include/pwd.h               |  2 +-
>  nss/Makefile                | 24 +++++++++++++++++++++
>  nss/Versions                |  8 +++++++
>  {pwd => nss}/fgetpwent.c    |  0
>  {pwd => nss}/fgetpwent_r.c  |  0
>  {pwd => nss}/getpw.c        |  0
>  {pwd => nss}/getpwent.c     |  0
>  {pwd => nss}/getpwent_r.c   |  0
>  {pwd => nss}/getpwnam.c     |  0
>  {pwd => nss}/getpwnam_r.c   |  0
>  {pwd => nss}/getpwuid.c     |  0
>  {pwd => nss}/getpwuid_r.c   |  0
>  {pwd => nss}/putpwent.c     |  0
>  {pwd => nss}/pwd.h          |  0
>  {pwd => nss}/tst-getpw.c    |  0
>  {pwd => nss}/tst-putpwent.c |  0
>  pwd/Makefile                | 42 -------------------------------------
>  pwd/Versions                | 19 -----------------
>  19 files changed, 34 insertions(+), 63 deletions(-)
>  rename {pwd => nss}/fgetpwent.c (100%)
>  rename {pwd => nss}/fgetpwent_r.c (100%)
>  rename {pwd => nss}/getpw.c (100%)
>  rename {pwd => nss}/getpwent.c (100%)
>  rename {pwd => nss}/getpwent_r.c (100%)
>  rename {pwd => nss}/getpwnam.c (100%)
>  rename {pwd => nss}/getpwnam_r.c (100%)
>  rename {pwd => nss}/getpwuid.c (100%)
>  rename {pwd => nss}/getpwuid_r.c (100%)
>  rename {pwd => nss}/putpwent.c (100%)
>  rename {pwd => nss}/pwd.h (100%)
>  rename {pwd => nss}/tst-getpw.c (100%)
>  rename {pwd => nss}/tst-putpwent.c (100%)
>  delete mode 100644 pwd/Makefile
>  delete mode 100644 pwd/Versions
> 
> diff --git a/Makeconfig b/Makeconfig
> index ac7fa3dbb3..e5badddbc4 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -1352,7 +1352,7 @@ endif
>  # dependencies and generate sorted-subdirs dynamically.
>  all-subdirs = csu assert ctype locale intl catgets math setjmp signal	    \
>  	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
> -	      pwd posix io termios resource misc socket sysvipc gmon        \
> +	      posix io termios resource misc socket sysvipc gmon            \
>  	      gnulib iconv iconvdata wctype manual shadow po argp           \
>  	      localedata timezone rt conform debug mathvec support	    \
>  	      dlfcn elf
> diff --git a/include/pwd.h b/include/pwd.h
> index f8975d4957..c4ca8bab33 100644
> --- a/include/pwd.h
> +++ b/include/pwd.h
> @@ -1,5 +1,5 @@
>  #ifndef _PWD_H
> -#include <pwd/pwd.h>
> +#include <nss/pwd.h>
>  
>  #ifndef _ISOMAC
>  /* Now define the internal interfaces.  */
> diff --git a/nss/Makefile b/nss/Makefile
> index 5256b90f8b..28648ea884 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -26,6 +26,7 @@ headers := \
>    grp.h \
>    gshadow.h \
>    nss.h \
> +  pwd.h \
>    # headers
>  
>  # This is the trivial part which goes into libc itself.
> @@ -103,6 +104,27 @@ CFLAGS-getsgnam.c += -fexceptions
>  CFLAGS-getsgnam_r.c += -fexceptions
>  endif
>  
> +# pwd routines:
> +routines += \
> +  fgetpwent \
> +  fgetpwent_r \
> +  getpw \
> +  getpwent \
> +  getpwent_r \
> +  getpwnam \
> +  getpwnam_r \
> +  getpwuid \
> +  getpwuid_r \
> +  putpwent \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-fgetpwent_r.c += $(libio-mtsafe)
> +CFLAGS-getpw.c += -fexceptions
> +CFLAGS-getpwent.c += -fexceptions
> +CFLAGS-getpwent_r.c += -fexceptions
> +endif
> +
>  # These are the databases that go through nss dispatch.
>  # Caution: if you add a database here, you must add its real name
>  # in databases.def, too.
> @@ -143,6 +165,7 @@ tests := \
>    test-netdb \
>    testgrp \
>    tst-fgetsgent_r \
> +  tst-getpw \
>    tst-gshadow \
>    tst-nss-getpwent \
>    tst-nss-hash \
> @@ -152,6 +175,7 @@ tests := \
>    tst-nss-test5 \
>    tst-nss-test_errno \
>    tst-putgrent \
> +  tst-putpwent \
>    tst-putsgent \
>    tst-sgetsgent \
>    # tests
> diff --git a/nss/Versions b/nss/Versions
> index 6204ac0af1..58ca73c9df 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -8,19 +8,26 @@ libc {
>  
>      # e*
>      endgrent;
> +    endpwent;
>  
>      # f*
>      fgetgrent; fgetgrent_r;
> +    fgetpwent; fgetpwent_r;
>  
>      # g*
>      getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
>      getgroups;
> +    getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
>  
>      # i*
>      initgroups;
>  
> +    # p*
> +    putpwent;
> +
>      # s*
>      setgrent;
> +    setpwent;
>    }
>    GLIBC_2.1 {
>      # p*
> @@ -29,6 +36,7 @@ libc {
>    GLIBC_2.1.2 {
>      # g*
>      getgrent_r; getgrgid_r; getgrnam_r;
> +    getpwent_r; getpwuid_r; getpwnam_r;
>    }
>    GLIBC_2.2.2 {
>      __nss_hostname_digits_dots;
> diff --git a/pwd/fgetpwent.c b/nss/fgetpwent.c
> similarity index 100%
> rename from pwd/fgetpwent.c
> rename to nss/fgetpwent.c
> diff --git a/pwd/fgetpwent_r.c b/nss/fgetpwent_r.c
> similarity index 100%
> rename from pwd/fgetpwent_r.c
> rename to nss/fgetpwent_r.c
> diff --git a/pwd/getpw.c b/nss/getpw.c
> similarity index 100%
> rename from pwd/getpw.c
> rename to nss/getpw.c
> diff --git a/pwd/getpwent.c b/nss/getpwent.c
> similarity index 100%
> rename from pwd/getpwent.c
> rename to nss/getpwent.c
> diff --git a/pwd/getpwent_r.c b/nss/getpwent_r.c
> similarity index 100%
> rename from pwd/getpwent_r.c
> rename to nss/getpwent_r.c
> diff --git a/pwd/getpwnam.c b/nss/getpwnam.c
> similarity index 100%
> rename from pwd/getpwnam.c
> rename to nss/getpwnam.c
> diff --git a/pwd/getpwnam_r.c b/nss/getpwnam_r.c
> similarity index 100%
> rename from pwd/getpwnam_r.c
> rename to nss/getpwnam_r.c
> diff --git a/pwd/getpwuid.c b/nss/getpwuid.c
> similarity index 100%
> rename from pwd/getpwuid.c
> rename to nss/getpwuid.c
> diff --git a/pwd/getpwuid_r.c b/nss/getpwuid_r.c
> similarity index 100%
> rename from pwd/getpwuid_r.c
> rename to nss/getpwuid_r.c
> diff --git a/pwd/putpwent.c b/nss/putpwent.c
> similarity index 100%
> rename from pwd/putpwent.c
> rename to nss/putpwent.c
> diff --git a/pwd/pwd.h b/nss/pwd.h
> similarity index 100%
> rename from pwd/pwd.h
> rename to nss/pwd.h
> diff --git a/pwd/tst-getpw.c b/nss/tst-getpw.c
> similarity index 100%
> rename from pwd/tst-getpw.c
> rename to nss/tst-getpw.c
> diff --git a/pwd/tst-putpwent.c b/nss/tst-putpwent.c
> similarity index 100%
> rename from pwd/tst-putpwent.c
> rename to nss/tst-putpwent.c
> diff --git a/pwd/Makefile b/pwd/Makefile
> deleted file mode 100644
> index d85842af3e..0000000000
> --- a/pwd/Makefile
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -# Copyright (C) 1991-2023 Free Software Foundation, Inc.
> -# This file is part of the GNU C Library.
> -
> -# The GNU C Library is free software; you can redistribute it and/or
> -# modify it under the terms of the GNU Lesser General Public
> -# License as published by the Free Software Foundation; either
> -# version 2.1 of the License, or (at your option) any later version.
> -
> -# The GNU C Library is distributed in the hope that it will be useful,
> -# but WITHOUT ANY WARRANTY; without even the implied warranty of
> -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -# Lesser General Public License for more details.
> -
> -# You should have received a copy of the GNU Lesser General Public
> -# License along with the GNU C Library; if not, see
> -# <https://www.gnu.org/licenses/>.
> -
> -#
> -#	Sub-makefile for pwd portion of the library.
> -#
> -subdir	:= pwd
> -
> -include ../Makeconfig
> -
> -headers := pwd.h
> -
> -routines := fgetpwent getpw putpwent \
> -	    getpwent getpwnam getpwuid \
> -	    getpwent_r getpwnam_r getpwuid_r fgetpwent_r
> -
> -tests := tst-getpw tst-putpwent
> -
> -include ../Rules
> -
> -ifeq ($(have-thread-library),yes)
> -
> -CFLAGS-getpwent_r.c += -fexceptions
> -CFLAGS-getpwent.c += -fexceptions
> -CFLAGS-getpw.c += -fexceptions
> -CFLAGS-fgetpwent_r.c += $(libio-mtsafe)
> -
> -endif
> diff --git a/pwd/Versions b/pwd/Versions
> deleted file mode 100644
> index b56970019a..0000000000
> --- a/pwd/Versions
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -libc {
> -  GLIBC_2.0 {
> -    # e*
> -    endpwent;
> -
> -    # f*
> -    fgetpwent; fgetpwent_r;
> -
> -    # g*
> -    getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
> -
> -    # p*
> -    putpwent; setpwent;
> -  }
> -  GLIBC_2.1.2 {
> -    # g*
> -    getpwent_r; getpwuid_r; getpwnam_r;
> -  }
> -}

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 06/16] Remove 'shadow' and merge into 'nss'
  2023-10-02 12:55 ` [PATCH 06/16] Remove 'shadow' " Arjun Shankar
@ 2023-10-19 18:44   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-19 18:44 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> The majority of shadow routines are entry points for nss functionality.
> This commit removes the 'shadow' subdirectory and moves all
> functionality and tests to 'nss'.  References to shadow/ are accordingly
> changed.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  Makeconfig                     |  2 +-
>  include/shadow.h               |  2 +-
>  nss/Makefile                   | 27 +++++++++++++++++++++++
>  nss/Versions                   | 13 +++++++++++
>  {shadow => nss}/fgetspent.c    |  0
>  {shadow => nss}/fgetspent_r.c  |  0
>  {shadow => nss}/getspent.c     |  0
>  {shadow => nss}/getspent_r.c   |  0
>  {shadow => nss}/getspnam.c     |  0
>  {shadow => nss}/getspnam_r.c   |  0
>  {shadow => nss}/lckpwdf.c      |  0
>  {shadow => nss}/putspent.c     |  0
>  {shadow => nss}/sgetspent.c    |  0
>  {shadow => nss}/sgetspent_r.c  |  0
>  {shadow => nss}/shadow.h       |  0
>  {shadow => nss}/tst-putspent.c |  0
>  {shadow => nss}/tst-shadow.c   |  0
>  shadow/Makefile                | 40 ----------------------------------
>  shadow/Versions                | 31 --------------------------
>  19 files changed, 42 insertions(+), 73 deletions(-)
>  rename {shadow => nss}/fgetspent.c (100%)
>  rename {shadow => nss}/fgetspent_r.c (100%)
>  rename {shadow => nss}/getspent.c (100%)
>  rename {shadow => nss}/getspent_r.c (100%)
>  rename {shadow => nss}/getspnam.c (100%)
>  rename {shadow => nss}/getspnam_r.c (100%)
>  rename {shadow => nss}/lckpwdf.c (100%)
>  rename {shadow => nss}/putspent.c (100%)
>  rename {shadow => nss}/sgetspent.c (100%)
>  rename {shadow => nss}/sgetspent_r.c (100%)
>  rename {shadow => nss}/shadow.h (100%)
>  rename {shadow => nss}/tst-putspent.c (100%)
>  rename {shadow => nss}/tst-shadow.c (100%)
>  delete mode 100644 shadow/Makefile
>  delete mode 100644 shadow/Versions
> 
> diff --git a/Makeconfig b/Makeconfig
> index e5badddbc4..fc35aee10b 100644
> --- a/Makeconfig
> +++ b/Makeconfig
> @@ -1353,7 +1353,7 @@ endif
>  all-subdirs = csu assert ctype locale intl catgets math setjmp signal	    \
>  	      stdlib stdio-common libio malloc string wcsmbs time dirent    \
>  	      posix io termios resource misc socket sysvipc gmon            \
> -	      gnulib iconv iconvdata wctype manual shadow po argp           \
> +	      gnulib iconv iconvdata wctype manual po argp                  \
>  	      localedata timezone rt conform debug mathvec support	    \
>  	      dlfcn elf
>  
> diff --git a/include/shadow.h b/include/shadow.h
> index fb1681909f..bbb8be2ff0 100644
> --- a/include/shadow.h
> +++ b/include/shadow.h
> @@ -1,5 +1,5 @@
>  #ifndef _SHADOW_H
> -#include <shadow/shadow.h>
> +#include <nss/shadow.h>
>  
>  # ifndef _ISOMAC
>  
> diff --git a/nss/Makefile b/nss/Makefile
> index 28648ea884..84cf62af2b 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -27,6 +27,7 @@ headers := \
>    gshadow.h \
>    nss.h \
>    pwd.h \
> +  shadow.h \
>    # headers
>  
>  # This is the trivial part which goes into libc itself.
> @@ -125,6 +126,30 @@ CFLAGS-getpwent.c += -fexceptions
>  CFLAGS-getpwent_r.c += -fexceptions
>  endif
>  
> +# shadow routines
> +routines += \
> +  fgetspent \
> +  fgetspent_r \
> +  getspent \
> +  getspent_r \
> +  getspnam \
> +  getspnam_r \
> +  lckpwdf \
> +  putspent \
> +  sgetspent \
> +  sgetspent_r \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-getspent_r.c += -fexceptions
> +CFLAGS-getspent.c += -fexceptions
> +CFLAGS-fgetspent.c += -fexceptions
> +CFLAGS-fgetspent_r.c += -fexceptions $(libio-mtsafe)
> +CFLAGS-putspent.c += -fexceptions $(libio-mtsafe)
> +CFLAGS-getspnam.c += -fexceptions
> +CFLAGS-getspnam_r.c += -fexceptions
> +endif
> +
>  # These are the databases that go through nss dispatch.
>  # Caution: if you add a database here, you must add its real name
>  # in databases.def, too.
> @@ -177,7 +202,9 @@ tests := \
>    tst-putgrent \
>    tst-putpwent \
>    tst-putsgent \
> +  tst-putspent \
>    tst-sgetsgent \
> +  tst-shadow \
>    # tests
>  
>  xtests = bug-erange
> diff --git a/nss/Versions b/nss/Versions
> index 58ca73c9df..632af25be4 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -9,25 +9,37 @@ libc {
>      # e*
>      endgrent;
>      endpwent;
> +    endspent;
>  
>      # f*
>      fgetgrent; fgetgrent_r;
>      fgetpwent; fgetpwent_r;
> +    fgetspent; fgetspent_r;
>  
>      # g*
>      getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
>      getgroups;
>      getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
> +    getspent; getspent_r; getspnam; getspnam_r;
>  
>      # i*
>      initgroups;
>  
> +    # l*
> +    lckpwdf;
> +
>      # p*
>      putpwent;
> +    putspent;
>  
>      # s*
>      setgrent;
>      setpwent;
> +    setspent;
> +    sgetspent; sgetspent_r;
> +
> +    # u*
> +    ulckpwdf;
>    }
>    GLIBC_2.1 {
>      # p*
> @@ -37,6 +49,7 @@ libc {
>      # g*
>      getgrent_r; getgrgid_r; getgrnam_r;
>      getpwent_r; getpwuid_r; getpwnam_r;
> +    getspent_r; getspnam_r;
>    }
>    GLIBC_2.2.2 {
>      __nss_hostname_digits_dots;
> diff --git a/shadow/fgetspent.c b/nss/fgetspent.c
> similarity index 100%
> rename from shadow/fgetspent.c
> rename to nss/fgetspent.c
> diff --git a/shadow/fgetspent_r.c b/nss/fgetspent_r.c
> similarity index 100%
> rename from shadow/fgetspent_r.c
> rename to nss/fgetspent_r.c
> diff --git a/shadow/getspent.c b/nss/getspent.c
> similarity index 100%
> rename from shadow/getspent.c
> rename to nss/getspent.c
> diff --git a/shadow/getspent_r.c b/nss/getspent_r.c
> similarity index 100%
> rename from shadow/getspent_r.c
> rename to nss/getspent_r.c
> diff --git a/shadow/getspnam.c b/nss/getspnam.c
> similarity index 100%
> rename from shadow/getspnam.c
> rename to nss/getspnam.c
> diff --git a/shadow/getspnam_r.c b/nss/getspnam_r.c
> similarity index 100%
> rename from shadow/getspnam_r.c
> rename to nss/getspnam_r.c
> diff --git a/shadow/lckpwdf.c b/nss/lckpwdf.c
> similarity index 100%
> rename from shadow/lckpwdf.c
> rename to nss/lckpwdf.c
> diff --git a/shadow/putspent.c b/nss/putspent.c
> similarity index 100%
> rename from shadow/putspent.c
> rename to nss/putspent.c
> diff --git a/shadow/sgetspent.c b/nss/sgetspent.c
> similarity index 100%
> rename from shadow/sgetspent.c
> rename to nss/sgetspent.c
> diff --git a/shadow/sgetspent_r.c b/nss/sgetspent_r.c
> similarity index 100%
> rename from shadow/sgetspent_r.c
> rename to nss/sgetspent_r.c
> diff --git a/shadow/shadow.h b/nss/shadow.h
> similarity index 100%
> rename from shadow/shadow.h
> rename to nss/shadow.h
> diff --git a/shadow/tst-putspent.c b/nss/tst-putspent.c
> similarity index 100%
> rename from shadow/tst-putspent.c
> rename to nss/tst-putspent.c
> diff --git a/shadow/tst-shadow.c b/nss/tst-shadow.c
> similarity index 100%
> rename from shadow/tst-shadow.c
> rename to nss/tst-shadow.c
> diff --git a/shadow/Makefile b/shadow/Makefile
> deleted file mode 100644
> index 0102a4d0e3..0000000000
> --- a/shadow/Makefile
> +++ /dev/null
> @@ -1,40 +0,0 @@
> -# Copyright (C) 1996-2023 Free Software Foundation, Inc.
> -# This file is part of the GNU C Library.
> -
> -# The GNU C Library is free software; you can redistribute it and/or
> -# modify it under the terms of the GNU Lesser General Public
> -# License as published by the Free Software Foundation; either
> -# version 2.1 of the License, or (at your option) any later version.
> -
> -# The GNU C Library is distributed in the hope that it will be useful,
> -# but WITHOUT ANY WARRANTY; without even the implied warranty of
> -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -# Lesser General Public License for more details.
> -
> -# You should have received a copy of the GNU Lesser General Public
> -# License along with the GNU C Library; if not, see
> -# <https://www.gnu.org/licenses/>.
> -
> -#
> -#	Makefile for shadow.
> -#
> -subdir	:= shadow
> -
> -include ../Makeconfig
> -
> -headers		= shadow.h
> -routines	= getspent getspnam sgetspent fgetspent putspent \
> -		  getspent_r getspnam_r sgetspent_r fgetspent_r \
> -		  lckpwdf
> -
> -tests = tst-shadow tst-putspent
> -
> -CFLAGS-getspent_r.c += -fexceptions
> -CFLAGS-getspent.c += -fexceptions
> -CFLAGS-fgetspent.c += -fexceptions
> -CFLAGS-fgetspent_r.c += -fexceptions $(libio-mtsafe)
> -CFLAGS-putspent.c += -fexceptions $(libio-mtsafe)
> -CFLAGS-getspnam.c += -fexceptions
> -CFLAGS-getspnam_r.c += -fexceptions
> -
> -include ../Rules
> diff --git a/shadow/Versions b/shadow/Versions
> deleted file mode 100644
> index 38ab368fff..0000000000
> --- a/shadow/Versions
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -libc {
> -  GLIBC_2.0 {
> -    # e*
> -    endspent;
> -
> -    # f*
> -    fgetspent; fgetspent_r;
> -
> -    # g*
> -    getspent; getspent_r; getspnam; getspnam_r;
> -
> -    # l*
> -    lckpwdf;
> -
> -    # p*
> -    putspent;
> -
> -    # s*
> -    setspent;
> -
> -    # s*
> -    sgetspent; sgetspent_r;
> -
> -    # u*
> -    ulckpwdf;
> -  }
> -  GLIBC_2.1.2 {
> -    # g*
> -    getspent_r; getspnam_r;
> -  }
> -}

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 07/16] Move 'aliases' routines from 'inet' into 'nss'
  2023-10-02 12:55 ` [PATCH 07/16] Move 'aliases' routines from 'inet' " Arjun Shankar
@ 2023-10-19 19:23   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-19 19:23 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> The aliases routines are entry points for nss functionality.  This
> commit moves aliases.h and the aliases routines from the 'inet'
> subdirectory to 'nss', and adjusts any external references.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  include/aliases.h              |  2 +-
>  inet/Makefile                  |  7 -------
>  inet/Versions                  |  1 -
>  nss/Makefile                   | 14 ++++++++++++++
>  nss/Versions                   |  1 +
>  {inet => nss}/aliases.h        |  0
>  {inet => nss}/getaliasent.c    |  0
>  {inet => nss}/getaliasent_r.c  |  0
>  {inet => nss}/getaliasname.c   |  0
>  {inet => nss}/getaliasname_r.c |  0
>  10 files changed, 16 insertions(+), 9 deletions(-)
>  rename {inet => nss}/aliases.h (100%)
>  rename {inet => nss}/getaliasent.c (100%)
>  rename {inet => nss}/getaliasent_r.c (100%)
>  rename {inet => nss}/getaliasname.c (100%)
>  rename {inet => nss}/getaliasname_r.c (100%)
> 
> diff --git a/include/aliases.h b/include/aliases.h
> index db82588630..2c7756efe8 100644
> --- a/include/aliases.h
> +++ b/include/aliases.h
> @@ -1,5 +1,5 @@
>  #ifndef _ALIASES_H
> -#include <inet/aliases.h>
> +#include <nss/aliases.h>
>  
>  # ifndef _ISOMAC
>  
> diff --git a/inet/Makefile b/inet/Makefile
> index 9db7f941c6..bd3dc58322 100644
> --- a/inet/Makefile
> +++ b/inet/Makefile
> @@ -24,7 +24,6 @@ include ../Makeconfig
>  
>  headers := \
>    $(wildcard arpa/*.h protocols/*.h) \
> -  aliases.h \
>    bits/in.h \
>    ifaddrs.h \
>    netinet/ether.h \
> @@ -49,10 +48,6 @@ routines := \
>    ether_ntoa \
>    ether_ntoa_r \
>    ether_ntoh \
> -  getaliasent \
> -  getaliasent_r \
> -  getaliasname \
> -  getaliasname_r \
>    gethstbyad \
>    gethstbyad_r \
>    gethstbynm \
> @@ -176,8 +171,6 @@ CFLAGS-getnetbyad_r.c += -fexceptions
>  CFLAGS-getnetbyad.c += -fexceptions
>  CFLAGS-getnetent_r.c += -fexceptions
>  CFLAGS-getnetent.c += -fexceptions
> -CFLAGS-getaliasent_r.c += -fexceptions
> -CFLAGS-getaliasent.c += -fexceptions
>  CFLAGS-getrpcent_r.c += -fexceptions
>  CFLAGS-getrpcent.c += -fexceptions
>  CFLAGS-getservent_r.c += -fexceptions
> diff --git a/inet/Versions b/inet/Versions
> index 84cbe847cd..e6d1e6f1ba 100644
> --- a/inet/Versions
> +++ b/inet/Versions
> @@ -14,7 +14,6 @@ libc {
>      ether_ntoa_r; ether_ntohost;
>  
>      # g*
> -    getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r;
>      getdomainname; gethostbyaddr; gethostbyaddr_r; gethostbyname;
>      gethostbyname2; gethostbyname2_r; gethostbyname_r; gethostent;
>      gethostent_r; getnetbyaddr; getnetbyaddr_r; getnetbyname;
> diff --git a/nss/Makefile b/nss/Makefile
> index 84cf62af2b..2dfa7ebef9 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -23,6 +23,7 @@ subdir	:= nss
>  include ../Makeconfig
>  
>  headers := \
> +  aliases.h \
>    grp.h \
>    gshadow.h \
>    nss.h \
> @@ -54,6 +55,19 @@ routines = \
>    valid_list_field \
>    # routines
>  
> +# alias routines:
> +routines += \
> +  getaliasent \
> +  getaliasent_r \
> +  getaliasname \
> +  getaliasname_r \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-getaliasent_r.c += -fexceptions
> +CFLAGS-getaliasent.c += -fexceptions
> +endif
> +
>  # grp routines:
>  routines += \
>    fgetgrent \
> diff --git a/nss/Versions b/nss/Versions
> index 632af25be4..5d1b1dac3d 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -17,6 +17,7 @@ libc {
>      fgetspent; fgetspent_r;
>  
>      # g*
> +    getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r;
>      getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
>      getgroups;
>      getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
> diff --git a/inet/aliases.h b/nss/aliases.h
> similarity index 100%
> rename from inet/aliases.h
> rename to nss/aliases.h
> diff --git a/inet/getaliasent.c b/nss/getaliasent.c
> similarity index 100%
> rename from inet/getaliasent.c
> rename to nss/getaliasent.c
> diff --git a/inet/getaliasent_r.c b/nss/getaliasent_r.c
> similarity index 100%
> rename from inet/getaliasent_r.c
> rename to nss/getaliasent_r.c
> diff --git a/inet/getaliasname.c b/nss/getaliasname.c
> similarity index 100%
> rename from inet/getaliasname.c
> rename to nss/getaliasname.c
> diff --git a/inet/getaliasname_r.c b/nss/getaliasname_r.c
> similarity index 100%
> rename from inet/getaliasname_r.c
> rename to nss/getaliasname_r.c

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 08/16] Move 'ethers' routines from 'inet' into 'nss'
  2023-10-02 12:55 ` [PATCH 08/16] Move 'ethers' " Arjun Shankar
@ 2023-10-19 19:39   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-19 19:39 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> ether_hostton and ether_ntohost are entry points for nss functionality.
> This commit moves them from the 'inet' subdirectory to 'nss', and
> adjusts any references accordingly.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  inet/Makefile              | 2 --
>  inet/Versions              | 4 ++--
>  nss/Makefile               | 6 ++++++
>  nss/Versions               | 1 +
>  {inet => nss}/ether_hton.c | 2 +-
>  {inet => nss}/ether_ntoh.c | 2 +-
>  6 files changed, 11 insertions(+), 6 deletions(-)
>  rename {inet => nss}/ether_hton.c (98%)
>  rename {inet => nss}/ether_ntoh.c (98%)
> 
> diff --git a/inet/Makefile b/inet/Makefile
> index bd3dc58322..4d053de748 100644
> --- a/inet/Makefile
> +++ b/inet/Makefile
> @@ -43,11 +43,9 @@ routines := \
>    deadline \
>    ether_aton \
>    ether_aton_r \
> -  ether_hton \
>    ether_line \
>    ether_ntoa \
>    ether_ntoa_r \
> -  ether_ntoh \
>    gethstbyad \
>    gethstbyad_r \
>    gethstbynm \
> diff --git a/inet/Versions b/inet/Versions
> index e6d1e6f1ba..a7c1a0fb6f 100644
> --- a/inet/Versions
> +++ b/inet/Versions
> @@ -10,8 +10,8 @@ libc {
>      endaliasent; endhostent; endnetent; endnetgrent; endprotoent; endservent;
>  
>      # e*
> -    ether_aton; ether_aton_r; ether_hostton; ether_line; ether_ntoa;
> -    ether_ntoa_r; ether_ntohost;
> +    ether_aton; ether_aton_r; ether_line; ether_ntoa;
> +    ether_ntoa_r;
>  
>      # g*
>      getdomainname; gethostbyaddr; gethostbyaddr_r; gethostbyname;
> diff --git a/nss/Makefile b/nss/Makefile
> index 2dfa7ebef9..148c6dc1cf 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -68,6 +68,12 @@ CFLAGS-getaliasent_r.c += -fexceptions
>  CFLAGS-getaliasent.c += -fexceptions
>  endif
>  
> +# ethers routines:
> +routines += \
> +  ether_hton \
> +  ether_ntoh \
> +  # routines
> +
>  # grp routines:
>  routines += \
>    fgetgrent \
> diff --git a/nss/Versions b/nss/Versions
> index 5d1b1dac3d..99208cb9df 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -10,6 +10,7 @@ libc {
>      endgrent;
>      endpwent;
>      endspent;
> +    ether_hostton; ether_ntohost;
>  
>      # f*
>      fgetgrent; fgetgrent_r;
> diff --git a/inet/ether_hton.c b/nss/ether_hton.c
> similarity index 98%
> rename from inet/ether_hton.c
> rename to nss/ether_hton.c
> index 1b49a57f48..5419464756 100644
> --- a/inet/ether_hton.c
> +++ b/nss/ether_hton.c
> @@ -20,7 +20,7 @@
>  #include <netinet/if_ether.h>
>  #include <string.h>
>  
> -#include "../nss/nsswitch.h"
> +#include "nsswitch.h"
>  
>  /* Type of the lookup function we need here.  */
>  typedef int (*lookup_function) (const char *, struct etherent *, char *, int,
> diff --git a/inet/ether_ntoh.c b/nss/ether_ntoh.c
> similarity index 98%
> rename from inet/ether_ntoh.c
> rename to nss/ether_ntoh.c
> index 9f9d7c1a63..2f1eb4ec3d 100644
> --- a/inet/ether_ntoh.c
> +++ b/nss/ether_ntoh.c
> @@ -20,7 +20,7 @@
>  #include <netinet/if_ether.h>
>  #include <string.h>
>  
> -#include <nss/nsswitch.h>
> +#include <nsswitch.h>
>  
>  
>  /* Type of the lookup function we need here.  */

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 09/16] Move 'hosts' routines from 'inet' into 'nss'
  2023-10-02 12:55 ` [PATCH 09/16] Move 'hosts' " Arjun Shankar
@ 2023-10-19 19:53   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-19 19:53 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> The gethostby* and gethostent* routines are entry points for nss
> functionality.  This commit moves them from the 'inet' subdirectory to
> 'nss'.


LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>


> ---
>  inet/Makefile                 | 17 -----------------
>  inet/Versions                 |  4 +---
>  nss/Makefile                  | 24 ++++++++++++++++++++++++
>  nss/Versions                  |  2 ++
>  {inet => nss}/gethstbyad.c    |  0
>  {inet => nss}/gethstbyad_r.c  |  0
>  {inet => nss}/gethstbynm.c    |  0
>  {inet => nss}/gethstbynm2.c   |  0
>  {inet => nss}/gethstbynm2_r.c |  0
>  {inet => nss}/gethstbynm_r.c  |  0
>  {inet => nss}/gethstent.c     |  0
>  {inet => nss}/gethstent_r.c   |  0
>  {inet => nss}/tst-gethnm.c    |  0
>  13 files changed, 27 insertions(+), 20 deletions(-)
>  rename {inet => nss}/gethstbyad.c (100%)
>  rename {inet => nss}/gethstbyad_r.c (100%)
>  rename {inet => nss}/gethstbynm.c (100%)
>  rename {inet => nss}/gethstbynm2.c (100%)
>  rename {inet => nss}/gethstbynm2_r.c (100%)
>  rename {inet => nss}/gethstbynm_r.c (100%)
>  rename {inet => nss}/gethstent.c (100%)
>  rename {inet => nss}/gethstent_r.c (100%)
>  rename {inet => nss}/tst-gethnm.c (100%)
> 
> diff --git a/inet/Makefile b/inet/Makefile
> index 4d053de748..d378542549 100644
> --- a/inet/Makefile
> +++ b/inet/Makefile
> @@ -46,14 +46,6 @@ routines := \
>    ether_line \
>    ether_ntoa \
>    ether_ntoa_r \
> -  gethstbyad \
> -  gethstbyad_r \
> -  gethstbynm \
> -  gethstbynm2 \
> -  gethstbynm2_r \
> -  gethstbynm_r \
> -  gethstent \
> -  gethstent_r \
>    getipv4sourcefilter \
>    getnameinfo \
>    getnetbyad \
> @@ -123,7 +115,6 @@ tests := \
>    tst-checks-posix \
>    tst-ether_aton \
>    tst-ether_line \
> -  tst-gethnm \
>    tst-getni1 \
>    tst-getni2 \
>    tst-if_index-long \
> @@ -154,14 +145,6 @@ include ../gen-locales.mk
>  
>  ifeq ($(have-thread-library),yes)
>  
> -CFLAGS-gethstbyad_r.c += -fexceptions
> -CFLAGS-gethstbyad.c += -fexceptions
> -CFLAGS-gethstbynm_r.c += -fexceptions
> -CFLAGS-gethstbynm.c += -fexceptions
> -CFLAGS-gethstbynm2_r.c += -fexceptions
> -CFLAGS-gethstbynm2.c += -fexceptions
> -CFLAGS-gethstent_r.c += -fexceptions
> -CFLAGS-gethstent.c += -fexceptions
>  CFLAGS-rcmd.c += -fexceptions
>  CFLAGS-getnetbynm_r.c += -fexceptions
>  CFLAGS-getnetbynm.c += -fexceptions
> diff --git a/inet/Versions b/inet/Versions
> index a7c1a0fb6f..d937e9835c 100644
> --- a/inet/Versions
> +++ b/inet/Versions
> @@ -14,9 +14,7 @@ libc {
>      ether_ntoa_r;
>  
>      # g*
> -    getdomainname; gethostbyaddr; gethostbyaddr_r; gethostbyname;
> -    gethostbyname2; gethostbyname2_r; gethostbyname_r; gethostent;
> -    gethostent_r; getnetbyaddr; getnetbyaddr_r; getnetbyname;
> +    getdomainname; getnetbyaddr; getnetbyaddr_r; getnetbyname;
>      getnetbyname_r; getnetent; getnetent_r; getnetgrent; getnetgrent_r;
>      getprotobyname; getprotobyname_r; getprotobynumber;
>      getprotobynumber_r; getprotoent; getprotoent_r;
> diff --git a/nss/Makefile b/nss/Makefile
> index 148c6dc1cf..d0b564a033 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -125,6 +125,29 @@ CFLAGS-getsgnam.c += -fexceptions
>  CFLAGS-getsgnam_r.c += -fexceptions
>  endif
>  
> +# hosts routines:
> +routines += \
> +  gethstbyad \
> +  gethstbyad_r \
> +  gethstbynm \
> +  gethstbynm2 \
> +  gethstbynm2_r \
> +  gethstbynm_r \
> +  gethstent \
> +  gethstent_r \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-gethstbyad.c += -fexceptions
> +CFLAGS-gethstbyad_r.c += -fexceptions
> +CFLAGS-gethstbynm.c += -fexceptions
> +CFLAGS-gethstbynm_r.c += -fexceptions
> +CFLAGS-gethstbynm2.c += -fexceptions
> +CFLAGS-gethstbynm2_r.c += -fexceptions
> +CFLAGS-gethstent.c += -fexceptions
> +CFLAGS-gethstent_r.c += -fexceptions
> +endif
> +
>  # pwd routines:
>  routines += \
>    fgetpwent \
> @@ -210,6 +233,7 @@ tests := \
>    test-netdb \
>    testgrp \
>    tst-fgetsgent_r \
> +  tst-gethnm \
>    tst-getpw \
>    tst-gshadow \
>    tst-nss-getpwent \
> diff --git a/nss/Versions b/nss/Versions
> index 99208cb9df..74ba4470d8 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -21,6 +21,8 @@ libc {
>      getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r;
>      getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
>      getgroups;
> +    gethostbyaddr; gethostbyaddr_r; gethostbyname; gethostbyname2;
> +    gethostbyname2_r; gethostbyname_r; gethostent; gethostent_r;
>      getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
>      getspent; getspent_r; getspnam; getspnam_r;
>  
> diff --git a/inet/gethstbyad.c b/nss/gethstbyad.c
> similarity index 100%
> rename from inet/gethstbyad.c
> rename to nss/gethstbyad.c
> diff --git a/inet/gethstbyad_r.c b/nss/gethstbyad_r.c
> similarity index 100%
> rename from inet/gethstbyad_r.c
> rename to nss/gethstbyad_r.c
> diff --git a/inet/gethstbynm.c b/nss/gethstbynm.c
> similarity index 100%
> rename from inet/gethstbynm.c
> rename to nss/gethstbynm.c
> diff --git a/inet/gethstbynm2.c b/nss/gethstbynm2.c
> similarity index 100%
> rename from inet/gethstbynm2.c
> rename to nss/gethstbynm2.c
> diff --git a/inet/gethstbynm2_r.c b/nss/gethstbynm2_r.c
> similarity index 100%
> rename from inet/gethstbynm2_r.c
> rename to nss/gethstbynm2_r.c
> diff --git a/inet/gethstbynm_r.c b/nss/gethstbynm_r.c
> similarity index 100%
> rename from inet/gethstbynm_r.c
> rename to nss/gethstbynm_r.c
> diff --git a/inet/gethstent.c b/nss/gethstent.c
> similarity index 100%
> rename from inet/gethstent.c
> rename to nss/gethstent.c
> diff --git a/inet/gethstent_r.c b/nss/gethstent_r.c
> similarity index 100%
> rename from inet/gethstent_r.c
> rename to nss/gethstent_r.c
> diff --git a/inet/tst-gethnm.c b/nss/tst-gethnm.c
> similarity index 100%
> rename from inet/tst-gethnm.c
> rename to nss/tst-gethnm.c

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 10/16] Move 'netgroup' routines from 'inet' into 'nss'
  2023-10-02 12:55 ` [PATCH 10/16] Move 'netgroup' " Arjun Shankar
@ 2023-10-20 12:00   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-20 12:00 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> These netgroup routines are entry points for nss functionality.
> This commit moves them along with netgroup.h from the 'inet'
> subdirectory to 'nss', and adjusts any references accordingly.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  include/netdb.h               |  2 +-
>  include/netgroup.h            |  2 +-
>  inet/Makefile                 |  4 ----
>  inet/Versions                 | 12 ++++--------
>  nscd/netgroupcache.c          |  2 +-
>  nss/Makefile                  | 11 +++++++++++
>  nss/Versions                  |  7 +++++++
>  {inet => nss}/getnetgrent.c   |  0
>  {inet => nss}/getnetgrent_r.c |  0
>  {inet => nss}/netgroup.h      |  0
>  10 files changed, 25 insertions(+), 15 deletions(-)
>  rename {inet => nss}/getnetgrent.c (100%)
>  rename {inet => nss}/getnetgrent_r.c (100%)
>  rename {inet => nss}/netgroup.h (100%)
> 
> diff --git a/include/netdb.h b/include/netdb.h
> index 4dcdbb8cd4..1b25837b4b 100644
> --- a/include/netdb.h
> +++ b/include/netdb.h
> @@ -211,7 +211,7 @@ libanl_hidden_proto (__gai_suspend_time64)
>  
>  #define AI_DEFAULT    (AI_V4MAPPED | AI_ADDRCONFIG)
>  
> -#include <inet/netgroup.h>
> +#include <nss/netgroup.h>
>  
>  extern enum nss_status _nss_netgroup_parseline (char **cursor,
>  						struct __netgrent *result,
> diff --git a/include/netgroup.h b/include/netgroup.h
> index 4b2b284cdb..40a5d1a65e 100644
> --- a/include/netgroup.h
> +++ b/include/netgroup.h
> @@ -1 +1 @@
> -#include <inet/netgroup.h>
> +#include <nss/netgroup.h>
> diff --git a/inet/Makefile b/inet/Makefile
> index d378542549..9f39f7ff2b 100644
> --- a/inet/Makefile
> +++ b/inet/Makefile
> @@ -54,8 +54,6 @@ routines := \
>    getnetbynm_r \
>    getnetent \
>    getnetent_r \
> -  getnetgrent \
> -  getnetgrent_r \
>    getproto \
>    getproto_r \
>    getprtent \
> @@ -160,8 +158,6 @@ CFLAGS-getprtent_r.c += -fexceptions
>  CFLAGS-getprtent.c += -fexceptions
>  CFLAGS-either_ntoh.c += -fexceptions
>  CFLAGS-either_hton.c += -fexceptions
> -CFLAGS-getnetgrent.c += -fexceptions
> -CFLAGS-getnetgrent_r.c += -fexceptions
>  CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
>  CFLAGS-if_index.c += $(config-cflags-wno-ignored-attributes)
>  CFLAGS-ifaddrs.c += $(config-cflags-wno-ignored-attributes)
> diff --git a/inet/Versions b/inet/Versions
> index d937e9835c..1ffa444730 100644
> --- a/inet/Versions
> +++ b/inet/Versions
> @@ -7,7 +7,7 @@ libc {
>      rexecoptions;
>  
>      # e*
> -    endaliasent; endhostent; endnetent; endnetgrent; endprotoent; endservent;
> +    endaliasent; endhostent; endnetent; endprotoent; endservent;
>  
>      # e*
>      ether_aton; ether_aton_r; ether_line; ether_ntoa;
> @@ -15,7 +15,7 @@ libc {
>  
>      # g*
>      getdomainname; getnetbyaddr; getnetbyaddr_r; getnetbyname;
> -    getnetbyname_r; getnetent; getnetent_r; getnetgrent; getnetgrent_r;
> +    getnetbyname_r; getnetent; getnetent_r;
>      getprotobyname; getprotobyname_r; getprotobynumber;
>      getprotobynumber_r; getprotoent; getprotoent_r;
>      getservbyname; getservbyname_r; getservbyport;
> @@ -36,7 +36,7 @@ libc {
>      rcmd; rexec; rresvport; ruserok; ruserpass;
>  
>      # s*
> -    setaliasent; setnetent; setnetgrent; setprotoent; setservent;
> +    setaliasent; setnetent; setprotoent; setservent;
>    }
>    GLIBC_2.1 {
>      # variables in normal name space
> @@ -49,7 +49,7 @@ libc {
>      # g*
>      getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r;
>      gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r;
> -    getnetent_r; getnetgrent_r; getprotobyname_r; getprotobynumber_r;
> +    getnetent_r; getprotobyname_r; getprotobynumber_r;
>      getprotoent_r; getservbyname_r;
>      getservbyport_r;
>      getservent_r;
> @@ -81,10 +81,6 @@ libc {
>      inet6_rth_segments; inet6_rth_getaddr;
>    }
>    GLIBC_PRIVATE {
> -    # functions used in other libraries
> -    __internal_endnetgrent; __internal_getnetgrent_r;
> -    __internal_setnetgrent;
> -
>      # Used from nscd.
>      __inet6_scopeid_pton;
>      __idna_to_dns_encoding;
> diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
> index 06b7d7b6ca..b9174a138c 100644
> --- a/nscd/netgroupcache.c
> +++ b/nscd/netgroupcache.c
> @@ -24,7 +24,7 @@
>  #include <unistd.h>
>  #include <sys/mman.h>
>  
> -#include "../inet/netgroup.h"
> +#include "../nss/netgroup.h"
>  #include "nscd.h"
>  #include "dbg_log.h"
>  
> diff --git a/nss/Makefile b/nss/Makefile
> index d0b564a033..2a451f68d9 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -148,6 +148,17 @@ CFLAGS-gethstent.c += -fexceptions
>  CFLAGS-gethstent_r.c += -fexceptions
>  endif
>  
> +# netgroup routines:
> +routines += \
> +  getnetgrent \
> +  getnetgrent_r \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-getnetgrent.c += -fexceptions
> +CFLAGS-getnetgrent_r.c += -fexceptions
> +endif
> +
>  # pwd routines:
>  routines += \
>    fgetpwent \
> diff --git a/nss/Versions b/nss/Versions
> index 74ba4470d8..4ddc018012 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -8,6 +8,7 @@ libc {
>  
>      # e*
>      endgrent;
> +    endnetgrent;
>      endpwent;
>      endspent;
>      ether_hostton; ether_ntohost;
> @@ -23,6 +24,7 @@ libc {
>      getgroups;
>      gethostbyaddr; gethostbyaddr_r; gethostbyname; gethostbyname2;
>      gethostbyname2_r; gethostbyname_r; gethostent; gethostent_r;
> +    getnetgrent; getnetgrent_r;
>      getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
>      getspent; getspent_r; getspnam; getspnam_r;
>  
> @@ -38,6 +40,7 @@ libc {
>  
>      # s*
>      setgrent;
> +    setnetgrent;
>      setpwent;
>      setspent;
>      sgetspent; sgetspent_r;
> @@ -52,6 +55,7 @@ libc {
>    GLIBC_2.1.2 {
>      # g*
>      getgrent_r; getgrgid_r; getgrnam_r;
> +    getnetgrent_r;
>      getpwent_r; getpwuid_r; getpwnam_r;
>      getspent_r; getspnam_r;
>    }
> @@ -181,6 +185,9 @@ libc {
>      _nss_files_init;
>  
>      __merge_grp; __copy_grp;
> +
> +    __internal_endnetgrent; __internal_getnetgrent_r;
> +    __internal_setnetgrent;
>    }
>  }
>  
> diff --git a/inet/getnetgrent.c b/nss/getnetgrent.c
> similarity index 100%
> rename from inet/getnetgrent.c
> rename to nss/getnetgrent.c
> diff --git a/inet/getnetgrent_r.c b/nss/getnetgrent_r.c
> similarity index 100%
> rename from inet/getnetgrent_r.c
> rename to nss/getnetgrent_r.c
> diff --git a/inet/netgroup.h b/nss/netgroup.h
> similarity index 100%
> rename from inet/netgroup.h
> rename to nss/netgroup.h

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 11/16] Move 'networks' routines from 'inet' into 'nss'
  2023-10-02 12:55 ` [PATCH 11/16] Move 'networks' " Arjun Shankar
@ 2023-10-20 12:17   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-20 12:17 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> The getnetby* and getnetent* routines are entry points for nss
> functionality.  This commit moves them from the 'inet' subdirectory to
> 'nss'.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  inet/Makefile                | 12 ------------
>  inet/Versions                |  3 +--
>  nss/Makefile                 | 19 +++++++++++++++++++
>  nss/Versions                 |  2 ++
>  {inet => nss}/getnetbyad.c   |  0
>  {inet => nss}/getnetbyad_r.c |  0
>  {inet => nss}/getnetbynm.c   |  0
>  {inet => nss}/getnetbynm_r.c |  0
>  {inet => nss}/getnetent.c    |  0
>  {inet => nss}/getnetent_r.c  |  0
>  10 files changed, 22 insertions(+), 14 deletions(-)
>  rename {inet => nss}/getnetbyad.c (100%)
>  rename {inet => nss}/getnetbyad_r.c (100%)
>  rename {inet => nss}/getnetbynm.c (100%)
>  rename {inet => nss}/getnetbynm_r.c (100%)
>  rename {inet => nss}/getnetent.c (100%)
>  rename {inet => nss}/getnetent_r.c (100%)
> 
> diff --git a/inet/Makefile b/inet/Makefile
> index 9f39f7ff2b..776cbfa0fd 100644
> --- a/inet/Makefile
> +++ b/inet/Makefile
> @@ -48,12 +48,6 @@ routines := \
>    ether_ntoa_r \
>    getipv4sourcefilter \
>    getnameinfo \
> -  getnetbyad \
> -  getnetbyad_r \
> -  getnetbynm \
> -  getnetbynm_r \
> -  getnetent \
> -  getnetent_r \
>    getproto \
>    getproto_r \
>    getprtent \
> @@ -144,12 +138,6 @@ include ../gen-locales.mk
>  ifeq ($(have-thread-library),yes)
>  
>  CFLAGS-rcmd.c += -fexceptions
> -CFLAGS-getnetbynm_r.c += -fexceptions
> -CFLAGS-getnetbynm.c += -fexceptions
> -CFLAGS-getnetbyad_r.c += -fexceptions
> -CFLAGS-getnetbyad.c += -fexceptions
> -CFLAGS-getnetent_r.c += -fexceptions
> -CFLAGS-getnetent.c += -fexceptions
>  CFLAGS-getrpcent_r.c += -fexceptions
>  CFLAGS-getrpcent.c += -fexceptions
>  CFLAGS-getservent_r.c += -fexceptions
> diff --git a/inet/Versions b/inet/Versions
> index 1ffa444730..051b305e48 100644
> --- a/inet/Versions
> +++ b/inet/Versions
> @@ -14,8 +14,7 @@ libc {
>      ether_ntoa_r;
>  
>      # g*
> -    getdomainname; getnetbyaddr; getnetbyaddr_r; getnetbyname;
> -    getnetbyname_r; getnetent; getnetent_r;
> +    getdomainname;
>      getprotobyname; getprotobyname_r; getprotobynumber;
>      getprotobynumber_r; getprotoent; getprotoent_r;
>      getservbyname; getservbyname_r; getservbyport;
> diff --git a/nss/Makefile b/nss/Makefile
> index 2a451f68d9..023a11fa4b 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -159,6 +159,25 @@ CFLAGS-getnetgrent.c += -fexceptions
>  CFLAGS-getnetgrent_r.c += -fexceptions
>  endif
>  
> +# networks routines:
> +routines += \
> +  getnetbyad \
> +  getnetbyad_r \
> +  getnetbynm \
> +  getnetbynm_r \
> +  getnetent \
> +  getnetent_r \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-getnetbyad.c += -fexceptions
> +CFLAGS-getnetbyad_r.c += -fexceptions
> +CFLAGS-getnetbynm.c += -fexceptions
> +CFLAGS-getnetbynm_r.c += -fexceptions
> +CFLAGS-getnetent.c += -fexceptions
> +CFLAGS-getnetent_r.c += -fexceptions
> +endif
> +
>  # pwd routines:
>  routines += \
>    fgetpwent \
> diff --git a/nss/Versions b/nss/Versions
> index 4ddc018012..95219f0fc7 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -25,6 +25,8 @@ libc {
>      gethostbyaddr; gethostbyaddr_r; gethostbyname; gethostbyname2;
>      gethostbyname2_r; gethostbyname_r; gethostent; gethostent_r;
>      getnetgrent; getnetgrent_r;
> +    getnetbyaddr; getnetbyaddr_r; getnetbyname; getnetbyname_r;
> +    getnetent; getnetent_r;
>      getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
>      getspent; getspent_r; getspnam; getspnam_r;
>  
> diff --git a/inet/getnetbyad.c b/nss/getnetbyad.c
> similarity index 100%
> rename from inet/getnetbyad.c
> rename to nss/getnetbyad.c
> diff --git a/inet/getnetbyad_r.c b/nss/getnetbyad_r.c
> similarity index 100%
> rename from inet/getnetbyad_r.c
> rename to nss/getnetbyad_r.c
> diff --git a/inet/getnetbynm.c b/nss/getnetbynm.c
> similarity index 100%
> rename from inet/getnetbynm.c
> rename to nss/getnetbynm.c
> diff --git a/inet/getnetbynm_r.c b/nss/getnetbynm_r.c
> similarity index 100%
> rename from inet/getnetbynm_r.c
> rename to nss/getnetbynm_r.c
> diff --git a/inet/getnetent.c b/nss/getnetent.c
> similarity index 100%
> rename from inet/getnetent.c
> rename to nss/getnetent.c
> diff --git a/inet/getnetent_r.c b/nss/getnetent_r.c
> similarity index 100%
> rename from inet/getnetent_r.c
> rename to nss/getnetent_r.c

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 12/16] Move 'protocols' routines from 'inet' into 'nss'
  2023-10-02 12:55 ` [PATCH 12/16] Move 'protocols' " Arjun Shankar
@ 2023-10-20 12:32   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-20 12:32 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> The getprotoby* and getprotoent* routines are entry points for nss
> functionality.  This commit moves them from the 'inet' subdirectory to
> 'nss'.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  inet/Makefile                |  8 --------
>  inet/Versions                |  5 +----
>  nss/Makefile                 | 15 +++++++++++++++
>  nss/Versions                 |  3 +++
>  {inet => nss}/getproto.c     |  0
>  {inet => nss}/getproto_r.c   |  0
>  {inet => nss}/getprtent.c    |  0
>  {inet => nss}/getprtent_r.c  |  0
>  {inet => nss}/getprtname.c   |  0
>  {inet => nss}/getprtname_r.c |  0
>  10 files changed, 19 insertions(+), 12 deletions(-)
>  rename {inet => nss}/getproto.c (100%)
>  rename {inet => nss}/getproto_r.c (100%)
>  rename {inet => nss}/getprtent.c (100%)
>  rename {inet => nss}/getprtent_r.c (100%)
>  rename {inet => nss}/getprtname.c (100%)
>  rename {inet => nss}/getprtname_r.c (100%)
> 
> diff --git a/inet/Makefile b/inet/Makefile
> index 776cbfa0fd..dab7182a11 100644
> --- a/inet/Makefile
> +++ b/inet/Makefile
> @@ -48,12 +48,6 @@ routines := \
>    ether_ntoa_r \
>    getipv4sourcefilter \
>    getnameinfo \
> -  getproto \
> -  getproto_r \
> -  getprtent \
> -  getprtent_r \
> -  getprtname \
> -  getprtname_r \
>    getrpcbyname \
>    getrpcbyname_r \
>    getrpcbynumber \
> @@ -142,8 +136,6 @@ CFLAGS-getrpcent_r.c += -fexceptions
>  CFLAGS-getrpcent.c += -fexceptions
>  CFLAGS-getservent_r.c += -fexceptions
>  CFLAGS-getservent.c += -fexceptions
> -CFLAGS-getprtent_r.c += -fexceptions
> -CFLAGS-getprtent.c += -fexceptions
>  CFLAGS-either_ntoh.c += -fexceptions
>  CFLAGS-either_hton.c += -fexceptions
>  CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
> diff --git a/inet/Versions b/inet/Versions
> index 051b305e48..c0c64e1543 100644
> --- a/inet/Versions
> +++ b/inet/Versions
> @@ -15,8 +15,6 @@ libc {
>  
>      # g*
>      getdomainname;
> -    getprotobyname; getprotobyname_r; getprotobynumber;
> -    getprotobynumber_r; getprotoent; getprotoent_r;
>      getservbyname; getservbyname_r; getservbyport;
>      getservbyport_r; getservent; getservent_r;
>  
> @@ -48,8 +46,7 @@ libc {
>      # g*
>      getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r;
>      gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r;
> -    getnetent_r; getprotobyname_r; getprotobynumber_r;
> -    getprotoent_r; getservbyname_r;
> +    getnetent_r; getservbyname_r;
>      getservbyport_r;
>      getservent_r;
>    }
> diff --git a/nss/Makefile b/nss/Makefile
> index 023a11fa4b..df22d3655c 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -178,6 +178,21 @@ CFLAGS-getnetent.c += -fexceptions
>  CFLAGS-getnetent_r.c += -fexceptions
>  endif
>  
> +# protocols routines:
> +routines += \
> +  getproto \
> +  getproto_r \
> +  getprtent \
> +  getprtent_r \
> +  getprtname \
> +  getprtname_r \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-getprtent_r.c += -fexceptions
> +CFLAGS-getprtent.c += -fexceptions
> +endif
> +
>  # pwd routines:
>  routines += \
>    fgetpwent \
> diff --git a/nss/Versions b/nss/Versions
> index 95219f0fc7..c5de97fb53 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -27,6 +27,8 @@ libc {
>      getnetgrent; getnetgrent_r;
>      getnetbyaddr; getnetbyaddr_r; getnetbyname; getnetbyname_r;
>      getnetent; getnetent_r;
> +    getprotobyname; getprotobyname_r; getprotobynumber;
> +    getprotobynumber_r; getprotoent; getprotoent_r;
>      getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
>      getspent; getspent_r; getspnam; getspnam_r;
>  
> @@ -58,6 +60,7 @@ libc {
>      # g*
>      getgrent_r; getgrgid_r; getgrnam_r;
>      getnetgrent_r;
> +    getprotobyname_r; getprotobynumber_r; getprotoent_r;
>      getpwent_r; getpwuid_r; getpwnam_r;
>      getspent_r; getspnam_r;
>    }
> diff --git a/inet/getproto.c b/nss/getproto.c
> similarity index 100%
> rename from inet/getproto.c
> rename to nss/getproto.c
> diff --git a/inet/getproto_r.c b/nss/getproto_r.c
> similarity index 100%
> rename from inet/getproto_r.c
> rename to nss/getproto_r.c
> diff --git a/inet/getprtent.c b/nss/getprtent.c
> similarity index 100%
> rename from inet/getprtent.c
> rename to nss/getprtent.c
> diff --git a/inet/getprtent_r.c b/nss/getprtent_r.c
> similarity index 100%
> rename from inet/getprtent_r.c
> rename to nss/getprtent_r.c
> diff --git a/inet/getprtname.c b/nss/getprtname.c
> similarity index 100%
> rename from inet/getprtname.c
> rename to nss/getprtname.c
> diff --git a/inet/getprtname_r.c b/nss/getprtname_r.c
> similarity index 100%
> rename from inet/getprtname_r.c
> rename to nss/getprtname_r.c

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 13/16] Move 'rpc' routines from 'inet' into 'nss'
  2023-10-02 12:55 ` [PATCH 13/16] Move 'rpc' " Arjun Shankar
@ 2023-10-20 12:49   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-20 12:49 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> The getrpcby* and getrpcent* routines are entry points for nss
> functionality.  This commit moves them from the 'inet' subdirectory to
> 'nss'.  The Versions entries for these routines along with a test,
> located in the 'sunrpc' subdirectory, are also moved into 'nss'.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  inet/Makefile                    |  8 --------
>  nss/Makefile                     | 16 ++++++++++++++++
>  nss/Versions                     |  2 ++
>  {inet => nss}/getrpcbyname.c     |  0
>  {inet => nss}/getrpcbyname_r.c   |  0
>  {inet => nss}/getrpcbynumber.c   |  0
>  {inet => nss}/getrpcbynumber_r.c |  0
>  {inet => nss}/getrpcent.c        |  0
>  {inet => nss}/getrpcent_r.c      |  0
>  {sunrpc => nss}/test-rpcent.c    |  0
>  sunrpc/Makefile                  |  2 +-
>  sunrpc/Versions                  |  3 +--
>  12 files changed, 20 insertions(+), 11 deletions(-)
>  rename {inet => nss}/getrpcbyname.c (100%)
>  rename {inet => nss}/getrpcbyname_r.c (100%)
>  rename {inet => nss}/getrpcbynumber.c (100%)
>  rename {inet => nss}/getrpcbynumber_r.c (100%)
>  rename {inet => nss}/getrpcent.c (100%)
>  rename {inet => nss}/getrpcent_r.c (100%)
>  rename {sunrpc => nss}/test-rpcent.c (100%)
> 
> diff --git a/inet/Makefile b/inet/Makefile
> index dab7182a11..3c1987877a 100644
> --- a/inet/Makefile
> +++ b/inet/Makefile
> @@ -48,12 +48,6 @@ routines := \
>    ether_ntoa_r \
>    getipv4sourcefilter \
>    getnameinfo \
> -  getrpcbyname \
> -  getrpcbyname_r \
> -  getrpcbynumber \
> -  getrpcbynumber_r \
> -  getrpcent \
> -  getrpcent_r \
>    getservent \
>    getservent_r \
>    getsourcefilter \
> @@ -132,8 +126,6 @@ include ../gen-locales.mk
>  ifeq ($(have-thread-library),yes)
>  
>  CFLAGS-rcmd.c += -fexceptions
> -CFLAGS-getrpcent_r.c += -fexceptions
> -CFLAGS-getrpcent.c += -fexceptions
>  CFLAGS-getservent_r.c += -fexceptions
>  CFLAGS-getservent.c += -fexceptions
>  CFLAGS-either_ntoh.c += -fexceptions
> diff --git a/nss/Makefile b/nss/Makefile
> index df22d3655c..cbfd5dc692 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -214,6 +214,21 @@ CFLAGS-getpwent.c += -fexceptions
>  CFLAGS-getpwent_r.c += -fexceptions
>  endif
>  
> +# rpc routines:
> +routines += \
> +  getrpcbyname \
> +  getrpcbyname_r \
> +  getrpcbynumber \
> +  getrpcbynumber_r \
> +  getrpcent \
> +  getrpcent_r \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-getrpcent_r.c += -fexceptions
> +CFLAGS-getrpcent.c += -fexceptions
> +endif
> +
>  # shadow routines
>  routines += \
>    fgetspent \
> @@ -276,6 +291,7 @@ tests := \
>    bug17079 \
>    test-digits-dots \
>    test-netdb \
> +  test-rpcent \
>    testgrp \
>    tst-fgetsgent_r \
>    tst-gethnm \
> diff --git a/nss/Versions b/nss/Versions
> index c5de97fb53..b7491154bf 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -30,6 +30,8 @@ libc {
>      getprotobyname; getprotobyname_r; getprotobynumber;
>      getprotobynumber_r; getprotoent; getprotoent_r;
>      getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
> +    getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r;
> +    getrpcent; getrpcent_r;
>      getspent; getspent_r; getspnam; getspnam_r;
>  
>      # i*
> diff --git a/inet/getrpcbyname.c b/nss/getrpcbyname.c
> similarity index 100%
> rename from inet/getrpcbyname.c
> rename to nss/getrpcbyname.c
> diff --git a/inet/getrpcbyname_r.c b/nss/getrpcbyname_r.c
> similarity index 100%
> rename from inet/getrpcbyname_r.c
> rename to nss/getrpcbyname_r.c
> diff --git a/inet/getrpcbynumber.c b/nss/getrpcbynumber.c
> similarity index 100%
> rename from inet/getrpcbynumber.c
> rename to nss/getrpcbynumber.c
> diff --git a/inet/getrpcbynumber_r.c b/nss/getrpcbynumber_r.c
> similarity index 100%
> rename from inet/getrpcbynumber_r.c
> rename to nss/getrpcbynumber_r.c
> diff --git a/inet/getrpcent.c b/nss/getrpcent.c
> similarity index 100%
> rename from inet/getrpcent.c
> rename to nss/getrpcent.c
> diff --git a/inet/getrpcent_r.c b/nss/getrpcent_r.c
> similarity index 100%
> rename from inet/getrpcent_r.c
> rename to nss/getrpcent_r.c
> diff --git a/sunrpc/test-rpcent.c b/nss/test-rpcent.c
> similarity index 100%
> rename from sunrpc/test-rpcent.c
> rename to nss/test-rpcent.c
> diff --git a/sunrpc/Makefile b/sunrpc/Makefile
> index ec2ea04ca9..83a0f2d099 100644
> --- a/sunrpc/Makefile
> +++ b/sunrpc/Makefile
> @@ -64,7 +64,7 @@ routines := auth_none authuxprot clnt_raw clnt_simp \
>  shared-only-routines = $(routines)
>  endif
>  
> -tests = tst-xdrmem tst-xdrmem2 test-rpcent tst-udp-error tst-udp-timeout \
> +tests = tst-xdrmem tst-xdrmem2 tst-udp-error tst-udp-timeout \
>    tst-udp-nonblocking tst-bug22542 tst-bug28768
>  
>  xtests := tst-getmyaddr
> diff --git a/sunrpc/Versions b/sunrpc/Versions
> index 77bc6a4c9b..cba6e36422 100644
> --- a/sunrpc/Versions
> +++ b/sunrpc/Versions
> @@ -26,8 +26,7 @@ libc {
>  
>      # g*
>      get_myaddress; getpublickey; getsecretkey;
> -    getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r;
> -    getrpcent; getrpcent_r; getrpcport;
> +    getrpcport;
>  
>      # p*
>      pmap_getmaps; pmap_getport; pmap_rmtcall; pmap_set; pmap_unset;

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 14/16] Move 'services' routines from 'inet' into 'nss'
  2023-10-02 12:55 ` [PATCH 14/16] Move 'services' " Arjun Shankar
@ 2023-10-20 13:19   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-20 13:19 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> The getservby* and getservent* routines are entry points for nss
> functionality.  This commit moves them from the 'inet' subdirectory to
> 'nss'.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  inet/Makefile                |  8 --------
>  inet/Versions                |  6 +-----
>  nss/Makefile                 | 15 +++++++++++++++
>  nss/Versions                 |  3 +++
>  {inet => nss}/getservent.c   |  0
>  {inet => nss}/getservent_r.c |  0
>  {inet => nss}/getsrvbynm.c   |  0
>  {inet => nss}/getsrvbynm_r.c |  0
>  {inet => nss}/getsrvbypt.c   |  0
>  {inet => nss}/getsrvbypt_r.c |  0
>  10 files changed, 19 insertions(+), 13 deletions(-)
>  rename {inet => nss}/getservent.c (100%)
>  rename {inet => nss}/getservent_r.c (100%)
>  rename {inet => nss}/getsrvbynm.c (100%)
>  rename {inet => nss}/getsrvbynm_r.c (100%)
>  rename {inet => nss}/getsrvbypt.c (100%)
>  rename {inet => nss}/getsrvbypt_r.c (100%)
> 
> diff --git a/inet/Makefile b/inet/Makefile
> index 3c1987877a..d275f51b3f 100644
> --- a/inet/Makefile
> +++ b/inet/Makefile
> @@ -48,13 +48,7 @@ routines := \
>    ether_ntoa_r \
>    getipv4sourcefilter \
>    getnameinfo \
> -  getservent \
> -  getservent_r \
>    getsourcefilter \
> -  getsrvbynm \
> -  getsrvbynm_r \
> -  getsrvbypt \
> -  getsrvbypt_r \
>    herrno \
>    herrno-loc \
>    htonl \
> @@ -126,8 +120,6 @@ include ../gen-locales.mk
>  ifeq ($(have-thread-library),yes)
>  
>  CFLAGS-rcmd.c += -fexceptions
> -CFLAGS-getservent_r.c += -fexceptions
> -CFLAGS-getservent.c += -fexceptions
>  CFLAGS-either_ntoh.c += -fexceptions
>  CFLAGS-either_hton.c += -fexceptions
>  CFLAGS-in6_addr.c += $(config-cflags-wno-ignored-attributes)
> diff --git a/inet/Versions b/inet/Versions
> index c0c64e1543..7765cb7722 100644
> --- a/inet/Versions
> +++ b/inet/Versions
> @@ -15,8 +15,6 @@ libc {
>  
>      # g*
>      getdomainname;
> -    getservbyname; getservbyname_r; getservbyport;
> -    getservbyport_r; getservent; getservent_r;
>  
>      # h*
>      htonl; htons;
> @@ -46,9 +44,7 @@ libc {
>      # g*
>      getaliasbyname_r; getaliasent_r; gethostbyaddr_r; gethostbyname2_r;
>      gethostbyname_r; gethostent_r; getnetbyaddr_r; getnetbyname_r;
> -    getnetent_r; getservbyname_r;
> -    getservbyport_r;
> -    getservent_r;
> +    getnetent_r;
>    }
>    GLIBC_2.2 {
>      # i*
> diff --git a/nss/Makefile b/nss/Makefile
> index cbfd5dc692..e88754bf51 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -229,6 +229,21 @@ CFLAGS-getrpcent_r.c += -fexceptions
>  CFLAGS-getrpcent.c += -fexceptions
>  endif
>  
> +# services routines:
> +routines += \
> +  getservent \
> +  getservent_r \
> +  getsrvbynm \
> +  getsrvbynm_r \
> +  getsrvbypt \
> +  getsrvbypt_r \
> +  # routines
> +
> +ifeq ($(have-thread-library),yes)
> +CFLAGS-getservent_r.c += -fexceptions
> +CFLAGS-getservent.c += -fexceptions
> +endif
> +
>  # shadow routines
>  routines += \
>    fgetspent \
> diff --git a/nss/Versions b/nss/Versions
> index b7491154bf..d8c4e373c9 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -32,6 +32,8 @@ libc {
>      getpw; getpwent; getpwent_r; getpwnam; getpwnam_r; getpwuid; getpwuid_r;
>      getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r;
>      getrpcent; getrpcent_r;
> +    getservbyname; getservbyname_r; getservbyport;
> +    getservbyport_r; getservent; getservent_r;
>      getspent; getspent_r; getspnam; getspnam_r;
>  
>      # i*
> @@ -64,6 +66,7 @@ libc {
>      getnetgrent_r;
>      getprotobyname_r; getprotobynumber_r; getprotoent_r;
>      getpwent_r; getpwuid_r; getpwnam_r;
> +    getservbyname_r; getservbyport_r; getservent_r;
>      getspent_r; getspnam_r;
>    }
>    GLIBC_2.2.2 {
> diff --git a/inet/getservent.c b/nss/getservent.c
> similarity index 100%
> rename from inet/getservent.c
> rename to nss/getservent.c
> diff --git a/inet/getservent_r.c b/nss/getservent_r.c
> similarity index 100%
> rename from inet/getservent_r.c
> rename to nss/getservent_r.c
> diff --git a/inet/getsrvbynm.c b/nss/getsrvbynm.c
> similarity index 100%
> rename from inet/getsrvbynm.c
> rename to nss/getsrvbynm.c
> diff --git a/inet/getsrvbynm_r.c b/nss/getsrvbynm_r.c
> similarity index 100%
> rename from inet/getsrvbynm_r.c
> rename to nss/getsrvbynm_r.c
> diff --git a/inet/getsrvbypt.c b/nss/getsrvbypt.c
> similarity index 100%
> rename from inet/getsrvbypt.c
> rename to nss/getsrvbypt.c
> diff --git a/inet/getsrvbypt_r.c b/nss/getsrvbypt_r.c
> similarity index 100%
> rename from inet/getsrvbypt_r.c
> rename to nss/getsrvbypt_r.c

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 15/16] Move getaddrinfo from 'posix' into 'nss'
  2023-10-02 12:55 ` [PATCH 15/16] Move getaddrinfo from 'posix' " Arjun Shankar
@ 2023-10-20 13:51   ` Adhemerval Zanella Netto
  2023-10-24 21:32     ` Joseph Myers
  0 siblings, 1 reply; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-20 13:51 UTC (permalink / raw)
  To: Arjun Shankar, libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> getaddrinfo is an entry point for nss functionality.  This commit moves
> it from 'sysdeps/posix' to 'nss', gets rid of the stub in 'posix', and
> moves all associated tests as well.


LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  nss/Makefile                         | 19 ++++++++++++--
>  nss/Versions                         |  1 +
>  {sysdeps/posix => nss}/getaddrinfo.c |  0
>  {posix => nss}/tst-getaddrinfo.c     |  0
>  {posix => nss}/tst-getaddrinfo2.c    |  0
>  {posix => nss}/tst-getaddrinfo3.c    |  0
>  {posix => nss}/tst-getaddrinfo4.c    |  0
>  {posix => nss}/tst-getaddrinfo5.c    |  0
>  {posix => nss}/tst-rfc3484-2.c       |  2 +-
>  {posix => nss}/tst-rfc3484-3.c       |  2 +-
>  {posix => nss}/tst-rfc3484.c         |  2 +-
>  posix/Makefile                       | 10 --------
>  posix/Versions                       |  2 +-
>  posix/getaddrinfo.c                  | 38 ----------------------------
>  14 files changed, 22 insertions(+), 54 deletions(-)
>  rename {sysdeps/posix => nss}/getaddrinfo.c (100%)
>  rename {posix => nss}/tst-getaddrinfo.c (100%)
>  rename {posix => nss}/tst-getaddrinfo2.c (100%)
>  rename {posix => nss}/tst-getaddrinfo3.c (100%)
>  rename {posix => nss}/tst-getaddrinfo4.c (100%)
>  rename {posix => nss}/tst-getaddrinfo5.c (100%)
>  rename {posix => nss}/tst-rfc3484-2.c (99%)
>  rename {posix => nss}/tst-rfc3484-3.c (98%)
>  rename {posix => nss}/tst-rfc3484.c (98%)
>  delete mode 100644 posix/getaddrinfo.c
> 
> diff --git a/nss/Makefile b/nss/Makefile
> index e88754bf51..da5bd207aa 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -127,6 +127,7 @@ endif
>  
>  # hosts routines:
>  routines += \
> +  getaddrinfo \
>    gethstbyad \
>    gethstbyad_r \
>    gethstbynm \
> @@ -138,6 +139,7 @@ routines += \
>    # routines
>  
>  ifeq ($(have-thread-library),yes)
> +CFLAGS-getaddrinfo.c += -fexceptions
>  CFLAGS-gethstbyad.c += -fexceptions
>  CFLAGS-gethstbyad_r.c += -fexceptions
>  CFLAGS-gethstbynm.c += -fexceptions
> @@ -300,7 +302,13 @@ others-extras		= $(makedb-modules)
>  extra-objs		+= $(makedb-modules:=.o)
>  
>  tests-static            = tst-field
> -tests-internal		= tst-field
> +
> +tests-internal := \
> +  tst-field \
> +  tst-rfc3484 \
> +  tst-rfc3484-2 \
> +  tst-rfc3484-3 \
> +  # tests-internal
>  
>  tests := \
>    bug17079 \
> @@ -309,6 +317,9 @@ tests := \
>    test-rpcent \
>    testgrp \
>    tst-fgetsgent_r \
> +  tst-getaddrinfo \
> +  tst-getaddrinfo2 \
> +  tst-getaddrinfo3 \
>    tst-gethnm \
>    tst-getpw \
>    tst-gshadow \
> @@ -327,7 +338,11 @@ tests := \
>    tst-shadow \
>    # tests
>  
> -xtests = bug-erange
> +xtests := \
> +  bug-erange \
> +  tst-getaddrinfo4 \
> +  tst-getaddrinfo5 \
> +  # xtests
>  
>  tests-container := \
>    tst-initgroups1 \
> diff --git a/nss/Versions b/nss/Versions
> index d8c4e373c9..158a9175a4 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -19,6 +19,7 @@ libc {
>      fgetspent; fgetspent_r;
>  
>      # g*
> +    getaddrinfo;
>      getaliasbyname; getaliasbyname_r; getaliasent; getaliasent_r;
>      getgrent; getgrent_r; getgrgid; getgrgid_r; getgrnam; getgrnam_r;
>      getgroups;
> diff --git a/sysdeps/posix/getaddrinfo.c b/nss/getaddrinfo.c
> similarity index 100%
> rename from sysdeps/posix/getaddrinfo.c
> rename to nss/getaddrinfo.c
> diff --git a/posix/tst-getaddrinfo.c b/nss/tst-getaddrinfo.c
> similarity index 100%
> rename from posix/tst-getaddrinfo.c
> rename to nss/tst-getaddrinfo.c
> diff --git a/posix/tst-getaddrinfo2.c b/nss/tst-getaddrinfo2.c
> similarity index 100%
> rename from posix/tst-getaddrinfo2.c
> rename to nss/tst-getaddrinfo2.c
> diff --git a/posix/tst-getaddrinfo3.c b/nss/tst-getaddrinfo3.c
> similarity index 100%
> rename from posix/tst-getaddrinfo3.c
> rename to nss/tst-getaddrinfo3.c
> diff --git a/posix/tst-getaddrinfo4.c b/nss/tst-getaddrinfo4.c
> similarity index 100%
> rename from posix/tst-getaddrinfo4.c
> rename to nss/tst-getaddrinfo4.c
> diff --git a/posix/tst-getaddrinfo5.c b/nss/tst-getaddrinfo5.c
> similarity index 100%
> rename from posix/tst-getaddrinfo5.c
> rename to nss/tst-getaddrinfo5.c
> diff --git a/posix/tst-rfc3484-2.c b/nss/tst-rfc3484-2.c
> similarity index 99%
> rename from posix/tst-rfc3484-2.c
> rename to nss/tst-rfc3484-2.c
> index ce8ccd5f38..a5f8f82c04 100644
> --- a/posix/tst-rfc3484-2.c
> +++ b/nss/tst-rfc3484-2.c
> @@ -57,7 +57,7 @@ _res_hconf_init (void)
>  }
>  
>  #undef	USE_NSCD
> -#include "../sysdeps/posix/getaddrinfo.c"
> +#include "getaddrinfo.c"
>  
>  nss_action_list __nss_hosts_database attribute_hidden;
>  
> diff --git a/posix/tst-rfc3484-3.c b/nss/tst-rfc3484-3.c
> similarity index 98%
> rename from posix/tst-rfc3484-3.c
> rename to nss/tst-rfc3484-3.c
> index ecb163963f..edf0b7db2e 100644
> --- a/posix/tst-rfc3484-3.c
> +++ b/nss/tst-rfc3484-3.c
> @@ -57,7 +57,7 @@ _res_hconf_init (void)
>  }
>  
>  #undef	USE_NSCD
> -#include "../sysdeps/posix/getaddrinfo.c"
> +#include "getaddrinfo.c"
>  
>  nss_action_list __nss_hosts_database attribute_hidden;
>  
> diff --git a/posix/tst-rfc3484.c b/nss/tst-rfc3484.c
> similarity index 98%
> rename from posix/tst-rfc3484.c
> rename to nss/tst-rfc3484.c
> index 3b2052eb54..5b4a0c5b82 100644
> --- a/posix/tst-rfc3484.c
> +++ b/nss/tst-rfc3484.c
> @@ -57,7 +57,7 @@ _res_hconf_init (void)
>  }
>  
>  #undef	USE_NSCD
> -#include "../sysdeps/posix/getaddrinfo.c"
> +#include "getaddrinfo.c"
>  
>  nss_action_list __nss_hosts_database attribute_hidden;
>  
> diff --git a/posix/Makefile b/posix/Makefile
> index be7d319394..3ab124d040 100644
> --- a/posix/Makefile
> +++ b/posix/Makefile
> @@ -88,7 +88,6 @@ routines := \
>    fpathconf \
>    gai_strerror \
>    get_child_max \
> -  getaddrinfo \
>    getegid \
>    geteuid \
>    getgid \
> @@ -287,9 +286,6 @@ tests := \
>    tst-fnmatch7 \
>    tst-fork \
>    tst-gai_strerror \
> -  tst-getaddrinfo \
> -  tst-getaddrinfo2 \
> -  tst-getaddrinfo3 \
>    tst-getopt_long1 \
>    tst-glob-tilde \
>    tst-glob_symlinks \
> @@ -351,9 +347,6 @@ tests-internal := \
>    bug-regex5 \
>    bug-regex20 \
>    bug-regex33 \
> -  tst-rfc3484 \
> -  tst-rfc3484-2 \
> -  tst-rfc3484-3 \
>    # tests-internal
>  
>  tests-container := \
> @@ -368,8 +361,6 @@ tests-time64 := \
>    # tests-time64
>  
>  xtests	:= \
> -  tst-getaddrinfo4 \
> -  tst-getaddrinfo5 \
>    tst-sched_rr_get_interval \
>    # xtests
>  
> @@ -556,7 +547,6 @@ $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make
>  	   '$(config-machine)-$(config-vendor)' > $@.new
>  	mv -f $@.new $@
>  
> -CFLAGS-getaddrinfo.c += -fexceptions
>  CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
>  CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
>  CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes)
> diff --git a/posix/Versions b/posix/Versions
> index 2eedbc3e79..b24c7c87ff 100644
> --- a/posix/Versions
> +++ b/posix/Versions
> @@ -34,7 +34,7 @@ libc {
>      fnmatch; fork; fpathconf; freeaddrinfo;
>  
>      # g*
> -    getaddrinfo; getdtablesize; getegid; geteuid; getgid; getopt; getopt_long;
> +    getdtablesize; getegid; geteuid; getgid; getopt; getopt_long;
>      getopt_long_only; getpgid; getpgrp; getpid; getppid; getsid; getuid; glob;
>      glob_pattern_p; globfree; group_member;
>  
> diff --git a/posix/getaddrinfo.c b/posix/getaddrinfo.c
> deleted file mode 100644
> index 0e36a4564c..0000000000
> --- a/posix/getaddrinfo.c
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -/* Stub version of getaddrinfo function.
> -   Copyright (C) 1996-2023 Free Software Foundation, Inc.
> -   This file is part of the GNU C Library.
> -
> -   The GNU C Library is free software; you can redistribute it and/or
> -   modify it under the terms of the GNU Lesser General Public
> -   License as published by the Free Software Foundation; either
> -   version 2.1 of the License, or (at your option) any later version.
> -
> -   The GNU C Library is distributed in the hope that it will be useful,
> -   but WITHOUT ANY WARRANTY; without even the implied warranty of
> -   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> -   Lesser General Public License for more details.
> -
> -   You should have received a copy of the GNU Lesser General Public
> -   License along with the GNU C Library; if not, see
> -   <https://www.gnu.org/licenses/>.  */
> -
> -#include <errno.h>
> -#include <netdb.h>
> -
> -int
> -getaddrinfo (const char *name, const char *service, const struct addrinfo *req,
> -	     struct addrinfo **pai)
> -{
> -  __set_errno (ENOSYS);
> -  return EAI_SYSTEM;
> -}
> -stub_warning (getaddrinfo)
> -libc_hidden_def (getaddrinfo)
> -
> -void
> -freeaddrinfo (struct addrinfo *ai)
> -{
> -  /* Nothing.  */
> -}
> -stub_warning (freeaddrinfo)
> -libc_hidden_def (freeaddrinfo)

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 16/16] Move getnameinfo from 'inet' to 'nss'
  2023-10-02 12:55 ` [PATCH 16/16] Move getnameinfo from 'inet' to 'nss' Arjun Shankar
@ 2023-10-20 15:08   ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 35+ messages in thread
From: Adhemerval Zanella Netto @ 2023-10-20 15:08 UTC (permalink / raw)
  To: libc-alpha



On 02/10/23 09:55, Arjun Shankar wrote:
> getnameinfo is an entry points for nss functionality.  This commit moves
> it from the 'inet' subdirectory to 'nss'.  The corresponding Versions
> entry is also moved from 'posix' into 'nss'.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  inet/Makefile               | 1 -
>  nss/Makefile                | 1 +
>  nss/Versions                | 3 +++
>  {inet => nss}/getnameinfo.c | 2 +-
>  posix/Versions              | 2 +-
>  5 files changed, 6 insertions(+), 3 deletions(-)
>  rename {inet => nss}/getnameinfo.c (99%)
> 
> diff --git a/inet/Makefile b/inet/Makefile
> index d275f51b3f..b691fef921 100644
> --- a/inet/Makefile
> +++ b/inet/Makefile
> @@ -47,7 +47,6 @@ routines := \
>    ether_ntoa \
>    ether_ntoa_r \
>    getipv4sourcefilter \
> -  getnameinfo \
>    getsourcefilter \
>    herrno \
>    herrno-loc \
> diff --git a/nss/Makefile b/nss/Makefile
> index da5bd207aa..213b68720b 100644
> --- a/nss/Makefile
> +++ b/nss/Makefile
> @@ -136,6 +136,7 @@ routines += \
>    gethstbynm_r \
>    gethstent \
>    gethstent_r \
> +  getnameinfo \
>    # routines
>  
>  ifeq ($(have-thread-library),yes)
> diff --git a/nss/Versions b/nss/Versions
> index 158a9175a4..d765e1d3b6 100644
> --- a/nss/Versions
> +++ b/nss/Versions
> @@ -58,6 +58,9 @@ libc {
>      ulckpwdf;
>    }
>    GLIBC_2.1 {
> +    # g*
> +    getnameinfo;
> +
>      # p*
>      putgrent;
>    }
> diff --git a/inet/getnameinfo.c b/nss/getnameinfo.c
> similarity index 99%
> rename from inet/getnameinfo.c
> rename to nss/getnameinfo.c
> index 40c20b4be6..062652c229 100644
> --- a/inet/getnameinfo.c
> +++ b/nss/getnameinfo.c
> @@ -71,7 +71,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>  #include <sys/utsname.h>
>  #include <libc-lock.h>
>  #include <scratch_buffer.h>
> -#include <net-internal.h>
> +#include <inet/net-internal.h>
>  #include <set-freeres.h>
>  
>  #ifndef min
> diff --git a/posix/Versions b/posix/Versions
> index b24c7c87ff..0624d24bcc 100644
> --- a/posix/Versions
> +++ b/posix/Versions
> @@ -72,7 +72,7 @@ libc {
>      __pread64; __pwrite64;
>  
>      # g*
> -    gai_strerror; getnameinfo; glob64; globfree64;
> +    gai_strerror; glob64; globfree64;
>  
>      # p*
>      pread; pread64; pwrite; pwrite64;

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 15/16] Move getaddrinfo from 'posix' into 'nss'
  2023-10-20 13:51   ` Adhemerval Zanella Netto
@ 2023-10-24 21:32     ` Joseph Myers
  2023-10-26 10:58       ` Arjun Shankar
  0 siblings, 1 reply; 35+ messages in thread
From: Joseph Myers @ 2023-10-24 21:32 UTC (permalink / raw)
  To: Adhemerval Zanella Netto; +Cc: Arjun Shankar, libc-alpha

This has broken the testsuite build for i686-gnu.

/scratch/jmyers/glibc-bot/install/compilers/i686-gnu/lib/gcc/i686-glibc-gnu/12.3.1/../../../../i686-glibc-gnu/bin/ld: 
/scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/nss/tst-rfc3484.o: undefined reference to symbol '__gsync_wait'
/scratch/jmyers/glibc-bot/install/compilers/i686-gnu/lib/gcc/i686-glibc-gnu/12.3.1/../../../../i686-glibc-gnu/bin/ld: 
/scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [../Rules:235: /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/nss/tst-rfc3484] Error 1

https://sourceware.org/pipermail/libc-testresults/2023q4/012009.html
https://sourceware.org/pipermail/libc-testresults/2023q4/012010.html

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH 15/16] Move getaddrinfo from 'posix' into 'nss'
  2023-10-24 21:32     ` Joseph Myers
@ 2023-10-26 10:58       ` Arjun Shankar
  0 siblings, 0 replies; 35+ messages in thread
From: Arjun Shankar @ 2023-10-26 10:58 UTC (permalink / raw)
  To: Joseph Myers; +Cc: Adhemerval Zanella Netto, libc-alpha

> This has broken the testsuite build for i686-gnu.
>
> /scratch/jmyers/glibc-bot/install/compilers/i686-gnu/lib/gcc/i686-glibc-gnu/12.3.1/../../../../i686-glibc-gnu/bin/ld:
> /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/nss/tst-rfc3484.o: undefined reference to symbol '__gsync_wait'
> /scratch/jmyers/glibc-bot/install/compilers/i686-gnu/lib/gcc/i686-glibc-gnu/12.3.1/../../../../i686-glibc-gnu/bin/ld:
> /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.so.1: error adding symbols: DSO missing from command line
> collect2: error: ld returned 1 exit status
> make[3]: *** [../Rules:235: /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/nss/tst-rfc3484] Error 1

Thanks Joseph. I expect to post a fix for this soon.

--
Arjun Shankar
he/him/his


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2023-10-26 10:59 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-02 12:55 [PATCH 00/16] Consolidate NSS functionality into nss subdir Arjun Shankar
2023-10-02 12:55 ` [PATCH 01/16] inet: Rearrange and sort Makefile variables Arjun Shankar
2023-10-02 14:11   ` Siddhesh Poyarekar
2023-10-02 12:55 ` [PATCH 02/16] nss: " Arjun Shankar
2023-10-02 14:12   ` Siddhesh Poyarekar
2023-10-02 12:55 ` [PATCH 03/16] Remove 'grp' and merge into 'nss' and 'posix' Arjun Shankar
2023-10-19 17:55   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 04/16] Remove 'gshadow' and merge into 'nss' Arjun Shankar
2023-10-19 18:15   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 05/16] Remove 'pwd' " Arjun Shankar
2023-10-19 18:29   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 06/16] Remove 'shadow' " Arjun Shankar
2023-10-19 18:44   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 07/16] Move 'aliases' routines from 'inet' " Arjun Shankar
2023-10-19 19:23   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 08/16] Move 'ethers' " Arjun Shankar
2023-10-19 19:39   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 09/16] Move 'hosts' " Arjun Shankar
2023-10-19 19:53   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 10/16] Move 'netgroup' " Arjun Shankar
2023-10-20 12:00   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 11/16] Move 'networks' " Arjun Shankar
2023-10-20 12:17   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 12/16] Move 'protocols' " Arjun Shankar
2023-10-20 12:32   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 13/16] Move 'rpc' " Arjun Shankar
2023-10-20 12:49   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 14/16] Move 'services' " Arjun Shankar
2023-10-20 13:19   ` Adhemerval Zanella Netto
2023-10-02 12:55 ` [PATCH 15/16] Move getaddrinfo from 'posix' " Arjun Shankar
2023-10-20 13:51   ` Adhemerval Zanella Netto
2023-10-24 21:32     ` Joseph Myers
2023-10-26 10:58       ` Arjun Shankar
2023-10-02 12:55 ` [PATCH 16/16] Move getnameinfo from 'inet' to 'nss' Arjun Shankar
2023-10-20 15:08   ` Adhemerval Zanella Netto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).