Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit c407343

Browse files
committed
Print error in case execve fails in the trigger program
Signed-off-by: Denis Efremov <denis.e.efremov@oracle.com>
1 parent f9b141d commit c407343

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ check_argc0_lsm.h: check_argc0_lsm.o
1212
load_check_argc0_lsm: check_argc0_lsm.h load_check_argc0_lsm.c
1313
clang -lbpf $@.c -o $@
1414

15-
trigger:
15+
trigger: trigger.c
1616
clang -w $@.c -o $@
1717

1818
clean:

trigger.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#include <unistd.h>
2+
#include <stdio.h>
3+
#include <errno.h>
24

35
int main(int argc, char *argv[])
46
{
57
execve("/usr/bin/pkexec", NULL, NULL);
8+
fprintf(stderr, "%s\n", strerror(errno));
69
return 0;
710
}

0 commit comments

Comments
 (0)