From b33683a353d608ab17646c5a4077e17a061cc1bb Mon Sep 17 00:00:00 2001 From: Iker Pedrosa Date: Fri, 25 Apr 2025 16:06:57 +0200 Subject: [PATCH] src/vipw.c: add SELinux control flag in unlock All unlock functions require the SELinux control flag, thus add it as an argument. Signed-off-by: Iker Pedrosa --- src/vipw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vipw.c b/src/vipw.c index fb12364f3..a888fddfd 100644 --- a/src/vipw.c +++ b/src/vipw.c @@ -62,7 +62,7 @@ static const char *Prog; static const char *filename, *fileeditname; static bool filelocked = false; static bool createedit = false; -static int (*unlock) (void); +static int (*unlock) (bool); static bool quiet = false; #ifdef WITH_TCB static const char *user = NULL; @@ -74,7 +74,7 @@ static bool tcb_mode = false; static void usage (int status); static int create_backup_file (FILE *, const char *, struct stat *); static void vipwexit (const char *msg, int syserr, int ret); -static void vipwedit (const char *, int (*)(void), int (*)(void)); +static void vipwedit (const char *, int (*)(void), int (*)(bool)); /* * usage - display usage message and exit @@ -164,7 +164,7 @@ static void vipwexit (const char *msg, int syserr, int ret) } } if (filelocked) { - if ((*unlock) () == 0) { + if ((*unlock) (true) == 0) { fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, fileeditname); SYSLOG ((LOG_ERR, "failed to unlock %s", fileeditname)); /* continue */ @@ -194,7 +194,7 @@ static void vipwexit (const char *msg, int syserr, int ret) * */ static void -vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (void)) +vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (bool)) { int status; char *to_rename; @@ -466,7 +466,7 @@ vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (void)) } #endif /* WITH_TCB */ - if ((*file_unlock) () == 0) { + if ((*file_unlock) (true) == 0) { fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, fileeditname); SYSLOG ((LOG_ERR, "failed to unlock %s", fileeditname)); /* continue */ -- 2.47.3