From: Alejandro Colomar Date: Sun, 10 Nov 2024 17:07:59 +0000 (+0100) Subject: lib/shadow/, lib/, src/: struct sgrp: Move to separate file X-Git-Tag: 4.19.0-rc1~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a272e720f50c8069ba684d5874d0b419fcca54b;p=thirdparty%2Fshadow.git lib/shadow/, lib/, src/: struct sgrp: Move to separate file Signed-off-by: Alejandro Colomar --- diff --git a/lib/Makefile.am b/lib/Makefile.am index 61025b887..5138d5b52 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -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 \ diff --git a/lib/gshadow.c b/lib/gshadow.c index b80a82fe2..072f4d475 100644 --- a/lib/gshadow.c +++ b/lib/gshadow.c @@ -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" diff --git a/lib/gshadow_.h b/lib/gshadow_.h index 66f7a9061..63223e962 100644 --- a/lib/gshadow_.h +++ b/lib/gshadow_.h @@ -13,23 +13,14 @@ # include #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 #include /* 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 *); diff --git a/lib/prototypes.h b/lib/prototypes.h index 4063ae164..d8a88e372 100644 --- a/lib/prototypes.h +++ b/lib/prototypes.h @@ -34,6 +34,8 @@ #include "attr.h" #include "defines.h" #include "commonio.h" +#include "shadow/gshadow/sgrp.h" + /* addgrps.c */ #if !defined(USE_PAM) diff --git a/lib/sgroupio.c b/lib/sgroupio.c index 7c363b083..f191d7d06 100644 --- a/lib/sgroupio.c +++ b/lib/sgroupio.c @@ -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" diff --git a/lib/sgroupio.h b/lib/sgroupio.h index 3474a985b..d37526f5e 100644 --- a/lib/sgroupio.h +++ b/lib/sgroupio.h @@ -12,6 +12,12 @@ #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); diff --git a/lib/shadow/gshadow/putsgent.c b/lib/shadow/gshadow/putsgent.c index 4ddd5f3f2..cd8dc024b 100644 --- a/lib/shadow/gshadow/putsgent.c +++ b/lib/shadow/gshadow/putsgent.c @@ -17,6 +17,7 @@ #include "alloc/malloc.h" #include "prototypes.h" +#include "shadow/gshadow/sgrp.h" /* diff --git a/lib/shadow/gshadow/putsgent.h b/lib/shadow/gshadow/putsgent.h index ad6fe3933..22ed38ea7 100644 --- a/lib/shadow/gshadow/putsgent.h +++ b/lib/shadow/gshadow/putsgent.h @@ -13,7 +13,7 @@ #include -#include "gshadow_.h" +#include "shadow/gshadow/sgrp.h" #if __has_include() diff --git a/lib/shadow/gshadow/sgrp.c b/lib/shadow/gshadow/sgrp.c new file mode 100644 index 000000000..5c0d186bc --- /dev/null +++ b/lib/shadow/gshadow/sgrp.c @@ -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 +// 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 index 000000000..ae63f2e56 --- /dev/null +++ b/lib/shadow/gshadow/sgrp.h @@ -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 +// 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() +# include +#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 diff --git a/src/chgpasswd.c b/src/chgpasswd.c index 6f0e2753c..c0017e338 100644 --- a/src/chgpasswd.c +++ b/src/chgpasswd.c @@ -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" diff --git a/src/gpasswd.c b/src/gpasswd.c index e6d0cf472..a64c27017 100644 --- a/src/gpasswd.c +++ b/src/gpasswd.c @@ -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" diff --git a/src/groupadd.c b/src/groupadd.c index 4cb90719c..8210388bd 100644 --- a/src/groupadd.c +++ b/src/groupadd.c @@ -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" diff --git a/src/groupmems.c b/src/groupmems.c index fb1e4b30d..68a186730 100644 --- a/src/groupmems.c +++ b/src/groupmems.c @@ -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" diff --git a/src/groupmod.c b/src/groupmod.c index 5b42135ba..20c063058 100644 --- a/src/groupmod.c +++ b/src/groupmod.c @@ -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" diff --git a/src/grpck.c b/src/grpck.c index 533466cd3..2a6a11ee9 100644 --- a/src/grpck.c +++ b/src/grpck.c @@ -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" diff --git a/src/grpconv.c b/src/grpconv.c index 9b198a4c4..64b2157d2 100644 --- a/src/grpconv.c +++ b/src/grpconv.c @@ -36,6 +36,7 @@ #ifdef SHADOWGRP #include "groupio.h" #include "sgroupio.h" +#include "shadow/gshadow/sgrp.h" #include "shadowlog.h" #include "sssd.h" diff --git a/src/grpunconv.c b/src/grpunconv.c index 1f1b45b0c..4a822f7ed 100644 --- a/src/grpunconv.c +++ b/src/grpunconv.c @@ -36,6 +36,7 @@ #include "groupio.h" #include "sgroupio.h" #include "shadow/gshadow/gshadow.h" +#include "shadow/gshadow/sgrp.h" #include "shadowlog.h" diff --git a/src/newgrp.c b/src/newgrp.c index 91cede727..e154aba7a 100644 --- a/src/newgrp.c +++ b/src/newgrp.c @@ -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" diff --git a/src/newusers.c b/src/newusers.c index cce72f6c6..a4c374da1 100644 --- a/src/newusers.c +++ b/src/newusers.c @@ -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" diff --git a/src/useradd.c b/src/useradd.c index 5b6a9d273..586333a35 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -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" diff --git a/src/userdel.c b/src/userdel.c index 5b1a8a866..3e5b5b582 100644 --- a/src/userdel.c +++ b/src/userdel.c @@ -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" diff --git a/src/usermod.c b/src/usermod.c index 47c254750..17288d07b 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -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"