aboutsummaryrefslogtreecommitdiffstats
path: root/src/fsec-print/syscall_list.c
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-12-28 12:28:08 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2017-12-28 12:28:08 -0500
commitf9c60d5a3aaecc11b1dbb933bca45c461b03ca83 (patch)
tree4538785f5889ee8836afadb36f29308a4ccf7ccb /src/fsec-print/syscall_list.c
parentAdd netlink and noblacklist openssl to teamspeak3 profile - potential fix for... (diff)
downloadfirejail-f9c60d5a3aaecc11b1dbb933bca45c461b03ca83.tar.gz
firejail-f9c60d5a3aaecc11b1dbb933bca45c461b03ca83.tar.zst
firejail-f9c60d5a3aaecc11b1dbb933bca45c461b03ca83.zip
replacing seccomp printing with a seccomp disassembler
Diffstat (limited to 'src/fsec-print/syscall_list.c')
-rw-r--r--src/fsec-print/syscall_list.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/fsec-print/syscall_list.c b/src/fsec-print/syscall_list.c
new file mode 100644
index 000000000..410956de5
--- /dev/null
+++ b/src/fsec-print/syscall_list.c
@@ -0,0 +1,47 @@
1/*
2 * Copyright (C) 2014-2017 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 "fsec_print.h"
21#include <sys/syscall.h>
22
23typedef struct {
24 const char * const name;
25 int nr;
26} SyscallEntry;
27
28static const SyscallEntry syslist[] = {
29//
30// code generated using tools/extract-syscall
31//
32#include "../include/syscall.h"
33//
34// end of generated code
35//
36}; // end of syslist
37
38const char *syscall_find_nr(int nr) {
39 int i;
40 int elems = sizeof(syslist) / sizeof(syslist[0]);
41 for (i = 0; i < elems; i++) {
42 if (nr == syslist[i].nr)
43 return syslist[i].name;
44 }
45
46 return NULL;
47}