mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 18:50:21 -07:00
Ensure user owns their ssh key directory on creation
Lost section from commit 8049777
This commit is contained in:
parent
793df5d4d9
commit
19402a47cd
1 changed files with 1 additions and 0 deletions
|
@ -430,6 +430,7 @@ class User(object):
|
||||||
if not os.path.exists(ssh_dir):
|
if not os.path.exists(ssh_dir):
|
||||||
try:
|
try:
|
||||||
os.mkdir(ssh_dir, 0700)
|
os.mkdir(ssh_dir, 0700)
|
||||||
|
os.chown(ssh_dir, info[2], info[3])
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
return (1, '', 'Failed to create %s: %s' % (ssh_dir, str(e)))
|
return (1, '', 'Failed to create %s: %s' % (ssh_dir, str(e)))
|
||||||
if os.path.exists(ssh_key_file):
|
if os.path.exists(ssh_key_file):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue