Fix umask calculation on file creation. Fixes #10257

This commit is contained in:
Stratos Moros 2015-02-16 21:16:26 +02:00
parent 6a29251292
commit 6caeded74e

View file

@ -1391,7 +1391,7 @@ class AnsibleModule(object):
# based on the current value of umask
umask = os.umask(0)
os.umask(umask)
os.chmod(dest, 0666 ^ umask)
os.chmod(dest, 0666 & ~umask)
if switched_user:
os.chown(dest, os.getuid(), os.getgid())