Commit 1f6d5468 authored by Russ Fish's avatar Russ Fish

Micro-fixes: Don't trunctate Windows password to 8 chars, and make /sshkeys subdirs owned by user.

parent 4e1cc382
......@@ -496,11 +496,7 @@ sub doboot()
# Set the ownership of the home directory / mount point / keys.
# Use the system chown by name, not UID. Can't use chown -R, it goes
# top-down, chowning the directory away and then trying to read it.
#
# Okay, this is really wrong. The authkeys files can't be mode 600
# and owned by the user. They can be 644/user, or 600/SYSTEM.
# Is this a bug in sshd's use of setreuid()? We prefer 600/SYSTEM.
my $cmd = "$CHOWN SYSTEM $sshdir/*";
my $cmd = "$CHOWN $login $sshdir/*";
if (system($cmd) != 0) {
warning("Failed $cmd: $!");
}
......
......@@ -394,7 +394,7 @@ sub os_useradd($$$$$$$$$)
# Use the leading 8 chars of the Unix MD5 passwd hash as a known random
# password, both here and in Samba. Skip over a "$1$" prefix.
my $pwd = $pswd;
$pwd =~ s/^(\$1\$)?(.{8}).*/$2/;
$pwd =~ s/^(\$1\$)(.{8}).*/$2/;
print WINUSERS "$login,$gcos,$pwd,,,,,\r\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment