Ensure user owns their ssh key directory on creation

Lost section from commit 8049777
This commit is contained in:
Nigel Metheringham 2012-11-04 09:44:38 +00:00
parent bb2929b508
commit eecf6cf94f

1
user
View file

@ -430,6 +430,7 @@ class User(object):
if not os.path.exists(ssh_dir):
try:
os.mkdir(ssh_dir, 0700)
os.chown(ssh_dir, info[2], info[3])
except OSError, e:
return (1, '', 'Failed to create %s: %s' % (ssh_dir, str(e)))
if os.path.exists(ssh_key_file):