]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/agetpass.h: Move prototypes to dedicated header
authorAlejandro Colomar <alx@kernel.org>
Sat, 2 Sep 2023 00:17:26 +0000 (02:17 +0200)
committerSerge Hallyn <serge@hallyn.com>
Mon, 4 Sep 2023 13:57:18 +0000 (08:57 -0500)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/Makefile.am
lib/agetpass.c
lib/agetpass.h [new file with mode: 0644]
lib/prototypes.h
src/gpasswd.c
src/newgrp.c
src/passwd.c
src/sulogin.c

index 083b22777c2188f0f42bc329474825f738578641..11e405c29e6937099c6648f567f749f0644654c4 100644 (file)
@@ -25,6 +25,7 @@ libshadow_la_SOURCES = \
        addgrps.c \
        age.c \
        agetpass.c \
+       agetpass.h \
        alloc.c \
        alloc.h \
        audit_help.c \
index 576b766e5ad989efeb263fe3ae69813b0bb1ced9..b06c3d81d79a4821ff0604fc8987963756dfaff2 100644 (file)
@@ -7,6 +7,8 @@
 
 #include <config.h>
 
+#include "agetpass.h"
+
 #include <limits.h>
 #include <readpassphrase.h>
 #include <stdio.h>
@@ -16,7 +18,6 @@
 #ident "$Id$"
 
 #include "alloc.h"
-#include "prototypes.h"
 
 #if WITH_LIBBSD == 0
 #include "freezero.h"
diff --git a/lib/agetpass.h b/lib/agetpass.h
new file mode 100644 (file)
index 0000000..d3613c1
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * SPDX-FileCopyrightText: 2022-2023, Alejandro Colomar <alx@kernel.org>
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+
+#ifndef SHADOW_INCLUDE_LIB_AGETPASS_H_
+#define SHADOW_INCLUDE_LIB_AGETPASS_H_
+
+
+#include <config.h>
+
+#include "defines.h"
+
+
+void erase_pass(char *pass);
+ATTR_MALLOC(erase_pass)
+char *agetpass(const char *prompt);
+
+
+#endif  // include guard
index 25ee3a0934440d3c6aff2bc4a9fedb0a697c618c..89a68e7c07b36a2d686239b9d973a28e61859c29 100644 (file)
@@ -43,11 +43,6 @@ extern int add_groups (const char *);
 extern void agecheck (/*@null@*/const struct spwd *);
 extern int expire (const struct passwd *, /*@null@*/const struct spwd *);
 
-/* agetpass.c */
-extern void erase_pass(char *pass);
-ATTR_MALLOC(erase_pass)
-extern char *agetpass(const char *prompt);
-
 /* isexpired.c */
 extern int isexpired (const struct passwd *, /*@null@*/const struct spwd *);
 
index fbf50cbdbe29bec5aba4dd64bef693427b37c2f2..a8a78d8591c9c96ab4a13e4af5d5b092d1549f5c 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 
+#include "agetpass.h"
 #include "alloc.h"
 #include "defines.h"
 #include "groupio.h"
index f786a96fad703bd8debca1ddfd8d78d3ddbad6a6..6fac4ac58800e5331cf2a8b27bf06dcf0166237e 100644 (file)
@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include <assert.h>
 
+#include "agetpass.h"
 #include "alloc.h"
 #include "defines.h"
 #include "getdef.h"
index ab5e5307a6c237cfdb9df93e2be74bcaa0d1e97d..5bcd339561167c5d3cb35607bf19ebb253e2276c 100644 (file)
@@ -20,6 +20,7 @@
 #include <sys/types.h>
 #include <time.h>
 
+#include "agetpass.h"
 #include "alloc.h"
 #include "defines.h"
 #include "getdef.h"
index 386493d161242eb664a2fc1d0ebe30885bf2f484..ee8c962299193c4bb45b5a8d2db10b1793f5c10d 100644 (file)
@@ -16,6 +16,8 @@
 #include <signal.h>
 #include <stdio.h>
 #include <sys/ioctl.h>
+
+#include "agetpass.h"
 #include "defines.h"
 #include "getdef.h"
 #include "memzero.h"