Files
2021-06-06 21:09:25 +03:00

20 lines
826 B
Python

#/usr/bin/python
import os
permissions = {
"/etc/sudoers" : ["0440", "root:root"],
"/etc/sudoers.d" : ["0750", "root:root"],
"/var/db/sudo" : ["0711", "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))