Skip to content

Conversation

@alejandro-colomar
Copy link
Collaborator

@alejandro-colomar alejandro-colomar commented Jun 9, 2025

These are cherry-picks from #1220


Revisions:

v1b
  • Rebase
$ git rd 
1:  39d17867 = 1:  6cedeac5 src/useradd.c: Remove unused variable
2:  45093ec7 = 2:  ecfaab1c src/gpasswd.c: Remove unused parameter $1 of check_perms()
3:  1f631d20 = 3:  94ae417b lib/, src/: Remove unused parameter $2 of audit_logger()
4:  6622b830 = 4:  b1147d69 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
5:  a4d5227b = 5:  d8cc2df0 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
6:  13349cc4 = 6:  f74c3c01 lib/: Remove unused parameter $3 of password_check() and propagate
7:  b0f68a65 = 7:  aa0b2ec1 lib/obscure.c: Remove unused parameter $1 of palindrome()
8:  d001ed6f = 8:  a1c13db0 lib/, src/: Remove unused parameter $3 of passwd_check()
v1c
  • Rebase
$ git rd 
1:  6cedeac5 = 1:  b939649e src/useradd.c: Remove unused variable
2:  ecfaab1c = 2:  11b6a131 src/gpasswd.c: Remove unused parameter $1 of check_perms()
3:  94ae417b = 3:  abac82b1 lib/, src/: Remove unused parameter $2 of audit_logger()
4:  b1147d69 = 4:  e3a05ea3 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
5:  d8cc2df0 = 5:  22de5dc5 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
6:  f74c3c01 = 6:  8f413081 lib/: Remove unused parameter $3 of password_check() and propagate
7:  aa0b2ec1 = 7:  5e5b7000 lib/obscure.c: Remove unused parameter $1 of palindrome()
8:  a1c13db0 = 8:  54999e2f lib/, src/: Remove unused parameter $3 of passwd_check()
v1d
  • Rebase
$ git rd
1:  b939649e = 1:  f6041d79 src/useradd.c: Remove unused variable
2:  11b6a131 = 2:  70c0e614 src/gpasswd.c: Remove unused parameter $1 of check_perms()
3:  abac82b1 = 3:  f0e745e4 lib/, src/: Remove unused parameter $2 of audit_logger()
4:  e3a05ea3 = 4:  0a7661f5 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
5:  22de5dc5 = 5:  7072420d lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
6:  8f413081 = 6:  147dbde8 lib/: Remove unused parameter $3 of password_check() and propagate
7:  5e5b7000 = 7:  fbbb0fc1 lib/obscure.c: Remove unused parameter $1 of palindrome()
8:  54999e2f = 8:  e2203a65 lib/, src/: Remove unused parameter $3 of passwd_check()
v1e
  • Rebase
$ git range-diff gh/master..gh/dd shadow/master..dd
1:  f6041d79 = 1:  807f8a45 src/useradd.c: Remove unused variable
2:  70c0e614 = 2:  03b79a37 src/gpasswd.c: Remove unused parameter $1 of check_perms()
3:  f0e745e4 = 3:  f61135fc lib/, src/: Remove unused parameter $2 of audit_logger()
4:  0a7661f5 = 4:  ea5ad397 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
5:  7072420d = 5:  736c0994 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
6:  147dbde8 = 6:  c9eff95d lib/: Remove unused parameter $3 of password_check() and propagate
7:  fbbb0fc1 = 7:  726d4df8 lib/obscure.c: Remove unused parameter $1 of palindrome()
8:  e2203a65 = 8:  3446845b lib/, src/: Remove unused parameter $3 of passwd_check()
v1f
  • Rebase
$ git rd 
1:  807f8a45 = 1:  0d8e33ca src/useradd.c: Remove unused variable
2:  03b79a37 = 2:  46b8282d src/gpasswd.c: Remove unused parameter $1 of check_perms()
3:  f61135fc = 3:  ec80c948 lib/, src/: Remove unused parameter $2 of audit_logger()
4:  ea5ad397 = 4:  dcc7c81d lib/copydir.c: Remove unused parameter $3 of copy_symlink()
5:  736c0994 = 5:  7fcd0a42 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
6:  c9eff95d = 6:  9c9700db lib/: Remove unused parameter $3 of password_check() and propagate
7:  726d4df8 = 7:  4bf54d5c lib/obscure.c: Remove unused parameter $1 of palindrome()
8:  3446845b = 8:  a3ee017e lib/, src/: Remove unused parameter $3 of passwd_check()
v1g
  • Rebase
