39 lines
1.4 KiB
Diff
39 lines
1.4 KiB
Diff
Avoid to fail on killall without any argiments in case of libselinux
|
|
|
|
--- configure.ac
|
|
+++ configure.ac 2021-01-14 12:52:33.493812041 +0100
|
|
@@ -27,6 +27,8 @@ if test "$enable_selinux" = "yes"; then
|
|
AC_DEFINE([WITH_SELINUX], [1], [Use Security-Enhanced Linux features])
|
|
AC_CHECK_LIB([selinux], [getfilecon], [SELINUX_LIB=-lselinux], [
|
|
AC_MSG_ERROR([Cannot find selinux static library]) ])
|
|
+ AC_CHECK_LIB([selinux], [getfilecon], [echo 'set has_selinux 1' > testsuite/selinux.exp],
|
|
+ [echo 'set has_selinux 0' > testsuite/selinux.exp])
|
|
fi
|
|
AC_SUBST([SELINUX_LIB])
|
|
|
|
--- testsuite/Makefile.am
|
|
+++ testsuite/Makefile.am 2021-01-14 12:53:25.962505766 +0100
|
|
@@ -1,6 +1,8 @@
|
|
AUTOMAKE_OPTIONS = dejagnu
|
|
export DEJAGNU
|
|
|
|
+EXTRA_DEJAGNU_SITE_CONFIG=$(srcdir)/selinux.exp
|
|
+
|
|
# Programs that are expected across the board.
|
|
DEJATOOL = killall
|
|
DEJATOOL += pslog
|
|
--- testsuite/killall.test/killall.exp
|
|
+++ testsuite/killall.test/killall.exp 2021-01-14 12:54:27.087313939 +0100
|
|
@@ -7,7 +7,11 @@ set fake_proc_name "afakeprocname"
|
|
|
|
set test "killall with no arguments"
|
|
spawn $killall
|
|
+if { $has_selinux == 0 } {
|
|
expect_pass "$test" "^Usage: killall \\\[OPTION\\\]\\.\\.\\. \\\[--\\\] NAME\\.\\.\\."
|
|
+} else {
|
|
+expect_pass "$test" "^Usage: killall \\\[ -Z CONTEXT \\\] \\\[ -u USER \\\] \\\[ -y TIME \\\] \\\[ -o TIME \\\] \\\[ -eIgiqrvw \\\]"
|
|
+}
|
|
|
|
set test "killall list signals"
|
|
spawn $killall -l
|