]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/shadow/, lib/, po/: sgetpwent(): Move to under lib/shadow/passwd/
authorAlejandro Colomar <alx@kernel.org>
Sun, 10 Nov 2024 22:31:23 +0000 (23:31 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Tue, 7 Oct 2025 09:03:09 +0000 (11:03 +0200)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/Makefile.am
lib/prototypes.h
lib/pwio.c
lib/shadow/passwd/sgetpwent.c [moved from lib/sgetpwent.c with 81% similarity]
lib/shadow/passwd/sgetpwent.h [new file with mode: 0644]
po/POTFILES.in

index 25c915b507c14b34cf9fcea196b3697dd4bcbe00..25f08466515774e38a789fab889f535906caa6bc 100644 (file)
@@ -166,7 +166,6 @@ libshadow_la_SOURCES = \
        semanage.c \
        setugid.c \
        setupenv.c \
-       sgetpwent.c \
        sgetspent.c \
        sgroupio.c \
        sgroupio.h \
@@ -192,6 +191,8 @@ libshadow_la_SOURCES = \
        shadow/gshadow/sgetsgent.h \
        shadow/gshadow/sgrp.c \
        shadow/gshadow/sgrp.h \
+       shadow/passwd/sgetpwent.c \
+       shadow/passwd/sgetpwent.h \
        shadowio.c \
        shadowio.h \
        shadowlog.c \
index 2d20395edc7d50ef4f0dc9cf8ed1d420024ffbaf..92a2f759fb994d1c2230af719702fe86c9a9acdd 100644 (file)
@@ -397,9 +397,6 @@ extern void setup (struct passwd *);
 /* setupenv.c */
 extern void setup_env (struct passwd *);
 
-/* sgetpwent.c */
-extern struct passwd *sgetpwent (const char *buf);
-
 /* sgetspent.c */
 #ifndef HAVE_SGETSPENT
 extern struct spwd *sgetspent (const char *string);
index 0674d71860c995fa270363ae375cf8514ed50449..463f8378c8ceb7d7d1eba3be808977a8578f5b77 100644 (file)
@@ -18,6 +18,8 @@
 #include "fields.h"
 #include "prototypes.h"
 #include "pwio.h"
+#include "shadow/passwd/sgetpwent.h"
+
 
 static /*@null@*/ /*@only@*/void *passwd_dup (const void *ent)
 {
similarity index 81%
rename from lib/sgetpwent.c
rename to lib/shadow/passwd/sgetpwent.c
index 2e5bbbd1c740603b9e54675c0138fb18f06dfdb9..ddea1384b0282e35a151fad49a49d2687808494f 100644 (file)
@@ -1,15 +1,14 @@
-/*
- * SPDX-FileCopyrightText: 1989 - 1994, Julianne Frances Haugh
- * SPDX-FileCopyrightText: 1996 - 1998, Marek Michałkiewicz
- * SPDX-FileCopyrightText: 2003 - 2005, Tomasz Kłoczko
- * SPDX-FileCopyrightText: 2008       , Nicolas François
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
+// SPDX-FileCopyrightText: 1989-1994, Julianne Frances Haugh
+// SPDX-FileCopyrightText: 1996-1998, Marek Michałkiewicz
+// SPDX-FileCopyrightText: 2003-2005, Tomasz Kłoczko
+// SPDX-FileCopyrightText: 2008, Nicolas François
+// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
 
 #include "config.h"
 
-#ident "$Id$"
+#include "shadow/passwd/sgetpwent.h"
 
 #include <pwd.h>
 #include <stdio.h>
@@ -38,6 +37,7 @@
  *     performance reasons.  I am going to come up with some conditional
  *     compilation glarp to improve on this in the future.
  */
+// from-string get pasword entry
 struct passwd *
 sgetpwent(const char *s)
 {
@@ -85,4 +85,3 @@ sgetpwent(const char *s)
 
        return &pwent;
 }
-
diff --git a/lib/shadow/passwd/sgetpwent.h b/lib/shadow/passwd/sgetpwent.h
new file mode 100644 (file)
index 0000000..7b82a5c
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-License-Identifier: BSD-3-Clause
+
+
+#ifndef SHADOW_INCLUDE_LIB_SHADOW_PASSWD_SGETPWENT_H_
+#define SHADOW_INCLUDE_LIB_SHADOW_PASSWD_SGETPWENT_H_
+
+
+#include "config.h"
+
+#include <pwd.h>
+
+
+struct passwd *sgetpwent(const char *s);
+
+
+#endif  // include guard
index af5cfa5dfdb7c1a9c1e5cc043d48a535af7d8b47..1da1ae19bd58f71fe3d34a3a17895169da0d7c7f 100644 (file)
@@ -56,10 +56,10 @@ lib/selinux.c
 lib/semanage.c
 lib/setugid.c
 lib/setupenv.c
-lib/sgetpwent.c
 lib/sgetspent.c
 lib/sgroupio.c
 lib/shadow/group/sgetgrent.c
+lib/shadow/passwd/sgetpwent.c
 lib/shadowio.c
 lib/shadowmem.c
 lib/shell.c