Fix: syscall: fail disable all if all already disabled
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 24 Sep 2014 01:02:51 +0000 (21:02 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 26 Sep 2014 16:10:00 +0000 (12:10 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-syscalls.c

index 1489934f3319bbad05de08d3c404f155bd2feac7..00584e3eb2ed907cbe241b42756fe345ad5fc512 100644 (file)
@@ -1048,6 +1048,14 @@ int lttng_syscall_filter_disable(struct lttng_channel *chan,
        }
 
        if (!name) {
+               /* Fail if all syscalls are already disabled. */
+               if (bitmap_empty(filter->sc, NR_syscalls)
+                       && bitmap_empty(filter->sc_compat,
+                               NR_compat_syscalls)) {
+                       ret = -EEXIST;
+                       goto error;
+               }
+
                /* Disable all system calls */
                bitmap_clear(filter->sc, 0, NR_syscalls);
                bitmap_clear(filter->sc_compat, 0, NR_compat_syscalls);
This page took 0.02636 seconds and 4 git commands to generate.