mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
Merge pull request #2859 from swayf/fix/authorized_key_chown_on_link
fix for authorized_key on debian squeeze
This commit is contained in:
commit
e075607c9b
1 changed files with 6 additions and 2 deletions
|
@ -140,8 +140,12 @@ def keyfile(module, user, write=False, path=None, manage_dir=True):
|
||||||
if module.selinux_enabled():
|
if module.selinux_enabled():
|
||||||
module.set_default_selinux_context(keysfile, False)
|
module.set_default_selinux_context(keysfile, False)
|
||||||
|
|
||||||
os.chown(keysfile, uid, gid)
|
try:
|
||||||
os.chmod(keysfile, 0600)
|
os.chown(keysfile, uid, gid)
|
||||||
|
os.chmod(keysfile, 0600)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
|
||||||
return keysfile
|
return keysfile
|
||||||
|
|
||||||
def readkeys(filename):
|
def readkeys(filename):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue