Skip to content

Commit c27bde0

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

File tree

6 files changed

+32
-15
lines changed

6 files changed

+32
-15
lines changed

lib/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ libshadow_la_SOURCES = \
166166
semanage.c \
167167
setugid.c \
168168
setupenv.c \
169-
sgetpwent.c \
170169
sgetspent.c \
171170
sgroupio.c \
172171
sgroupio.h \
@@ -193,6 +192,8 @@ libshadow_la_SOURCES = \
193192
shadow/gshadow/sgetsgent.h \
194193
shadow/gshadow/sgrp.c \
195194
shadow/gshadow/sgrp.h \
195+
shadow/passwd/sgetpwent.c \
196+
shadow/passwd/sgetpwent.h \
196197
shadowio.c \
197198
shadowio.h \
198199
shadowlog.c \

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-
/* sgetpwent.c */
402-
extern struct passwd *sgetpwent (const char *buf);
403-
404401
/* sgetspent.c */
405402
#ifndef HAVE_SGETSPENT
406403
extern struct spwd *sgetspent (const char *string);

lib/pwio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <stdio.h>
1919
#include "commonio.h"
2020
#include "pwio.h"
21+
#include "shadow/passwd/sgetpwent.h"
22+
2123

2224
static /*@null@*/ /*@only@*/void *passwd_dup (const void *ent)
2325
{

lib/sgetpwent.c renamed to lib/shadow/passwd/sgetpwent.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
/*
2-
* SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
3-
* SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
4-
* SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
5-
* SPDX-FileCopyrightText: 2008 , Nicolas François
6-
*
7-
* SPDX-License-Identifier: BSD-3-Clause
8-
*/
1+
// SPDX-FileCopyrightText: 1989-1994, Julianne Frances Haugh
2+
// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
3+
// SPDX-FileCopyrightText: 2003-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/passwd/sgetpwent.h"
1312

1413
#include <sys/types.h>
1514
#include <stdio.h>
@@ -25,6 +24,7 @@
2524

2625
#define NFIELDS 7
2726

27+
2828
/*
2929
* sgetpwent - convert a string to a (struct passwd)
3030
*
@@ -37,6 +37,7 @@
3737
* performance reasons. I am going to come up with some conditional
3838
* compilation glarp to improve on this in the future.
3939
*/
40+
// from-string get pasword entry
4041
struct passwd *
4142
sgetpwent(const char *buf)
4243
{
@@ -105,4 +106,3 @@ sgetpwent(const char *buf)
105106

106107
return &pwent;
107108
}
108-

lib/shadow/passwd/sgetpwent.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_PASSWD_SGETPWENT_H_
6+
#define SHADOW_INCLUDE_LIB_SHADOW_PASSWD_SGETPWENT_H_
7+
8+
9+
#include <config.h>
10+
11+
#include <pwd.h>
12+
13+
14+
struct passwd *sgetpwent(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/sgetpwent.c
6059
lib/sgetspent.c
6160
lib/sgroupio.c
6261
lib/shadow.c
6362
lib/shadow/group/sgetgrent.c
63+
lib/shadow/passwd/sgetpwent.c
6464
lib/shadowio.c
6565
lib/shadowmem.c
6666
lib/shell.c

0 commit comments

Comments
 (0)