]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/: Use libc _FILE_SHADOW from <paths.h>
authorAlejandro Colomar <alx@kernel.org>
Sun, 28 Sep 2025 08:40:09 +0000 (10:40 +0200)
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/defines.h
lib/prefix_flag.c
lib/shadowio.c

index 219724c9f303a1f5ab656d0acebd148b75f39df0..0374f0f03c570ce2b5a5b11829359f359f482b3f 100644 (file)
 #define GROUP_FILE "/etc/group"
 #endif
 
-#ifndef SHADOW_FILE
-#define SHADOW_FILE "/etc/shadow"
-#endif
-
 #ifndef SUBUID_FILE
 #define SUBUID_FILE "/etc/subuid"
 #endif
index cb807c6ac41852b14d629d30cdb88543b94acd29..dd5972cc72d991b90b078d68d28ff184f1a19563 100644 (file)
@@ -122,7 +122,7 @@ extern const char* process_prefix_flag (const char* short_opt, int argc, char **
                sgr_setdbname(sgroup_db_file);
 #endif
 
-               spw_db_file = xaprintf("%s/%s", prefix, SHADOW_FILE);
+               spw_db_file = xaprintf("%s/%s", prefix, _PATH_SHADOW);
                spw_setdbname(spw_db_file);
 
 #ifdef ENABLE_SUBIDS
index 9fe5d097f1b18fe21ee10f7999742b826fd5a3df..bf71817519850f593e7aac4422a20ce35a2f5133 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "config.h"
 
+#include <paths.h>
 #include <shadow.h>
 #include <stdio.h>
 
@@ -82,7 +83,7 @@ static struct commonio_ops shadow_ops = {
 };
 
 static struct commonio_db shadow_db = {
-       SHADOW_FILE,            /* filename */
+       _PATH_SHADOW,           /* filename */
        &shadow_ops,            /* ops */
        NULL,                   /* fp */
 #ifdef WITH_SELINUX