$ git rd
1:  0d8e33ca = 1:  5b49cb1b src/useradd.c: Remove unused variable
2:  46b8282d = 2:  e774b775 src/gpasswd.c: Remove unused parameter $1 of check_perms()
3:  ec80c948 = 3:  0d9dc409 lib/, src/: Remove unused parameter $2 of audit_logger()
4:  dcc7c81d = 4:  82e7d9fa lib/copydir.c: Remove unused parameter $3 of copy_symlink()
5:  7fcd0a42 = 5:  7992d489 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
6:  9c9700db = 6:  93dbc1de lib/: Remove unused parameter $3 of password_check() and propagate
7:  4bf54d5c = 7:  8f244ca6 lib/obscure.c: Remove unused parameter $1 of palindrome()
8:  a3ee017e = 8:  079e035b lib/, src/: Remove unused parameter $3 of passwd_check()
v2
  • Remove unused macros.
$ git range-diff shadow/master gh/dd dd 
 1:  5b49cb1b =  1:  5b49cb1b src/useradd.c: Remove unused variable
 2:  e774b775 =  2:  e774b775 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 3:  0d9dc409 =  3:  0d9dc409 lib/, src/: Remove unused parameter $2 of audit_logger()
 4:  82e7d9fa =  4:  82e7d9fa lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 5:  7992d489 =  5:  7992d489 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
 6:  93dbc1de =  6:  93dbc1de lib/: Remove unused parameter $3 of password_check() and propagate
 7:  8f244ca6 =  7:  8f244ca6 lib/obscure.c: Remove unused parameter $1 of palindrome()
 8:  079e035b =  8:  079e035b lib/, src/: Remove unused parameter $3 of passwd_check()
 -:  -------- >  9:  60f8a760 lib/defines.h: NGROUPS_MAX: Remove unused macro
 -:  -------- > 10:  55e88bda lib/defines.h: LOG_NOWAIT: Remove unused macro
v2b
  • Rebase
$ git rd 
 1:  5b49cb1b =  1:  9cc6322b src/useradd.c: Remove unused variable
 2:  e774b775 =  2:  873de230 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 3:  0d9dc409 =  3:  0bc6762d lib/, src/: Remove unused parameter $2 of audit_logger()
 4:  82e7d9fa =  4:  c3f8d377 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 5:  7992d489 =  5:  fc91ce59 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
 6:  93dbc1de =  6:  1acb4abc lib/: Remove unused parameter $3 of password_check() and propagate
 7:  8f244ca6 =  7:  ea528cf8 lib/obscure.c: Remove unused parameter $1 of palindrome()
 8:  079e035b =  8:  9f71e09a lib/, src/: Remove unused parameter $3 of passwd_check()
 9:  60f8a760 =  9:  f9869b05 lib/defines.h: NGROUPS_MAX: Remove unused macro
10:  55e88bda = 10:  bd4d0f57 lib/defines.h: LOG_NOWAIT: Remove unused macro
v3
  • Rebase
