Commit 992f38bf authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(configd, templates) copy parents permissions, without exec bit

(cherry picked from commit 636e2cea)
parent 8b2cf1c6
......@@ -30,6 +30,7 @@
"""
import os
import os.path
import stat
import syslog
import collections
import traceback
......@@ -280,6 +281,9 @@ class Template(object):
if last_bytes_template in ('\n', '\r'):
f_out.write('\n')
f_out.close()
# copy root permissions, without exec
root_perm = stat.S_IMODE(os.lstat(os.path.dirname(filename)).st_mode)
os.chmod(filename, root_perm & (~stat.S_IXGRP & ~stat.S_IXUSR & ~stat.S_IXOTH))
result.append(filename)
......
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