@@ -98,10 +98,9 @@ static int check_execveat_invoked_rc(int fd, const char *path, int flags,
98
98
if (child == 0 ) {
99
99
/* Child: do execveat(). */
100
100
rc = execveat_ (fd , path , argv , envp , flags );
101
- ksft_print_msg ("execveat() failed, rc=%d errno=%d (%s)\n" ,
101
+ ksft_print_msg ("child execveat() failed, rc=%d errno=%d (%s)\n" ,
102
102
rc , errno , strerror (errno ));
103
- ksft_test_result_fail ("%s\n" , test_name );
104
- exit (1 ); /* should not reach here */
103
+ exit (errno );
105
104
}
106
105
/* Parent: wait for & check child's exit status. */
107
106
rc = waitpid (child , & status , 0 );
@@ -226,11 +225,14 @@ static int check_execveat_pathmax(int root_dfd, const char *src, int is_script)
226
225
* "If the command name is found, but it is not an executable utility,
227
226
* the exit status shall be 126."), so allow either.
228
227
*/
229
- if (is_script )
228
+ if (is_script ) {
229
+ ksft_print_msg ("Invoke script via root_dfd and relative filename\n" );
230
230
fail += check_execveat_invoked_rc (root_dfd , longpath + 1 , 0 ,
231
231
127 , 126 );
232
- else
232
+ } else {
233
+ ksft_print_msg ("Invoke exec via root_dfd and relative filename\n" );
233
234
fail += check_execveat (root_dfd , longpath + 1 , 0 );
235
+ }
234
236
235
237
return fail ;
236
238
}
0 commit comments