mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-27 16:47:53 +01:00
Extend error messages
This commit is contained in:
parent
2877694d0a
commit
875108c911
1 changed files with 20 additions and 2 deletions
|
@ -12,8 +12,26 @@
|
|||
#include <errno.h>
|
||||
#include <girara/utils.h>
|
||||
|
||||
#define DENY_RULE(call) { if (seccomp_rule_add (ctx, SCMP_ACT_KILL, SCMP_SYS(call), 0) < 0) goto out; }
|
||||
#define ALLOW_RULE(call) { if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, SCMP_SYS(call), 0) < 0) goto out; }
|
||||
#define DENY_RULE(call) \
|
||||
do { \
|
||||
girara_debug("denying " G_STRINGIFY(call)); \
|
||||
const int err = seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(call), 0); \
|
||||
if (err < 0) { \
|
||||
girara_error("failed to deny " G_STRINGIFY(call) ": %s", \
|
||||
g_strerror(-err)); \
|
||||
goto out; \
|
||||
} \
|
||||
} while (0)
|
||||
#define ALLOW_RULE(call) \
|
||||
do { \
|
||||
girara_debug("allowing " G_STRINGIFY(call)); \
|
||||
const int err = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(call), 0); \
|
||||
if (err < 0) { \
|
||||
girara_error("failed to allow " G_STRINGIFY(call) ": %s", \
|
||||
g_strerror(-err)); \
|
||||
goto out; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
int
|
||||
seccomp_enable_basic_filter(void)
|
||||
|
|
Loading…
Reference in a new issue