Skip to content

Commit 68132d4

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

File tree

6 files changed

+31
-15
lines changed

6 files changed

+31
-15
lines changed

lib/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ libshadow_la_SOURCES = \
164164
semanage.c \
165165
setugid.c \
166166
setupenv.c \
167-
sgetpwent.c \
168167
sgetspent.c \
169168
sgroupio.c \
170169
sgroupio.h \
@@ -190,6 +189,8 @@ libshadow_la_SOURCES = \
190189
shadow/gshadow/sgetsgent.h \
191190
shadow/gshadow/sgrp.c \
192191
shadow/gshadow/sgrp.h \
192+
shadow/passwd/sgetpwent.c \
193+
shadow/passwd/sgetpwent.h \
193194
shadowio.c \
194195
shadowio.h \
195196
shadowlog.c \

lib/prototypes.h

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

400-
/* sgetpwent.c */
401-
extern struct passwd *sgetpwent (const char *buf);
402-
403400
/* sgetspent.c */
404401
#ifndef HAVE_SGETSPENT
405402
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 "fields.h"
1919
#include "prototypes.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: 9 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 <pwd.h>
1514
#include <stdio.h>
@@ -38,6 +37,7 @@
3837
* performance reasons. I am going to come up with some conditional
3938
* compilation glarp to improve on this in the future.
4039
*/
40+
// from-string get pasword entry
4141
struct passwd *
4242
sgetpwent(const char *s)
4343
{
@@ -85,4 +85,3 @@ sgetpwent(const char *s)
8585

8686
return &pwent;
8787
}
88-

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,10 +56,10 @@ 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/group/sgetgrent.c
62+
lib/shadow/passwd/sgetpwent.c
6363
lib/shadowio.c
6464
lib/shadowmem.c
6565
lib/shell.c

0 commit comments

Comments
 (0)