]> err.no Git - util-linux/commitdiff
vipw: fix permissions (600->400) for edited /etc/[g]shodow files
authorKarel Zak <kzak@redhat.com>
Thu, 15 Feb 2007 10:46:23 +0000 (11:46 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 15 Feb 2007 10:46:23 +0000 (11:46 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/vipw.c

index cc41b86b11ddb1b621e57ec5648f9b66d6cd1276..fea28ac2e2d6e741b39337c1b0f6c0c9483e2125 100644 (file)
@@ -297,13 +297,11 @@ edit_file(int is_shadow)
                (void)fprintf(stderr, _("%s: no changes made\n"), progname);
                pw_error((char *)NULL, 0, 0);
        }
+       /* see pw_lock() where we create the file with mode 600 */
        if (!is_shadow)
                chmod(tmp_file, 0644);
-#if 0
-       /* if shadow file, then mode is 0600 now */
        else
                chmod(tmp_file, 0400);
-#endif
        pw_unlock();
 }