]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Declare usage and failure handler noreturn
authorChristian Göttsche <cgzones@googlemail.com>
Thu, 26 Jan 2023 21:08:43 +0000 (22:08 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Mon, 21 Aug 2023 09:43:18 +0000 (11:43 +0200)
Assist static analyzers in understanding final code paths.

src/chgpasswd.c
src/groupmems.c
src/su.c
src/useradd.c

index 7b773e2ffe2b852fd1c32a08d888b64d049d9ffe..d7cdd76a9bb1ec31042a67b03c610cbd4c747d4a 100644 (file)
@@ -62,7 +62,7 @@ static bool sgr_locked = false;
 static bool gr_locked = false;
 
 /* local function prototypes */
-static void fail_exit (int code);
+NORETURN static void fail_exit (int code);
 NORETURN static void usage (int status);
 static void process_flags (int argc, char **argv);
 static void check_flags (void);
index 1ac937ea15426c85d2f7044decc966b1515fce52..63a1601ccc1f0ded9d2ae65d36a31666b22aa141 100644 (file)
@@ -71,7 +71,7 @@ static void display_members (const char *const *members);
 NORETURN static void usage (int status);
 static void process_flags (int argc, char **argv);
 static void check_perms (void);
-static void fail_exit (int code);
+NORETURN static void fail_exit (int code);
 #define isroot()               (getuid () == 0)
 
 static char *whoami (void)
index b03344130df1baac5d6cb76f899f7f5234b02ce8..d8a208572009b6e5f8871e3e3c5e5574b9456645 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -433,6 +433,7 @@ static void prepare_pam_close_session (void)
 /*
  * usage - print command line syntax and exit
  */
+NORETURN
 static void usage (int status)
 {
        (void)
index a690992777cbac3e12337834da63fb3dfd1c06ac..11d0bc9cb4b97b902415eb81aa83e472573b21b5 100644 (file)
@@ -205,13 +205,13 @@ static bool home_added = false;
 #define DLOG_INIT      "LOG_INIT="
 
 /* local function prototypes */
-static void fail_exit (int);
+NORETURN static void fail_exit (int);
 static void get_defaults (void);
 static void show_defaults (void);
 static int set_defaults (void);
 static int get_groups (char *);
 static struct group * get_local_group (char * grp_name);
-static void usage (int status);
+NORETURN static void usage (int status);
 static void new_pwent (struct passwd *);
 
 static long scale_age (long);