run_init: fix open_init_pty avaibility check
PATCH 1/1 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(-)
policycoreutils/run_init/run_init.c +1 -1
@@ -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 );
Signature · 1 line
2.2.1
Quoted 14 lines · Nicolas Iooss
If
/usr/sbin/open_init_ptyis 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(-)policycoreutils/run_init/run_init.c +0
-0
policycoreutils/run_init/run_init.c int main(int argc, char *argv[]) · line 412
Quoted 8 lines
policycoreutils/run_init/run_init.c +1
-1@@ -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 );
Sorry, don't know why/how this one got lost, but applied now.