package.py 826 B

1234567891011121314151617181920
  1. #/usr/bin/python
  2. import os
  3. permissions = {
  4. "/etc/sudoers" : ["0440", "root:root"],
  5. "/etc/sudoers.d" : ["0750", "root:root"],
  6. "/var/db/sudo" : ["0711", "root:root"],
  7. "/usr/bin/sudo" : ["4111", "root:root"],
  8. "/usr/bin/sudoedit" : ["4111", "root:root"],
  9. "/usr/bin/sudoreplay" : ["0111", "root:root"],
  10. }
  11. def postInstall(fromVersion, fromRelease, toVersion, toRelease):
  12. for _file, perms in permissions.items():
  13. # The list above is general, some paths may not exist depending on the configuration
  14. if os.path.exists(_file):
  15. os.system("/bin/chown -R %s %s" % (perms[1], _file))
  16. os.system("/bin/chmod %s %s" % (perms[0], _file))