Files
main/util/admin/sudo/comar/package.py
T
2015-07-19 23:43:10 +03:00

21 lines
827 B
Python

#/usr/bin/python
import os
permissions = {
"/etc/sudoers" : ["0440", "root:root"],
"/etc/sudoers.d" : ["0750", "root:root"],
"/var/db/sudo" : ["0700", "root:root"],
"/usr/bin/sudo" : ["4111", "root:root"],
"/usr/bin/sudoedit" : ["4111", "root:root"],
"/usr/bin/sudoreplay" : ["0111", "root:root"],
}
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
for _file, perms in permissions.items():
# The list above is general, some paths may not exist depending on the configuration
if os.path.exists(_file):
os.system("/bin/chown -R %s %s" % (perms[1], _file))
os.system("/bin/chmod %s %s" % (perms[0], _file))