From 4be2fd4576b9819478a25cb7e151cab800241ebb Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Wed, 31 Dec 2014 00:00:53 +0100 Subject: [PATCH] run_init: fix open_init_pty avaibility check If /usr/sbin/open_init_pty is not found or is not executable, access("/usr/sbin/open_init_pty", X_OK) returns -1, not zero. Use "!= 0" like in other places in SELinux userland libraries and tools. --- policycoreutils/run_init/run_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policycoreutils/run_init/run_init.c b/policycoreutils/run_init/run_init.c index 129db730..4bc32b1c 100644 --- a/policycoreutils/run_init/run_init.c +++ b/policycoreutils/run_init/run_init.c @@ -406,7 +406,7 @@ int main(int argc, char *argv[]) new_context); exit(-1); } - if (! access("/usr/sbin/open_init_pty", X_OK)) { + if (access("/usr/sbin/open_init_pty", X_OK) != 0) { if (execvp(argv[1], argv + 1)) { perror("execvp"); exit(-1);