]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/, src/: Move prototypes of "lib/fields.c" to "lib/fields.h"
authorAlejandro Colomar <alx@kernel.org>
Tue, 3 Jun 2025 07:06:54 +0000 (09:06 +0200)
committerSerge Hallyn <serge@hallyn.com>
Tue, 3 Jun 2025 14:04:01 +0000 (09:04 -0500)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/Makefile.am
lib/fields.c
lib/fields.h [new file with mode: 0644]
lib/groupio.c
lib/prototypes.h
lib/pwio.c
lib/sgroupio.c
lib/shadowio.c
src/chage.c
src/chfn.c
src/chsh.c

index 42a439b4150f681f10444f8c029b6f826adcb983..b492d420bacd5f3e659dbdffb90c9f23fb612db1 100644 (file)
@@ -94,6 +94,7 @@ libshadow_la_SOURCES = \
        failure.h \
        fd.c \
        fields.c \
+       fields.h \
        find_new_gid.c \
        find_new_uid.c \
        find_new_sub_gids.c \
index ef828374154b3a7b0af0f800dd2565cd9788ee26..06e741da122a419986bf43bcc81baf6786972c0a 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <config.h>
 
-#ident "$Id$"
+#include "fields.h"
 
 #include <ctype.h>
 #include <string.h>
diff --git a/lib/fields.h b/lib/fields.h
new file mode 100644 (file)
index 0000000..293d9bd
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-FileCopyrightText: 2025, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+#ifndef _SHADOW_INCLUDE_LIB_FIELDS_H_
+#define _SHADOW_INCLUDE_LIB_FIELDS_H_
+
+
+#include <config.h>
+
+#include <stddef.h>
+
+
+int valid_field(const char *field, const char *illegal);
+void change_field(char *buf, size_t maxsize, const char *prompt);
+
+
+#endif  // include guard
index 516e3ccd243258d5f6ef8073bfc234be239e4702..a4348a1c731156d8795aee818b8d45d33e1bb955 100644 (file)
@@ -19,6 +19,7 @@
 #include "alloc/malloc.h"
 #include "commonio.h"
 #include "defines.h"
+#include "fields.h"
 #include "getdef.h"
 #include "groupio.h"
 #include "prototypes.h"
index 003fef049d38df808543e4173b8dc564f65d11fd..d35c38f8129ba1a783e6d3132da1b7af7174a840 100644 (file)
@@ -120,10 +120,6 @@ extern void sanitize_env (void);
 /* fd.c */
 extern void check_fds (void);
 
-/* fields.c */
-extern void change_field (char *, size_t, const char *);
-extern int valid_field (const char *, const char *);
-
 /* find_new_gid.c */
 extern int find_new_gid (bool sys_group,
                          gid_t *gid,
index 3497c7545e9f7805660d2b1da70145ed53ace6e1..415447d60923bf13da9df1c52b39e0605974c419 100644 (file)
 
 #include <config.h>
 
-#ident "$Id$"
-
-#include "prototypes.h"
-#include "defines.h"
 #include <pwd.h>
 #include <stdio.h>
+
 #include "commonio.h"
+#include "defines.h"
+#include "fields.h"
+#include "prototypes.h"
 #include "pwio.h"
 
 static /*@null@*/ /*@only@*/void *passwd_dup (const void *ent)
index 9805761248ed96baaf27d178f1cc2d8bf51a61c5..ef82976d0bcd5a20e02a1f207c4cda0507dfd651 100644 (file)
@@ -19,6 +19,7 @@
 #include "prototypes.h"
 #include "defines.h"
 #include "commonio.h"
+#include "fields.h"
 #include "getdef.h"
 #include "sgroupio.h"
 #include "string/memset/memzero.h"
index d2c3b4730b76e11b42027214e46e2d19799c0bb8..8b1c1d2c1d774564416e6d3b59d792d86508f001 100644 (file)
 
 #include <config.h>
 
-#ident "$Id$"
-
-#include "prototypes.h"
-#include "defines.h"
 #include <shadow.h>
 #include <stdio.h>
+
 #include "commonio.h"
+#include "defines.h"
+#include "fields.h"
 #include "getdef.h"
+#include "prototypes.h"
 #include "shadowio.h"
+
 #ifdef WITH_TCB
 #include <tcb.h>
 #include "tcbfuncs.h"
 #endif                         /* WITH_TCB */
 
+
 static /*@null@*/ /*@only@*/void *shadow_dup (const void *ent)
 {
        const struct spwd *sp = ent;
index 49ca4750777765fd604af748795d27780a734564..4b9c96d692540cff0db48335ae385ce921a5fe40 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "atoi/a2i/a2s.h"
 #include "defines.h"
+#include "fields.h"
 #include "prototypes.h"
 #include "pwio.h"
 #include "shadowio.h"
index 834a0a277129b7fa4fc3eed2f3fd8474551a2f17..5850292963299ffbee5f97e019fd6ab8834ee99f 100644 (file)
@@ -22,6 +22,7 @@
 #include "defines.h"
 /*@-exitarg@*/
 #include "exitcodes.h"
+#include "fields.h"
 #include "getdef.h"
 #include "nscd.h"
 #ifdef USE_PAM
index b45dca7143777ef5e122889c5af983ff7800deb6..236ff7846ae02a965b111ac638be2b10ac3e9716 100644 (file)
@@ -21,6 +21,7 @@
 #include "defines.h"
 /*@-exitarg@*/
 #include "exitcodes.h"
+#include "fields.h"
 #include "getdef.h"
 #include "nscd.h"
 #include "prototypes.h"