From 2c4c72a221da915e41d4fc0a1a6e3552bb57fdf3 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 10 Nov 2024 23:14:28 +0100 Subject: [PATCH] lib/shadow/, lib/, po/: sgetgrent(): Move to under lib/shadow/group/ Signed-off-by: Alejandro Colomar --- lib/Makefile.am | 3 ++- lib/groupio.c | 1 + lib/prototypes.h | 3 --- lib/{ => shadow/group}/sgetgrent.c | 18 +++++++++--------- lib/shadow/group/sgetgrent.h | 17 +++++++++++++++++ po/POTFILES.in | 2 +- 6 files changed, 30 insertions(+), 14 deletions(-) rename lib/{ => shadow/group}/sgetgrent.c (78%) create mode 100644 lib/shadow/group/sgetgrent.h diff --git a/lib/Makefile.am b/lib/Makefile.am index d5ec99a07..25c915b50 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -166,11 +166,12 @@ libshadow_la_SOURCES = \ semanage.c \ setugid.c \ setupenv.c \ - sgetgrent.c \ sgetpwent.c \ sgetspent.c \ sgroupio.c \ sgroupio.h \ + shadow/group/sgetgrent.c \ + shadow/group/sgetgrent.h \ shadow/grp/agetgroups.c \ shadow/grp/agetgroups.h \ shadow/gshadow/endsgent.c \ diff --git a/lib/groupio.c b/lib/groupio.c index ac1a5d637..0af395a95 100644 --- a/lib/groupio.c +++ b/lib/groupio.c @@ -23,6 +23,7 @@ #include "getdef.h" #include "groupio.h" #include "prototypes.h" +#include "shadow/group/sgetgrent.h" #include "string/sprintf/aprintf.h" #include "string/strcmp/streq.h" diff --git a/lib/prototypes.h b/lib/prototypes.h index d8a88e372..2d20395ed 100644 --- a/lib/prototypes.h +++ b/lib/prototypes.h @@ -397,9 +397,6 @@ extern void setup (struct passwd *); /* setupenv.c */ extern void setup_env (struct passwd *); -/* sgetgrent.c */ -extern struct group *sgetgrent (const char *buf); - /* sgetpwent.c */ extern struct passwd *sgetpwent (const char *buf); diff --git a/lib/sgetgrent.c b/lib/shadow/group/sgetgrent.c similarity index 78% rename from lib/sgetgrent.c rename to lib/shadow/group/sgetgrent.c index f2f3f838b..744a8f5cb 100644 --- a/lib/sgetgrent.c +++ b/lib/shadow/group/sgetgrent.c @@ -1,15 +1,14 @@ -/* - * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh - * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz - * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko - * SPDX-FileCopyrightText: 2008 , Nicolas François - * - * SPDX-License-Identifier: BSD-3-Clause - */ +// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh +// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz +// SPDX-FileCopyrightText: 2005, Tomasz Kłoczko +// SPDX-FileCopyrightText: 2008, Nicolas François +// SPDX-FileCopyrightText: 2024, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause + #include "config.h" -#ident "$Id$" +#include "shadow/group/sgetgrent.h" #include #include @@ -56,6 +55,7 @@ list(char *s) } +// from-string get group entry struct group * sgetgrent(const char *s) { diff --git a/lib/shadow/group/sgetgrent.h b/lib/shadow/group/sgetgrent.h new file mode 100644 index 000000000..fcf016605 --- /dev/null +++ b/lib/shadow/group/sgetgrent.h @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: 2024, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause + + +#ifndef SHADOW_INCLUDE_LIB_SHADOW_GROUP_SGETGRENT_H_ +#define SHADOW_INCLUDE_LIB_SHADOW_GROUP_SGETGRENT_H_ + + +#include "config.h" + +#include + + +struct group *sgetgrent(const char *s); + + +#endif // include guard diff --git a/po/POTFILES.in b/po/POTFILES.in index 614415c23..af5cfa5df 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -56,10 +56,10 @@ lib/selinux.c lib/semanage.c lib/setugid.c lib/setupenv.c -lib/sgetgrent.c lib/sgetpwent.c lib/sgetspent.c lib/sgroupio.c +lib/shadow/group/sgetgrent.c lib/shadowio.c lib/shadowmem.c lib/shell.c -- 2.47.3