]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Revert "add new HOME_MODE login.defs(5) option"
authorSerge Hallyn <shallyn@cisco.com>
Sun, 12 Jan 2020 13:56:19 +0000 (07:56 -0600)
committerSerge Hallyn <shallyn@cisco.com>
Sun, 12 Jan 2020 13:56:19 +0000 (07:56 -0600)
Missing file

This reverts commit a847899b521b0df0665e442845bcff23407d9ea0.

etc/login.defs
lib/getdef.c
man/login.defs.5.xml
man/login.defs.d/UMASK.xml
src/newusers.c
src/useradd.c

index a2f8cd5006485a80c907d2212f03470141176bce..cd2597dc28859f5841df3144dc7f86ddfc480295 100644 (file)
@@ -195,17 +195,12 @@ KILLCHAR  025
 # Default initial "umask" value used by login(1) on non-PAM enabled systems.
 # Default "umask" value for pam_umask(8) on PAM enabled systems.
 # UMASK is also used by useradd(8) and newusers(8) to set the mode for new
-# home directories if HOME_MODE is not set.
+# home directories.
 # 022 is the default value, but 027, or even 077, could be considered
 # for increased privacy. There is no One True Answer here: each sysadmin
 # must make up their mind.
 UMASK          022
 
-# HOME_MODE is used by useradd(8) and newusers(8) to set the mode for new
-# home directories.
-# If HOME_MODE is not set, the value of UMASK is used to create the mode.
-#HOME_MODE     0700
-
 #
 # Password aging controls:
 #
index 00f6abfe188b02e84bf7a44c0f70149ebad35320..bbb273f417756845072a922363494c4078dbce1b 100644 (file)
@@ -93,7 +93,6 @@ static struct itemdef def_table[] = {
        {"FAKE_SHELL", NULL},
        {"GID_MAX", NULL},
        {"GID_MIN", NULL},
-       {"HOME_MODE", NULL},
        {"HUSHLOGIN_FILE", NULL},
        {"KILLCHAR", NULL},
        {"LASTLOG_UID_MAX", NULL},
index 9e95da20c8b4eeb1ac24a142a7cbd0c8c8d7880b..ebf60ba3b671b057613e8bedf74ed1bdde17704f 100644 (file)
@@ -50,7 +50,6 @@
 <!ENTITY FAKE_SHELL            SYSTEM "login.defs.d/FAKE_SHELL.xml">
 <!ENTITY FTMP_FILE             SYSTEM "login.defs.d/FTMP_FILE.xml">
 <!ENTITY GID_MAX               SYSTEM "login.defs.d/GID_MAX.xml">
-<!ENTITY HOME_MODE             SYSTEM "login.defs.d/HOME_MODE.xml">
 <!ENTITY HUSHLOGIN_FILE        SYSTEM "login.defs.d/HUSHLOGIN_FILE.xml">
 <!ENTITY ISSUE_FILE            SYSTEM "login.defs.d/ISSUE_FILE.xml">
 <!ENTITY KILLCHAR              SYSTEM "login.defs.d/KILLCHAR.xml">
       &FAKE_SHELL;
       &FTMP_FILE;
       &GID_MAX; <!-- documents also GID_MIN -->
-      &HOME_MODE;
       &HUSHLOGIN_FILE;
       &ISSUE_FILE;
       &KILLCHAR;
            ENCRYPT_METHOD
            GID_MAX GID_MIN
            MAX_MEMBERS_PER_GROUP MD5_CRYPT_ENAB
-           HOME_MODE
            PASS_MAX_DAYS PASS_MIN_DAYS PASS_WARN_AGE
            <phrase condition="sha_crypt">SHA_CRYPT_MAX_ROUNDS
            SHA_CRYPT_MIN_ROUNDS</phrase>
          <para>
            CREATE_HOME
            GID_MAX GID_MIN
-           HOME_MODE
            LASTLOG_UID_MAX
            MAIL_DIR MAX_MEMBERS_PER_GROUP
            PASS_MAX_DAYS PASS_MIN_DAYS PASS_WARN_AGE
index 0f061dbb3cb5b73e4832ba496335d4ea221f3e43..d7b71a5e66383c2850620765d821b6242fe844e3 100644 (file)
@@ -37,8 +37,7 @@
     </para>
     <para>
       <command>useradd</command> and <command>newusers</command> use this
-      mask to set the mode of the home directory they create if
-      <option>HOME_MODE</option> is not set.
+      mask to set the mode of the home directory they create
     </para>
     <para condition="no_pam">
       It is also used by <command>login</command> to define users' initial
index e9fe0e27cbe8f89e38988e0ad949b30c6a4bf144..99c69f780c9e4a1b426243ebb459e108b32654d0 100644 (file)
@@ -1216,9 +1216,9 @@ int main (int argc, char **argv)
                if (   ('\0' != fields[5][0])
                    && (access (newpw.pw_dir, F_OK) != 0)) {
 /* FIXME: should check for directory */
-                       mode_t mode = getdef_num ("HOME_MODE",
-                                                 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
-                       if (mkdir (newpw.pw_dir, mode) != 0) {
+                       mode_t msk = 0777 & ~getdef_num ("UMASK",
+                                                        GETDEF_DEFAULT_UMASK);
+                       if (mkdir (newpw.pw_dir, msk) != 0) {
                                fprintf (stderr,
                                         _("%s: line %d: mkdir %s failed: %s\n"),
                                         Prog, line, newpw.pw_dir,
index c29ae949b006cd736772125a6b5d5748f68b4fc6..62e57a4f4266454b64b5c2d071a87eea49589fff 100644 (file)
@@ -2155,9 +2155,8 @@ static void create_home (void)
                }
 
                (void) chown (prefix_user_home, user_id, user_gid);
-               mode_t mode = getdef_num ("HOME_MODE",
-                                         0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
-               chmod (prefix_user_home, mode);
+               chmod (prefix_user_home,
+                      0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
                home_added = true;
 #ifdef WITH_AUDIT
                audit_logger (AUDIT_ADD_USER, Prog,