diff options
Diffstat (limited to 'src/faudit/main.c')
-rw-r--r-- | src/faudit/main.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/faudit/main.c b/src/faudit/main.c new file mode 100644 index 000000000..df549ac3e --- /dev/null +++ b/src/faudit/main.c | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014-2016 Firejail Authors | ||
3 | * | ||
4 | * This file is part of firejail project | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | #include "faudit.h" | ||
21 | char *prog; | ||
22 | |||
23 | int main(int argc, char **argv) { | ||
24 | if (argc != 1) { | ||
25 | int i; | ||
26 | |||
27 | for (i = 1; i < argc; i++) { | ||
28 | if (strcmp(argv[i], "syscall")) { | ||
29 | syscall_helper(argc, argv); | ||
30 | return 0; | ||
31 | } | ||
32 | } | ||
33 | return 1; | ||
34 | } | ||
35 | |||
36 | printf("\n---------------- Firejail Audit: the GOOD, the BAD and the UGLY ----------------\n"); | ||
37 | |||
38 | // extract program name | ||
39 | prog = realpath(argv[0], NULL); | ||
40 | if (prog == NULL) { | ||
41 | fprintf(stderr, "Error: cannot extract the path of the audit program\n"); | ||
42 | return 1; | ||
43 | } | ||
44 | printf("INFO: Starting %s.\n", prog); | ||
45 | |||
46 | |||
47 | // check pid namespace | ||
48 | pid_test(); | ||
49 | |||
50 | // check capabilities | ||
51 | caps_test(); | ||
52 | |||
53 | // check seccomp | ||
54 | seccomp_test(); | ||
55 | |||
56 | // check some well-known problematic files and directories | ||
57 | files_test(); | ||
58 | |||
59 | // network | ||
60 | network_test(); | ||
61 | |||
62 | // dbus | ||
63 | dbus_test(); | ||
64 | |||
65 | free(prog); | ||
66 | printf("--------------------------------------------------------------------------------\n"); | ||
67 | return 0; | ||
68 | } | ||