$ git rd 
 1:  9cc6322b =  1:  b2968d4d src/useradd.c: Remove unused variable
 2:  873de230 !  2:  d3e3d363 src/gpasswd.c: Remove unused parameter $1 of check_perms()
    @@ Commit message
     
      ## src/gpasswd.c ##
     @@ src/gpasswd.c: static void open_files (void);
    - static void close_files (void);
    + static void close_files (struct option_flags *flags);
      #ifdef SHADOWGRP
    - static void get_group (struct group *gr, struct sgrp *sg);
    + static void get_group (struct group *gr, struct sgrp *sg, struct option_flags *flags);
     -static void check_perms (const struct group *gr, const struct sgrp *sg);
     +static void check_perms(const struct sgrp *sg);
      static void update_group (struct group *gr, struct sgrp *sg);
      static void change_passwd (struct group *gr, struct sgrp *sg);
      #else
    - static void get_group (struct group *gr);
    + static void get_group (struct group *gr, struct option_flags *flags);
     -static void check_perms (const struct group *gr);
     +static void check_perms(void);
      static void update_group (struct group *gr);
      static void change_passwd (struct group *gr);
      #endif
    -@@ src/gpasswd.c: static void close_files (void)
    +@@ src/gpasswd.c: static void close_files (struct option_flags *flags)
       *        It only returns if the user is allowed.
       */
      #ifdef SHADOWGRP
 3:  0bc6762d !  3:  49e264a2 lib/, src/: Remove unused parameter $2 of audit_logger()
    @@ lib/prototypes.h: extern void audit_help_open (void);
      void audit_logger_message (const char *message, shadow_audit_result result);
     
      ## src/chage.c ##
    -@@ src/chage.c: fail_exit (int code)
    +@@ src/chage.c: fail_exit (int code, bool process_selinux)
      
      #ifdef WITH_AUDIT
        if (E_SUCCESS != code) {
    @@ src/groupadd.c: usage (int status)
                                 AUDIT_NO_ID, SHADOW_AUDIT_FAILURE);
      #endif
        exit (status);
    -@@ src/groupadd.c: static void close_files (void)
    +@@ src/groupadd.c: static void close_files (struct option_flags *flags)
                fail_exit (E_GRP_UPDATE);
        }
      #ifdef WITH_AUDIT
    @@ src/groupadd.c: static void close_files (void)
                      "add-group",
                      group_name, group_id, SHADOW_AUDIT_SUCCESS);
      #endif
    -@@ src/groupadd.c: static void close_files (void)
    +@@ src/groupadd.c: static void close_files (struct option_flags *flags)
                        fail_exit (E_GRP_UPDATE);
                }
      #ifdef WITH_AUDIT
    @@ src/groupdel.c: usage (int status)
                              AUDIT_NO_ID, SHADOW_AUDIT_FAILURE);
      #endif
        exit (status);
    -@@ src/groupdel.c: static void close_files (void)
    +@@ src/groupdel.c: static void close_files (struct option_flags *flags)
        }
      
      #ifdef WITH_AUDIT
    @@ src/groupdel.c: static void close_files (void)
                      "delete-group",
                      group_name, group_id, SHADOW_AUDIT_SUCCESS);
      #endif
    -@@ src/groupdel.c: static void close_files (void)
    +@@ src/groupdel.c: static void close_files (struct option_flags *flags)
                }
      
      #ifdef WITH_AUDIT
    @@ src/groupdel.c: static void close_files (void)
      #endif
     
      ## src/groupmod.c ##
    -@@ src/groupmod.c: static void close_files (void)
    +@@ src/groupmod.c: static void close_files (struct option_flags *flags)
                exit (E_GRP_UPDATE);
        }
      #ifdef WITH_AUDIT
    @@ src/groupmod.c: static void close_files (void)
                      info_group.audit_msg,
                      group_name, AUDIT_NO_ID,
                      SHADOW_AUDIT_SUCCESS);
    -@@ src/groupmod.c: static void close_files (void)
    +@@ src/groupmod.c: static void close_files (struct option_flags *flags)
      #ifdef WITH_AUDIT
                /* If both happened, log password change as its more important */
                if (pflg)
    @@ src/groupmod.c: static void close_files (void)
                              info_gshadow.audit_msg,
                              group_name, AUDIT_NO_ID,
                              SHADOW_AUDIT_SUCCESS);
    -@@ src/groupmod.c: static void close_files (void)
    +@@ src/groupmod.c: static void close_files (struct option_flags *flags)
                        exit (E_GRP_UPDATE);
                }
      #ifdef WITH_AUDIT
    @@ src/groupmod.c: static void close_files (void)
                              info_passwd.audit_msg,
                              group_name, AUDIT_NO_ID,
                              SHADOW_AUDIT_SUCCESS);
    -@@ src/groupmod.c: static void close_files (void)
    +@@ src/groupmod.c: static void close_files (struct option_flags *flags)
        }
      
      #ifdef WITH_AUDIT
    @@ src/newgrp.c: int main (int argc, char **argv)
      #endif
     
      ## src/useradd.c ##
    -@@ src/useradd.c: static void fail_exit (int code)
    +@@ src/useradd.c: static void fail_exit (int code, bool process_selinux)
        else
                type = AUDIT_ADD_USER;
      
    @@ src/useradd.c: set_defaults(void)
                      "changing-useradd-defaults",
                      NULL, AUDIT_NO_ID,
                      SHADOW_AUDIT_SUCCESS);
    -@@ src/useradd.c: static void process_flags (int argc, char **argv)
    +@@ src/useradd.c: static void process_flags (int argc, char **argv, struct option_flags *flags)
                                        Prog, user_name);
                        }
      #ifdef WITH_AUDIT
    @@ src/useradd.c: static void process_flags (int argc, char **argv)
                                      "add-user",
                                      user_name, AUDIT_NO_ID,
                                      SHADOW_AUDIT_FAILURE);
    -@@ src/useradd.c: static void close_files (void)
    +@@ src/useradd.c: static void close_files (struct option_flags *flags)
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
      #ifdef WITH_AUDIT
    @@ src/useradd.c: static void close_files (void)
                                      "unlocking-shadow-file",
                                      user_name, AUDIT_NO_ID,
                                      SHADOW_AUDIT_FAILURE);
    -@@ src/useradd.c: static void close_files (void)
    +@@ src/useradd.c: static void close_files (struct option_flags *flags)
                fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
                SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
      #ifdef WITH_AUDIT
    @@ src/useradd.c: static void close_files (void)
                              "unlocking-passwd-file",
                              user_name, AUDIT_NO_ID,
                              SHADOW_AUDIT_FAILURE);
    -@@ src/useradd.c: static void close_files (void)
    +@@ src/useradd.c: static void close_files (struct option_flags *flags)
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
      #ifdef WITH_AUDIT
    @@ src/useradd.c: static void close_files (void)
                                "unlocking-subordinate-user-file",
                                user_name, AUDIT_NO_ID,
                                SHADOW_AUDIT_FAILURE);
    -@@ src/useradd.c: static void close_files (void)
    +@@ src/useradd.c: static void close_files (struct option_flags *flags)
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
      #ifdef WITH_AUDIT
    @@ src/useradd.c: static void close_files (void)
                                "unlocking-subordinate-group-file",
                                user_name, AUDIT_NO_ID,
                                SHADOW_AUDIT_FAILURE);
    -@@ src/useradd.c: static void unlock_group_files (void)
    +@@ src/useradd.c: static void unlock_group_files (bool process_selinux)
                fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
                SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
      #ifdef WITH_AUDIT
    @@ src/useradd.c: static void unlock_group_files (void)
                              "unlocking-group-file",
                              user_name, AUDIT_NO_ID,
                              SHADOW_AUDIT_FAILURE);
    -@@ src/useradd.c: static void unlock_group_files (void)
    +@@ src/useradd.c: static void unlock_group_files (bool process_selinux)
                        fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
                        SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
      #ifdef WITH_AUDIT
    @@ src/useradd.c: static void unlock_group_files (void)
                                      "unlocking-gshadow-file",
                                      user_name, AUDIT_NO_ID,
                                      SHADOW_AUDIT_FAILURE);
    -@@ src/useradd.c: static void grp_add (void)
    +@@ src/useradd.c: static void grp_add (bool process_selinux)
                         _("%s: failed to prepare the new %s entry '%s'\n"),
                         Prog, gr_dbname (), grp.gr_name);
      #ifdef WITH_AUDIT
    @@ src/useradd.c: static void grp_add (void)
                              "add-group",
                              grp.gr_name, AUDIT_NO_ID,
                              SHADOW_AUDIT_FAILURE);
    -@@ src/useradd.c: static void grp_add (void)
    +@@ src/useradd.c: static void grp_add (bool process_selinux)
                         _("%s: failed to prepare the new %s entry '%s'\n"),
                         Prog, sgr_dbname (), sgrp.sg_namp);
      #ifdef WITH_AUDIT
    @@ src/useradd.c: static void grp_add (void)
                              "add-group",
                              grp.gr_name, AUDIT_NO_ID,
                              SHADOW_AUDIT_FAILURE);
    -@@ src/useradd.c: static void grp_add (void)
    +@@ src/useradd.c: static void grp_add (bool process_selinux)
      #endif                            /* SHADOWGRP */
        SYSLOG ((LOG_INFO, "new group: name=%s, GID=%u", user_name, user_gid));
      #ifdef WITH_AUDIT
    @@ src/useradd.c: static void grp_add (void)
                      "add-group",
                      grp.gr_name, AUDIT_NO_ID,
                      SHADOW_AUDIT_SUCCESS);
    -@@ src/useradd.c: static void usr_update (unsigned long subuid_count, unsigned long subgid_count)
    +@@ src/useradd.c: usr_update (unsigned long subuid_count, unsigned long subgid_count,
         * because its not written to disk yet. After close_files it is
         * and we can use the real ID thereafter.
         */
    @@ src/useradd.c: static void usr_update (unsigned long subuid_count, unsigned long
                      "add-user",
                      user_name, AUDIT_NO_ID,
                      SHADOW_AUDIT_SUCCESS);
    -@@ src/useradd.c: static void create_home (void)
    +@@ src/useradd.c: static void create_home (struct option_flags *flags)
        }
        home_added = true;
      #ifdef WITH_AUDIT
    @@ src/useradd.c: int main (int argc, char **argv)
      #endif                            /* WITH_AUDIT */
     
      ## src/userdel.c ##
    -@@ src/userdel.c: static void fail_exit (int code)
    +@@ src/userdel.c: static void fail_exit (int code, bool process_selinux)
      #endif                            /* ENABLE_SUBIDS */
      
      #ifdef WITH_AUDIT
    @@ src/userdel.c: static void fail_exit (int code)
                      "delete-user",
                      user_name, user_id, SHADOW_AUDIT_FAILURE);
      #endif                            /* WITH_AUDIT */
    -@@ src/userdel.c: static void update_user (void)
    +@@ src/userdel.c: static void update_user (bool process_selinux)
        }
      #endif                            /* ENABLE_SUBIDS */
      #ifdef WITH_AUDIT
    @@ src/userdel.c: int main (int argc, char **argv)
                                      user_name, AUDIT_NO_ID,
                                      SHADOW_AUDIT_FAILURE);
     @@ src/userdel.c: int main (int argc, char **argv)
    -   if (streq(prefix, "") && !Rflg && user_busy(user_name, user_id) != 0) {
    +   if (streq(prefix, "") && !flags.chroot && user_busy(user_name, user_id) != 0) {
                if (!fflg) {
      #ifdef WITH_AUDIT
     -                  audit_logger (AUDIT_DEL_USER, Prog,
    @@ src/usermod.c: static char *new_pw_passwd (char *pw_pass)
                              "updating-password", user_newname, user_newid, 1);
      #endif
                SYSLOG ((LOG_INFO, "change user '%s' password", user_newname));
    -@@ src/usermod.c: static void new_pwent (struct passwd *pwent)
    -                   fail_exit (E_NAME_IN_USE);
    +@@ src/usermod.c: static void new_pwent (struct passwd *pwent, bool process_selinux)
    +                   fail_exit (E_NAME_IN_USE, process_selinux);
                }
      #ifdef WITH_AUDIT
     -          audit_logger (AUDIT_USER_MGMT, Prog,
    @@ src/usermod.c: static void new_pwent (struct passwd *pwent)
                              "changing-name", user_newname, user_newid, 1);
      #endif
                SYSLOG ((LOG_INFO,
    -@@ src/usermod.c: static void new_pwent (struct passwd *pwent)
    +@@ src/usermod.c: static void new_pwent (struct passwd *pwent, bool process_selinux)
      
        if (uflg) {
      #ifdef WITH_AUDIT
    @@ src/usermod.c: static void new_pwent (struct passwd *pwent)
                              "changing-uid", user_newname, user_newid, 1);
      #endif
                SYSLOG ((LOG_INFO,
    -@@ src/usermod.c: static void new_pwent (struct passwd *pwent)
    +@@ src/usermod.c: static void new_pwent (struct passwd *pwent, bool process_selinux)
        }
        if (gflg) {
      #ifdef WITH_AUDIT
    @@ src/usermod.c: static void new_pwent (struct passwd *pwent)
                              "changing-primary-group",
                              user_newname, user_newid, 1);
      #endif
    -@@ src/usermod.c: static void new_pwent (struct passwd *pwent)
    +@@ src/usermod.c: static void new_pwent (struct passwd *pwent, bool process_selinux)
        }
        if (cflg) {
      #ifdef WITH_AUDIT
    @@ src/usermod.c: static void new_pwent (struct passwd *pwent)
                              "changing-comment", user_newname, user_newid, 1);
      #endif
                pwent->pw_gecos = user_newcomment;
    -@@ src/usermod.c: static void new_pwent (struct passwd *pwent)
    +@@ src/usermod.c: static void new_pwent (struct passwd *pwent, bool process_selinux)
      
        if (dflg) {
      #ifdef WITH_AUDIT
    @@ src/usermod.c: static void new_pwent (struct passwd *pwent)
                              "changing-home-dir",
                              user_newname, user_newid, 1);
      #endif
    -@@ src/usermod.c: static void new_pwent (struct passwd *pwent)
    +@@ src/usermod.c: static void new_pwent (struct passwd *pwent, bool process_selinux)
        }
        if (sflg) {
      #ifdef WITH_AUDIT
    @@ src/usermod.c: static void new_pwent (struct passwd *pwent)
                              "changing-shell",
                              user_newname, user_newid, 1);
      #endif
    -@@ src/usermod.c: static void new_spent (struct spwd *spent)
    +@@ src/usermod.c: static void new_spent (struct spwd *spent, bool process_selinux)
      
        if (fflg) {
      #ifdef WITH_AUDIT
    @@ src/usermod.c: static void new_spent (struct spwd *spent)
                              "changing-inactive-days",
                              user_newname, user_newid, 1);
      #endif
    -@@ src/usermod.c: static void new_spent (struct spwd *spent)
    +@@ src/usermod.c: static void new_spent (struct spwd *spent, bool process_selinux)
                DAY_TO_STR(new_exp, user_newexpire);
                DAY_TO_STR(old_exp, user_expire);
      #ifdef WITH_AUDIT
    @@ src/usermod.c: static void new_spent (struct spwd *spent)
                              "changing-expiration-date",
                              user_newname, user_newid, 1);
      #endif
    -@@ src/usermod.c: fail_exit (int code)
    +@@ src/usermod.c: fail_exit (int code, bool process_selinux)
      #endif                            /* ENABLE_SUBIDS */
      
      #ifdef WITH_AUDIT
    @@ src/usermod.c: fail_exit (int code)
                      "modify-account",
                      user_name, AUDIT_NO_ID, SHADOW_AUDIT_FAILURE);
      #endif
    -@@ src/usermod.c: static void move_home (void)
    +@@ src/usermod.c: static void move_home (bool process_selinux)
      
      #ifdef WITH_AUDIT
                if (uflg || gflg) {
    @@ src/usermod.c: static void move_home (void)
                                      "updating-home-dir-owner",
                                      user_newname, user_newid, 1);
                }
    -@@ src/usermod.c: static void move_home (void)
    -                           fail_exit (E_HOMEDIR);
    +@@ src/usermod.c: static void move_home (bool process_selinux)
    +                           fail_exit (E_HOMEDIR, process_selinux);
                        }
      #ifdef WITH_AUDIT
     -                  audit_logger (AUDIT_USER_MGMT, Prog,
    @@ src/usermod.c: static void move_home (void)
                                      "moving-home-dir",
                                      user_newname, user_newid, 1);
      #endif
    -@@ src/usermod.c: static void move_home (void)
    +@@ src/usermod.c: static void move_home (bool process_selinux)
                                        }
      #ifdef WITH_AUDIT
                                        audit_logger (AUDIT_USER_MGMT,
 4:  c3f8d377 =  4:  b282fcde lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 5:  fc91ce59 =  5:  10fa3f9b lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
 6:  1acb4abc =  6:  dbe614a1 lib/: Remove unused parameter $3 of password_check() and propagate
 7:  ea528cf8 =  7:  e2f815a7 lib/obscure.c: Remove unused parameter $1 of palindrome()
 8:  9f71e09a !  8:  c9699069 lib/, src/: Remove unused parameter $3 of passwd_check()
    @@ src/chfn.c: static void check_perms (const struct passwd *pw)
      #else                             /* !USE_PAM */
     
      ## src/chsh.c ##
    -@@ src/chsh.c: static void check_perms (const struct passwd *pw)
    +@@ src/chsh.c: static void check_perms (const struct passwd *pw, struct option_flags *flags)
         * chfn/chsh.  --marekm
         */
        if (!amroot && getdef_bool ("CHSH_AUTH")) {
 9:  f9869b05 =  9:  e9e0bed8 lib/defines.h: NGROUPS_MAX: Remove unused macro
10:  bd4d0f57 = 10:  414bcb02 lib/defines.h: LOG_NOWAIT: Remove unused macro
v3b
  • Rebase
$ git rd 
 1:  b2968d4d =  1:  3f16a8bc src/useradd.c: Remove unused variable
 2:  d3e3d363 =  2:  4956cca2 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 3:  49e264a2 =  3:  8ec090e8 lib/, src/: Remove unused parameter $2 of audit_logger()
 4:  b282fcde =  4:  c07003e2 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 5:  10fa3f9b =  5:  b119f5a1 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
 6:  dbe614a1 =  6:  d9b3a9b8 lib/: Remove unused parameter $3 of password_check() and propagate
 7:  e2f815a7 =  7:  9fbfe499 lib/obscure.c: Remove unused parameter $1 of palindrome()
 8:  c9699069 =  8:  31ad04be lib/, src/: Remove unused parameter $3 of passwd_check()
 9:  e9e0bed8 =  9:  21e43cc3 lib/defines.h: NGROUPS_MAX: Remove unused macro
10:  414bcb02 = 10:  31a1a6e1 lib/defines.h: LOG_NOWAIT: Remove unused macro
v3c
  • Rebase
$ git rd 
 1:  3f16a8bc =  1:  ad9fa535 src/useradd.c: Remove unused variable
 2:  4956cca2 =  2:  fbf75330 src/gpasswd.c: Remove unused parameter $1 of check_perms()
 3:  8ec090e8 =  3:  49f636c8 lib/, src/: Remove unused parameter $2 of audit_logger()
 4:  c07003e2 =  4:  df6cd349 lib/copydir.c: Remove unused parameter $3 of copy_symlink()
 5:  b119f5a1 =  5:  84ff7980 lib/copydir.c: Remove unused parameter $2 of copy_hardlink()
 6:  d9b3a9b8 =  6:  c0f3c71d lib/: Remove unused parameter $3 of password_check() and propagate
 7:  9fbfe499 =  7:  a53ea789 lib/obscure.c: Remove unused parameter $1 of palindrome()
 8:  31ad04be =  8:  be600049 lib/, src/: Remove unused parameter $3 of passwd_check()
 9:  21e43cc3 =  9:  7c274269 lib/defines.h: NGROUPS_MAX: Remove unused macro
10:  31a1a6e1 = 10:  f57d00d5 lib/defines.h: LOG_NOWAIT: Remove unused macro

Fixes: d91b22c (2024-07-08; "lib/, src/: Use stpsep() instead of its pattern")
Signed-off-by: Alejandro Colomar <[email protected]>
Fixes: 53e1eb4 (2024-07-01; "src/: Remove dead code")
Signed-off-by: Alejandro Colomar <[email protected]>
Propagate the removal of dead code to its callers, which were only
passing the parameter to this function.

Signed-off-by: Alejandro Colomar <[email protected]>
BTW, it's already defined in <limits.h>, so even if we used it,
we shouldn't define it here.

Signed-off-by: Alejandro Colomar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Simpler A good issue for a new beginner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant