]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/shadow/, lib/, src/: struct sgrp: Move to separate file
authorAlejandro Colomar <alx@kernel.org>
Sun, 10 Nov 2024 17:07:59 +0000 (18:07 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Tue, 7 Oct 2025 09:03:09 +0000 (11:03 +0200)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
23 files changed:
lib/Makefile.am
lib/gshadow.c
lib/gshadow_.h
lib/prototypes.h
lib/sgroupio.c
lib/sgroupio.h
lib/shadow/gshadow/putsgent.c
lib/shadow/gshadow/putsgent.h
lib/shadow/gshadow/sgrp.c [new file with mode: 0644]
lib/shadow/gshadow/sgrp.h [new file with mode: 0644]
src/chgpasswd.c
src/gpasswd.c
src/groupadd.c
src/groupmems.c
src/groupmod.c
src/grpck.c
src/grpconv.c
src/grpunconv.c
src/newgrp.c
src/newusers.c
src/useradd.c
src/userdel.c
src/usermod.c

index 61025b8876d8a26fb99538c64fec4117d4f0453d..5138d5b525f1748833006a277c24cacf29f861bd 100644 (file)
@@ -182,6 +182,8 @@ libshadow_la_SOURCES = \
        shadow/gshadow/putsgent.h \
        shadow/gshadow/setsgent.c \
        shadow/gshadow/setsgent.h \
+       shadow/gshadow/sgrp.c \
+       shadow/gshadow/sgrp.h \
        shadowio.c \
        shadowio.h \
        shadowlog.c \
index b80a82fe2542c7c9e178342373084a36573e321d..072f4d475ac31d953830e9630bb181d044f8a68a 100644 (file)
@@ -24,6 +24,7 @@
 #include "prototypes.h"
 #include "shadow/gshadow/gshadow.h"
 #include "shadow/gshadow/setsgent.h"
+#include "shadow/gshadow/sgrp.h"
 #include "string/strcmp/streq.h"
 #include "string/strtok/stpsep.h"
 #include "string/strtok/strsep2arr.h"
index 66f7a90612536beaa76b97586f8e89d1d7c5ad51..63223e962f17352d7b2a571365489c21a0b2b598 100644 (file)
 # include <gshadow.h>
 #else
 
-/*
- * Shadow group security file structure
- */
 
-struct sgrp {
-       char *sg_namp;          /* group name */
-       char *sg_passwd;        /* group password */
-       char **sg_adm;          /* group administrator list */
-       char **sg_mem;          /* group membership list */
-};
-
-/*
- * Shadow group security file functions.
- */
+#include <config.h>
 
 #include <stdio.h>             /* for FILE */
 
+#include "shadow/gshadow/sgrp.h"
+
+
 /*@observer@*//*@null@*/struct sgrp *getsgent (void);
 /*@observer@*//*@null@*/struct sgrp *getsgnam (const char *);
 /*@observer@*//*@null@*/struct sgrp *sgetsgent (const char *);
index 4063ae164429162b809cda769dcfb2cf8cb26e86..d8a88e372be0102cf4d687f78d5a27aa6c0c7e67 100644 (file)
@@ -34,6 +34,8 @@
 #include "attr.h"
 #include "defines.h"
 #include "commonio.h"
+#include "shadow/gshadow/sgrp.h"
+
 
 /* addgrps.c */
 #if !defined(USE_PAM)
index 7c363b083eb4643d315603d1f3cf4f7c445a92b0..f191d7d06a50809ee2512dbfc7686e572f4e1ede 100644 (file)
@@ -24,6 +24,7 @@
 #include "sgroupio.h"
 #include "shadow/gshadow/gshadow.h"
 #include "shadow/gshadow/putsgent.h"
+#include "shadow/gshadow/sgrp.h"
 #include "string/memset/memzero.h"
 
 
index 3474a985bca63cc52e5e6482ab8fa73a8980e157..d37526f5ea151db05dfcf19f23dd21acea2c0069 100644 (file)
 #ifndef _SGROUPIO_H
 #define _SGROUPIO_H
 
+
+#include "config.h"
+
+#include "shadow/gshadow/sgrp.h"
+
+
 extern int sgr_close (void);
 extern bool sgr_file_present (void);
 extern /*@observer@*/ /*@null@*/const struct sgrp *sgr_locate (const char *name);
index 4ddd5f3f2f3ab6175c67724917310c0aea1831ed..cd8dc024b4a636327bede42192572cb953aa2aeb 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "alloc/malloc.h"
 #include "prototypes.h"
+#include "shadow/gshadow/sgrp.h"
 
 
 /*
index ad6fe39337b517ee03461f1515050050fd58d45e..22ed38ea73844d8e12973c5ee8f0da631cfe4bf2 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <stdio.h>
 
-#include "gshadow_.h"
+#include "shadow/gshadow/sgrp.h"
 
 
 #if __has_include(<gshadow.h>)
diff --git a/lib/shadow/gshadow/sgrp.c b/lib/shadow/gshadow/sgrp.c
new file mode 100644 (file)
index 0000000..5c0d186
--- /dev/null
@@ -0,0 +1,11 @@
+// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
+// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
+// SPDX-FileCopyrightText: 2005, Tomasz Kłoczko
+// SPDX-FileCopyrightText: 2008-2009, Nicolas François
+// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#include "config.h"
+
+#include "shadow/gshadow/sgrp.h"
diff --git a/lib/shadow/gshadow/sgrp.h b/lib/shadow/gshadow/sgrp.h
new file mode 100644 (file)
index 0000000..ae63f2e
--- /dev/null
@@ -0,0 +1,27 @@
+// SPDX-FileCopyrightText: 1988-1994, Julianne Frances Haugh
+// SPDX-FileCopyrightText: 1996-1997, Marek Michałkiewicz
+// SPDX-FileCopyrightText: 2003-2005, Tomasz Kłoczko
+// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#ifndef SHADOW_INCLUDE_LIB_SHADOW_GSHADOW_SGRP_H_
+#define SHADOW_INCLUDE_LIB_SHADOW_GSHADOW_SGRP_H_
+
+
+#include "config.h"
+
+
+#if __has_include(<gshadow.h>)
+# include <gshadow.h>
+#else
+struct sgrp {
+       char *sg_namp;          /* group name */
+       char *sg_passwd;        /* group password */
+       char **sg_adm;          /* group administrator list */
+       char **sg_mem;          /* group membership list */
+};
+#endif
+
+
+#endif  // include guard
index 6f0e2753ce2f4cbec391e894e37e438df9db5fb7..c0017e3380b5641fecbaf73c761d9cbdb905f07d 100644 (file)
@@ -34,6 +34,7 @@
 #endif
 /*@-exitarg@*/
 #include "exitcodes.h"
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "string/strcmp/streq.h"
 #include "string/strtok/stpsep.h"
index e6d0cf472ea93a01334959baaace9c5c566ee995..a64c270178abf6f6e5e8c09a2ea6f2546ad7a5f5 100644 (file)
@@ -32,6 +32,7 @@
 #ifdef SHADOWGRP
 #include "sgroupio.h"
 #endif
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "sssd.h"
 #include "string/memset/memzero.h"
index 4cb90719c23d1c1de7dc3780b627fd469f74cb0a..8210388bd3dd288301d5d300028f51a71dc334a8 100644 (file)
@@ -37,6 +37,7 @@
 #ifdef SHADOWGRP
 #include "sgroupio.h"
 #endif
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "string/memset/memzero.h"
 #include "string/strtok/stpsep.h"
index fb1e4b30d4903fe0f2662c0a5c762db571dc29be..68a186730ebea98b39979e24d6af1ec14423a88c 100644 (file)
@@ -26,6 +26,7 @@
 #ifdef SHADOWGRP
 #include "sgroupio.h"
 #endif
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "string/strcmp/streq.h"
 #include "string/strdup/xstrdup.h"
index 5b42135ba323b9c8dfe50b2f7d51f0efa0d3125a..20c063058a366844f4d79c255ede727c166753cc 100644 (file)
@@ -38,6 +38,7 @@
 #ifdef SHADOWGRP
 #include "sgroupio.h"
 #endif
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "sssd.h"
 #include "string/sprintf/stpeprintf.h"
index 533466cd3f42df116120049ffd71c6a81f324a26..2a6a11ee9b297a48073f2605c854711e8e066341 100644 (file)
@@ -24,6 +24,7 @@
 #include "nscd.h"
 #include "prototypes.h"
 #include "shadow/gshadow/gshadow.h"
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "sssd.h"
 #include "string/strcmp/streq.h"
index 9b198a4c4931aa9bcf33c3ff91e91228c02d4cf9..64b2157d2296e2951b12acb813be53953adef11f 100644 (file)
@@ -36,6 +36,7 @@
 #ifdef SHADOWGRP
 #include "groupio.h"
 #include "sgroupio.h"
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "sssd.h"
 
index 1f1b45b0c17f35341f0578fd1d5585a841ff63d4..4a822f7ed5b78679b1d1b411a2cd0b172f6ba5d4 100644 (file)
@@ -36,6 +36,7 @@
 #include "groupio.h"
 #include "sgroupio.h"
 #include "shadow/gshadow/gshadow.h"
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 
 
index 91cede727b99612fa90e56bf4eee8576864c7fb7..e154aba7a86f5ff6dba2e336d04b21ac9cdef370 100644 (file)
@@ -28,6 +28,7 @@
 #include "search/l/lsearch.h"
 #include "shadow/grp/agetgroups.h"
 #include "shadow/gshadow/endsgent.h"
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "string/sprintf/snprintf.h"
 #include "string/strcmp/streq.h"
index cce72f6c6247eb8d190a31b8496125644f13ce23..a4c374da1cf8a9a21f5b4335c55cd4c2baf6fe00 100644 (file)
@@ -52,6 +52,7 @@
 #ifdef ENABLE_SUBIDS
 #include "subordinateio.h"
 #endif                         /* ENABLE_SUBIDS */
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "sssd.h"
 #include "string/sprintf/snprintf.h"
index 5b6a9d2737044f89d449373afec736bf11aa9843..586333a355a47f3340de7c6116af6f28d1a9eab1 100644 (file)
@@ -64,6 +64,7 @@
 #ifdef WITH_TCB
 #include "tcbfuncs.h"
 #endif
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "sssd.h"
 #include "string/memset/memzero.h"
index 5b1a8a86635e12eaef34faa6c935f9ac878671f2..3e5b5b5825a11534ef85bd65952c6bd72aac5c87 100644 (file)
@@ -50,6 +50,7 @@
 #ifdef ENABLE_SUBIDS
 #include "subordinateio.h"
 #endif                         /* ENABLE_SUBIDS */
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "string/sprintf/aprintf.h"
 #include "string/sprintf/xaprintf.h"
index 47c254750f6fa566ddc2dbf6e022030ddc515885..17288d07b331e2abde34ecf0d319c3449a7c1682 100644 (file)
@@ -61,6 +61,7 @@
 #include "tcbfuncs.h"
 #endif
 #include "shadow/gshadow/endsgent.h"
+#include "shadow/gshadow/sgrp.h"
 #include "shadowlog.h"
 #include "sssd.h"
 #include "string/memset/memzero.h"