summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2023-09-02 02:17:26 +0200
committerSerge Hallyn <serge@hallyn.com>2023-09-04 08:57:18 -0500
commit7c45a6e8bab48aec2c527e33d55ac60f19507dfb (patch)
tree9fbe6b4092132564b060f227bb98523d3161a5ea
parent158866bfdcaa9aea4a8e355975b9aa9200c69fce (diff)
lib/agetpass.h: Move prototypes to dedicated header
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--lib/Makefile.am1
-rw-r--r--lib/agetpass.c3
-rw-r--r--lib/agetpass.h21
-rw-r--r--lib/prototypes.h5
-rw-r--r--src/gpasswd.c1
-rw-r--r--src/newgrp.c1
-rw-r--r--src/passwd.c1
-rw-r--r--src/sulogin.c2
8 files changed, 29 insertions, 6 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 083b2277..11e405c2 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -25,6 +25,7 @@ libshadow_la_SOURCES = \
addgrps.c \
age.c \
agetpass.c \
+ agetpass.h \
alloc.c \
alloc.h \
audit_help.c \
diff --git a/lib/agetpass.c b/lib/agetpass.c
index 576b766e..b06c3d81 100644
--- a/lib/agetpass.c
+++ b/lib/agetpass.c
@@ -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
index 00000000..d3613c15
--- /dev/null
+++ b/lib/agetpass.h
@@ -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
diff --git a/lib/prototypes.h b/lib/prototypes.h
index 25ee3a09..89a68e7c 100644
--- a/lib/prototypes.h
+++ b/lib/prototypes.h
@@ -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 *);
diff --git a/src/gpasswd.c b/src/gpasswd.c
index fbf50cbd..a8a78d85 100644
--- a/src/gpasswd.c
+++ b/src/gpasswd.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <sys/types.h>
+#include "agetpass.h"
#include "alloc.h"
#include "defines.h"
#include "groupio.h"
diff --git a/src/newgrp.c b/src/newgrp.c
index f786a96f..6fac4ac5 100644
--- a/src/newgrp.c
+++ b/src/newgrp.c
@@ -17,6 +17,7 @@
#include <stdio.h>
#include <assert.h>
+#include "agetpass.h"
#include "alloc.h"
#include "defines.h"
#include "getdef.h"
diff --git a/src/passwd.c b/src/passwd.c
index ab5e5307..5bcd3395 100644
--- a/src/passwd.c
+++ b/src/passwd.c
@@ -20,6 +20,7 @@
#include <sys/types.h>
#include <time.h>
+#include "agetpass.h"
#include "alloc.h"
#include "defines.h"
#include "getdef.h"
diff --git a/src/sulogin.c b/src/sulogin.c
index 386493d1..ee8c9622 100644
--- a/src/sulogin.c
+++ b/src/sulogin.c
@@ -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"