You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.6 KiB

  1. From a8a7f8fb5cfe95f28cd5f7ff4b4679ca122fe410 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  3. Date: Wed, 2 Oct 2019 13:38:18 +0200
  4. Subject: [PATCH] sepolgen: don't hardcode search for ausearch in /sbin
  5. ausearch may be installed in another location, just rely on PATH to
  6. find ausearch.
  7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  8. ---
  9. sepolgen/src/sepolgen/audit.py | 4 ++--
  10. 1 file changed, 2 insertions(+), 2 deletions(-)
  11. --- a/sepolgen/src/sepolgen/audit.py
  12. +++ b/sepolgen/src/sepolgen/audit.py
  13. @@ -41,7 +41,7 @@ def get_audit_boot_msgs():
  14. s = time.localtime(time.time() - off)
  15. bootdate = time.strftime("%x", s)
  16. boottime = time.strftime("%X", s)
  17. - output = subprocess.Popen(["/sbin/ausearch", "-m", "AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERR", "-ts", bootdate, boottime],
  18. + output = subprocess.Popen(["ausearch", "-m", "AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERR", "-ts", bootdate, boottime],
  19. stdout=subprocess.PIPE).communicate()[0]
  20. if util.PY3:
  21. output = util.decode_input(output)
  22. @@ -56,7 +56,7 @@ def get_audit_msgs():
  23. string contain all of the audit messages returned by ausearch.
  24. """
  25. import subprocess
  26. - output = subprocess.Popen(["/sbin/ausearch", "-m", "AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERR"],
  27. + output = subprocess.Popen(["ausearch", "-m", "AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERR"],
  28. stdout=subprocess.PIPE).communicate()[0]
  29. if util.PY3:
  30. output = util.decode_input(output)