]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove 'pwd' and merge into 'nss'
authorArjun Shankar <arjun@redhat.com>
Mon, 2 Oct 2023 12:55:17 +0000 (14:55 +0200)
committerArjun Shankar <arjun@redhat.com>
Tue, 24 Oct 2023 10:30:59 +0000 (12:30 +0200)
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.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
19 files changed:
Makeconfig
include/pwd.h
nss/Makefile
nss/Versions
nss/fgetpwent.c [moved from pwd/fgetpwent.c with 100% similarity]
nss/fgetpwent_r.c [moved from pwd/fgetpwent_r.c with 100% similarity]
nss/getpw.c [moved from pwd/getpw.c with 100% similarity]
nss/getpwent.c [moved from pwd/getpwent.c with 100% similarity]
nss/getpwent_r.c [moved from pwd/getpwent_r.c with 100% similarity]
nss/getpwnam.c [moved from pwd/getpwnam.c with 100% similarity]
nss/getpwnam_r.c [moved from pwd/getpwnam_r.c with 100% similarity]
nss/getpwuid.c [moved from pwd/getpwuid.c with 100% similarity]
nss/getpwuid_r.c [moved from pwd/getpwuid_r.c with 100% similarity]
nss/putpwent.c [moved from pwd/putpwent.c with 100% similarity]
nss/pwd.h [moved from pwd/pwd.h with 100% similarity]
nss/tst-getpw.c [moved from pwd/tst-getpw.c with 100% similarity]
nss/tst-putpwent.c [moved from pwd/tst-putpwent.c with 100% similarity]
pwd/Makefile [deleted file]
pwd/Versions [deleted file]

index ac7fa3dbb34b00738fd250961ab97d5abba39587..e5badddbc4cdf79c4909728abbf58b4f1c973f08 100644 (file)
@@ -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
index f8975d4957f68c880c23c3a36db94d788479f795..c4ca8bab33c8d74a74198b0f09d0f0113700e26b 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef _PWD_H
-#include <pwd/pwd.h>
+#include <nss/pwd.h>
 
 #ifndef _ISOMAC
 /* Now define the internal interfaces.  */
index 5256b90f8b57f7d0a20201c307a284cce81ef52c..28648ea884324e9d2f87bef6b60551d4c59b8a4e 100644 (file)
@@ -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
index 6204ac0af1ccceb3936e8b333e10fab590f8dcf0..58ca73c9df8c1b4fc18ffb6aa05ca1cc931fa242 100644 (file)
@@ -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;
similarity index 100%
rename from pwd/fgetpwent.c
rename to nss/fgetpwent.c
similarity index 100%
rename from pwd/fgetpwent_r.c
rename to nss/fgetpwent_r.c
similarity index 100%
rename from pwd/getpw.c
rename to nss/getpw.c
similarity index 100%
rename from pwd/getpwent.c
rename to nss/getpwent.c
similarity index 100%
rename from pwd/getpwent_r.c
rename to nss/getpwent_r.c
similarity index 100%
rename from pwd/getpwnam.c
rename to nss/getpwnam.c
similarity index 100%
rename from pwd/getpwnam_r.c
rename to nss/getpwnam_r.c
similarity index 100%
rename from pwd/getpwuid.c
rename to nss/getpwuid.c
similarity index 100%
rename from pwd/getpwuid_r.c
rename to nss/getpwuid_r.c
similarity index 100%
rename from pwd/putpwent.c
rename to nss/putpwent.c
similarity index 100%
rename from pwd/pwd.h
rename to nss/pwd.h
similarity index 100%
rename from pwd/tst-getpw.c
rename to nss/tst-getpw.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 (file)
index d85842a..0000000
+++ /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 (file)
index b569700..0000000
+++ /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;
-  }
-}