mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 20:36:01 +01:00
fix print in strict sandbox mode
This commit is contained in:
parent
3d06164d71
commit
f101efe97e
3 changed files with 10 additions and 1 deletions
|
@ -280,6 +280,15 @@ cmd_print(girara_session_t* session, girara_list_t* UNUSED(argument_list))
|
|||
return false;
|
||||
}
|
||||
|
||||
char* sandbox = NULL;
|
||||
girara_setting_get(zathura->ui.session, "sandbox", &sandbox);
|
||||
if (g_strcmp0(sandbox, "strict") == 0) {
|
||||
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Printing is not permitted in strict sandbox mode"));
|
||||
g_free(sandbox);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
print(zathura);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#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; }
|
||||
|
|
|
@ -309,7 +309,6 @@ main(int argc, char* argv[])
|
|||
} else {
|
||||
girara_error("Invalid sandbox option");
|
||||
ret = -1;
|
||||
goto free_and_ret;
|
||||
}
|
||||
|
||||
g_free(sandbox);
|
||||
|
|
Loading…
Reference in a new issue