aboutsummaryrefslogtreecommitdiffstats
path: root/src/fseccomp/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fseccomp/syscall.c')
-rw-r--r--src/fseccomp/syscall.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/fseccomp/syscall.c b/src/fseccomp/syscall.c
index 2acbdd989..5d83786bb 100644
--- a/src/fseccomp/syscall.c
+++ b/src/fseccomp/syscall.c
@@ -1485,9 +1485,17 @@ int syscall_check_list(const char *slist, void (*callback)(int fd, int syscall,
1485 syscall_check_list(new_list, callback, fd, arg, ptrarg); 1485 syscall_check_list(new_list, callback, fd, arg, ptrarg);
1486 } 1486 }
1487 else { 1487 else {
1488 bool negate = false;
1489 if (*ptr == '!') {
1490 negate = true;
1491 ptr++;
1492 }
1488 syscall_process_name(ptr, &syscall_nr, &error_nr); 1493 syscall_process_name(ptr, &syscall_nr, &error_nr);
1489 if (syscall_nr == -1) {;} 1494 if (syscall_nr == -1) {;}
1490 else if (callback != NULL) { 1495 else if (callback != NULL) {
1496 if (negate) {
1497 syscall_nr = -syscall_nr;
1498 }
1491 if (error_nr != -1 && fd != 0) { 1499 if (error_nr != -1 && fd != 0) {
1492 filter_add_errno(fd, syscall_nr, error_nr, ptrarg); 1500 filter_add_errno(fd, syscall_nr, error_nr, ptrarg);
1493 } 1501 }
@@ -1510,7 +1518,7 @@ static void find_syscall(int fd, int syscall, int arg, void *ptrarg) {
1510 (void)fd; 1518 (void)fd;
1511 (void) arg; 1519 (void) arg;
1512 SyscallCheckList *ptr = ptrarg; 1520 SyscallCheckList *ptr = ptrarg;
1513 if (syscall == ptr->syscall) 1521 if (abs(syscall) == ptr->syscall)
1514 ptr->found = true; 1522 ptr->found = true;
1515} 1523}
1516 1524