Commit 636e2cea authored by Ad Schellevis's avatar Ad Schellevis

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

parent 05aeb719
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
""" """
import os import os
import os.path import os.path
import stat
import syslog import syslog
import collections import collections
import traceback import traceback
...@@ -280,6 +281,9 @@ class Template(object): ...@@ -280,6 +281,9 @@ class Template(object):
if last_bytes_template in ('\n', '\r'): if last_bytes_template in ('\n', '\r'):
f_out.write('\n') f_out.write('\n')
f_out.close() 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) 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