Commit 5416a994 by Brian Coca

Merge pull request #10258 from stratoukos/issue_10257

Fix umask calculation on file creation. Fixes #10257
parents 6a292512 6caeded7
...@@ -1391,7 +1391,7 @@ class AnsibleModule(object): ...@@ -1391,7 +1391,7 @@ class AnsibleModule(object):
# based on the current value of umask # based on the current value of umask
umask = os.umask(0) umask = os.umask(0)
os.umask(umask) os.umask(umask)
os.chmod(dest, 0666 ^ umask) os.chmod(dest, 0666 & ~umask)
if switched_user: if switched_user:
os.chown(dest, os.getuid(), os.getgid()) os.chown(dest, os.getuid(), os.getgid())
......
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