Skip to content

Commit 2d04f25

Browse files
lib/, po/: sgetgrent(): Move to under lib/shadow/group/
Signed-off-by: Alejandro Colomar <[email protected]>
1 parent a2b7759 commit 2d04f25

File tree

6 files changed

+33
-16
lines changed

6 files changed

+33
-16
lines changed

lib/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,13 @@ libshadow_la_SOURCES = \
166166
semanage.c \
167167
setugid.c \
168168
setupenv.c \
169-
sgetgrent.c \
170169
sgetpwent.c \
171170
sgetspent.c \
172171
sgroupio.c \
173172
sgroupio.h \
174173
shadow.c \
174+
shadow/group/sgetgrent.c \
175+
shadow/group/sgetgrent.h \
175176
shadow/grp/agetgroups.c \
176177
shadow/grp/agetgroups.h \
177178
shadow/gshadow/endsgent.c \

lib/groupio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "getdef.h"
2323
#include "groupio.h"
2424
#include "prototypes.h"
25+
#include "shadow/group/sgetgrent.h"
2526
#include "string/strcmp/streq.h"
2627

2728

lib/prototypes.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,6 @@ extern void setup (struct passwd *);
398398
/* setupenv.c */
399399
extern void setup_env (struct passwd *);
400400

401-
/* sgetgrent.c */
402-
extern struct group *sgetgrent (const char *buf);
403-
404401
/* sgetpwent.c */
405402
extern struct passwd *sgetpwent (const char *buf);
406403

lib/sgetgrent.c renamed to lib/shadow/group/sgetgrent.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
/*
2-
* SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
3-
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
4-
* SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
5-
* SPDX-FileCopyrightText: 2008 , Nicolas François
6-
*
7-
* SPDX-License-Identifier: BSD-3-Clause
8-
*/
1+
// SPDX-FileCopyrightText: 1990-1994, Julianne Frances Haugh
2+
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
3+
// SPDX-FileCopyrightText: 2005, Tomasz Kłoczko
4+
// SPDX-FileCopyrightText: 2008, Nicolas François
5+
// SPDX-FileCopyrightText: 2024, Alejandro Colomar <[email protected]>
6+
// SPDX-License-Identifier: BSD-3-Clause
7+
98

109
#include <config.h>
1110

12-
#ident "$Id$"
11+
#include "shadow/group/sgetgrent.h"
1312

1413
#include <stdio.h>
1514
#include <sys/types.h>
@@ -27,6 +26,7 @@
2726

2827
#define NFIELDS 4
2928

29+
3030
/*
3131
* list - turn a comma-separated string into an array of (char *)'s
3232
*
@@ -64,7 +64,9 @@ list(char *s)
6464
}
6565

6666

67-
struct group *sgetgrent (const char *buf)
67+
// from-string get group entry
68+
struct group *
69+
sgetgrent(const char *buf)
6870
{
6971
static char *grpbuf = NULL;
7072
static size_t size = 0;
@@ -105,4 +107,3 @@ struct group *sgetgrent (const char *buf)
105107

106108
return &grent;
107109
}
108-

lib/shadow/group/sgetgrent.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// SPDX-FileCopyrightText: 2024, Alejandro Colomar <[email protected]>
2+
// SPDX-License-Identifier: BSD-3-Clause
3+
4+
5+
#ifndef SHADOW_INCLUDE_LIB_SHADOW_GROUP_SGETGRENT_H_
6+
#define SHADOW_INCLUDE_LIB_SHADOW_GROUP_SGETGRENT_H_
7+
8+
9+
#include <config.h>
10+
11+
#include <grp.h>
12+
13+
14+
struct group *sgetgrent(const char *s);
15+
16+
17+
#endif // include guard

po/POTFILES.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ lib/selinux.c
5656
lib/semanage.c
5757
lib/setugid.c
5858
lib/setupenv.c
59-
lib/sgetgrent.c
6059
lib/sgetpwent.c
6160
lib/sgetspent.c
6261
lib/sgroupio.c
6362
lib/shadow.c
63+
lib/shadow/group/sgetgrent.c
6464
lib/shadowio.c
6565
lib/shadowmem.c
6666
lib/shell.c

0 commit comments

Comments
 (0)