summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-03 15:21:20 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-03 15:21:20 -0800
commitcd0320558342126ca8df91dd7d73f4561890e00d (patch)
tree2d45146fcb62d114dc58b5ba6ed6d28d345f6d1a /lib
parenta907683b2f0b69581bc8c770020702c18e112e87 (diff)
parent31590c67860fb99d5c4b267dd880fe63497fb89f (diff)
downloadvyatta-cfg-system-cd0320558342126ca8df91dd7d73f4561890e00d.tar.gz
vyatta-cfg-system-cd0320558342126ca8df91dd7d73f4561890e00d.zip
Merge branch 'kenwood' of 192.168.100.1:git/vyatta-cfg-system into kenwood
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/Login/User.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Vyatta/Login/User.pm b/lib/Vyatta/Login/User.pm
index f6706e4e..018e7e12 100755
--- a/lib/Vyatta/Login/User.pm
+++ b/lib/Vyatta/Login/User.pm
@@ -130,10 +130,11 @@ sub set_authorized_keys {
unless (-d $sshdir) {
mkdir $sshdir;
chown ($uid, $gid, $sshdir);
+ chmod (0750, $sshdir);
}
my $auth;
- unless (open (my $auth, "$sshdir/authorized_keys")) {
+ unless (open (my $auth, '>', "$sshdir/authorized_keys")) {
warn "open $sshdir/authorized_keys failed: $!";
return;
}
@@ -152,6 +153,7 @@ sub set_authorized_keys {
}
select STDOUT;
close $auth;
+ chmod (0640, "$sshdir/authorized_keys");
}
sub update {