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.

38 lines
1.7 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. diff --git a/sepolgen/src/sepolgen/audit.py b/sepolgen/src/sepolgen/audit.py
  12. index 4adb851f..5eafa587 100644
  13. --- a/sepolgen/src/sepolgen/audit.py
  14. +++ b/sepolgen/src/sepolgen/audit.py
  15. @@ -41,7 +41,7 @@ def get_audit_boot_msgs():
  16. s = time.localtime(time.time() - off)
  17. bootdate = time.strftime("%x", s)
  18. boottime = time.strftime("%X", s)
  19. - output = subprocess.Popen(["/sbin/ausearch", "-m", "AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERR", "-ts", bootdate, boottime],
  20. + output = subprocess.Popen(["ausearch", "-m", "AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERR", "-ts", bootdate, boottime],
  21. stdout=subprocess.PIPE).communicate()[0]
  22. if util.PY3:
  23. output = util.decode_input(output)
  24. @@ -56,7 +56,7 @@ def get_audit_msgs():
  25. string contain all of the audit messages returned by ausearch.
  26. """
  27. import subprocess
  28. - output = subprocess.Popen(["/sbin/ausearch", "-m", "AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERR"],
  29. + output = subprocess.Popen(["ausearch", "-m", "AVC,USER_AVC,MAC_POLICY_LOAD,DAEMON_START,SELINUX_ERR"],
  30. stdout=subprocess.PIPE).communicate()[0]
  31. if util.PY3:
  32. output = util.decode_input(output)
  33. --
  34. 2.21.0