From: Andrea Claudi Date: Wed, 23 Aug 2023 17:29:59 +0000 (+0200) Subject: ss: make is_selinux_enabled stub work like in SELinux X-Git-Tag: v6.6.0~31^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8970828b6509af3ab0f2982da335fb6a6c846af;p=thirdparty%2Fiproute2.git ss: make is_selinux_enabled stub work like in SELinux From the is_selinux_enabled() manpage: is_selinux_enabled() returns 1 if SELinux is running or 0 if it is not. This makes the is_selinux_enabled() stub functions works exactly like the SELinux function it is supposed to replace. Signed-off-by: Andrea Claudi Signed-off-by: David Ahern --- diff --git a/misc/ss.c b/misc/ss.c index 6d34ad0e0..007cb3490 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -77,7 +77,7 @@ /* Stubs for SELinux functions */ static int is_selinux_enabled(void) { - return -1; + return 0; } static int getpidcon(pid_t pid, char **context) @@ -5682,7 +5682,7 @@ int main(int argc, char *argv[]) show_sock_ctx++; /* fall through */ case 'Z': - if (is_selinux_enabled() <= 0) { + if (!is_selinux_enabled()) { fprintf(stderr, "ss: SELinux is not enabled.\n"); exit(1); }