]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/, src/ tests/: Unname unused parameters in callbacks
authorAlejandro Colomar <alx@kernel.org>
Fri, 21 Feb 2025 05:25:15 +0000 (06:25 +0100)
committerSerge Hallyn <serge@hallyn.com>
Fri, 5 Dec 2025 15:21:50 +0000 (09:21 -0600)
[Serge: preference to keep the names as a comment, but ok]
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/cleanup_user.c
lib/copydir.c
lib/loginprompt.c
lib/pam_pass_non_interactive.c
lib/semanage.c
src/expiry.c
src/gpasswd.c
src/login.c
src/su.c
src/sulogin.c
tests/unit/test_logind.c

index 00554d89ca67f101b3f77b0bc5b96c59710cfbab..0af0c67f14398c7b2647a509aa90f9f9fd242490 100644 (file)
@@ -9,7 +9,6 @@
 #include <assert.h>
 #include <stdio.h>
 
-#include "attr.h"
 #include "defines.h"
 #include "pwio.h"
 #include "shadowio.h"
index 69eba53381476d924cc5abae34c548ec6df64059..9bfc94bb16fa6848d4b6c634de0e89676afd40f3 100644 (file)
@@ -99,7 +99,8 @@ static int fchown_if_needed (int fdst, const struct stat *statp,
  * error_acl - format the error messages for the ACL and EQ libraries.
  */
 format_attr(printf, 2, 3)
-static void error_acl (MAYBE_UNUSED struct error_context *ctx, const char *fmt, ...)
+static void
+error_acl(struct error_context *, const char *fmt, ...)
 {
        va_list ap;
        FILE *shadow_logfd = log_get_logfd();
index 4798d1c61b3d7bc17c4d7d1f7ac79517c215e27b..18b899f5dda6d1b2bac0ad1ca800f2cb04b08948 100644 (file)
@@ -26,7 +26,8 @@
 #include "string/strtok/stpsep.h"
 
 
-static void login_exit (MAYBE_UNUSED int sig)
+static void
+login_exit(int)
 {
        _exit (EXIT_FAILURE);
 }
index 189baad88eb0de5862b7ad43c257a6147bea068e..411a5f154dd241ba2580f3200064941115403ff7 100644 (file)
@@ -27,7 +27,7 @@
 static int ni_conv (int num_msg,
                     const struct pam_message **msg,
                     struct pam_response **resp,
-                    MAYBE_UNUSED void *appdata_ptr);
+                    void *);
 static const struct pam_conv non_interactive_pam_conv = {
        ni_conv,
        NULL
@@ -38,7 +38,7 @@ static const struct pam_conv non_interactive_pam_conv = {
 static int ni_conv (int num_msg,
                     const struct pam_message **msg,
                     struct pam_response **resp,
-                    MAYBE_UNUSED void *appdata_ptr)
+                    void *)
 {
        struct pam_response *responses;
        int count;
index c9742f0c03d29c0a73cf8b8d96c44b9b39057a9d..e20fea6ef0aa6f8b35df329a2887efe8caaed5d9 100644 (file)
@@ -28,7 +28,7 @@
 
 
 format_attr(printf, 3, 4)
-static void semanage_error_callback (MAYBE_UNUSED void *varg,
+static void semanage_error_callback (void *,
                                      semanage_handle_t *handle,
                                      const char *fmt, ...)
 {
index 412e54d69ef1bf2b95830583a22836303f334ff8..8da89bdf793096ee24f774d22d44c025ff3441f1 100644 (file)
@@ -29,14 +29,15 @@ static const char Prog[] = "expiry";
 static bool cflg = false;
 
 /* local function prototypes */
-static void catch_signals (MAYBE_UNUSED int sig);
+static void catch_signals(int);
 NORETURN static void usage (int status);
 static void process_flags (int argc, char **argv);
 
 /*
  * catch_signals - signal catcher
  */
-static void catch_signals (MAYBE_UNUSED int sig)
+static void
+catch_signals(int)
 {
        _exit (10);
 }
index b95ee064f1cf12488fc3cbb8a92f00d38240235d..98cc53d056a7dbb5ba4e05a55636e5cedfb21137 100644 (file)
@@ -109,14 +109,14 @@ static void update_group (struct group *gr);
 static void change_passwd (struct group *gr);
 #endif
 static void log_gpasswd_failure (const char *suffix);
-static void log_gpasswd_failure_system (/*@null@*/MAYBE_UNUSED void *arg);
-static void log_gpasswd_failure_group (/*@null@*/MAYBE_UNUSED void *arg);
+static void log_gpasswd_failure_system (/*@null@*/void *);
+static void log_gpasswd_failure_group (/*@null@*/void *);
 #ifdef SHADOWGRP
-static void log_gpasswd_failure_gshadow (/*@null@*/MAYBE_UNUSED void *arg);
+static void log_gpasswd_failure_gshadow (/*@null@*/void *);
 #endif
 static void log_gpasswd_success (const char *suffix);
-static void log_gpasswd_success_system (/*@null@*/MAYBE_UNUSED void *arg);
-static void log_gpasswd_success_group (/*@null@*/MAYBE_UNUSED void *arg);
+static void log_gpasswd_success_system (/*@null@*/void *);
+static void log_gpasswd_success_group(/*@null@*/void *);
 
 /*
  * usage - display usage message
@@ -467,12 +467,14 @@ static void log_gpasswd_failure (const char *suffix)
        }
 }
 
-static void log_gpasswd_failure_system (MAYBE_UNUSED void *arg)
+static void
+log_gpasswd_failure_system(void *)
 {
        log_gpasswd_failure ("");
 }
 
-static void log_gpasswd_failure_group (MAYBE_UNUSED void *arg)
+static void
+log_gpasswd_failure_group(void *)
 {
        char  buf[1024];
 
@@ -481,7 +483,8 @@ static void log_gpasswd_failure_group (MAYBE_UNUSED void *arg)
 }
 
 #ifdef SHADOWGRP
-static void log_gpasswd_failure_gshadow (MAYBE_UNUSED void *arg)
+static void
+log_gpasswd_failure_gshadow(void *)
 {
        char  buf[1024];
 
@@ -578,12 +581,14 @@ static void log_gpasswd_success (const char *suffix)
        }
 }
 
-static void log_gpasswd_success_system (MAYBE_UNUSED void *arg)
+static void
+log_gpasswd_success_system(void *)
 {
        log_gpasswd_success ("");
 }
 
-static void log_gpasswd_success_group (MAYBE_UNUSED void *arg)
+static void
+log_gpasswd_success_group(void *)
 {
        char  buf[1024];
 
index a3ba39e17a46983ef5dde078f7287abd3fb37907..6798bb1d02939c317c27218593d559b23ecdc0d6 100644 (file)
@@ -366,12 +366,14 @@ static void init_env (void)
 #endif                         /* !USE_PAM */
 }
 
-static void exit_handler (MAYBE_UNUSED int sig)
+static void
+exit_handler(int)
 {
        _exit (0);
 }
 
-static void alarm_handler (MAYBE_UNUSED int sig)
+static void
+alarm_handler(int)
 {
        write_full(STDERR_FILENO, tmsg, strlen(tmsg));
        signal(SIGALRM, exit_handler);
index 5ba80e64904f6ff2644b2cfc7db781aaa79c4724..86f84304bd55d4407ace5cdadc50c13b9c9f292e 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -115,7 +115,7 @@ static void execve_shell (const char *shellname,
                           char *args[],
                           char *const envp[]);
 #ifdef USE_PAM
-static void kill_child (MAYBE_UNUSED int s);
+static void kill_child(int);
 static void prepare_pam_close_session (void);
 #else                          /* !USE_PAM */
 static void die (int);
@@ -169,7 +169,8 @@ static bool iswheel (const char *username)
        return is_on_list (grp->gr_mem, username);
 }
 #else                          /* USE_PAM */
-static void kill_child (MAYBE_UNUSED int s)
+static void
+kill_child(int)
 {
        if (0 != pid_child) {
                (void) kill (-pid_child, SIGKILL);
index 74d2ff37674e932cfe7eb6dd000e80bbc1752195..3089c02d2157dd79bc2cb6f10d25009c284465ae 100644 (file)
@@ -49,7 +49,8 @@ static void catch_signals (int);
 static int pw_entry(const char *name, struct passwd *pwent);
 
 
-static void catch_signals (MAYBE_UNUSED int sig)
+static void
+catch_signals(int)
 {
        _exit (1);
 }
index 4f5cf75768b4105491c900933e3f94889d6c22ad..6cfc6d9119c40ceead436bb8109b17e2c1d62824 100644 (file)
  * WRAPPERS
  **********************/
 struct passwd *
-__wrap_prefix_getpwnam(uid_t uid)
+__wrap_prefix_getpwnam(uid_t)
 {
     return (struct passwd*) mock();
 }
 
 int
-__wrap_sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions)
+__wrap_sd_uid_get_sessions(uid_t, int, char ***)
 {
     return mock();
 }