fix print in strict sandbox mode

This commit is contained in:
valoq 2018-03-11 16:10:57 +01:00
parent 3d06164d71
commit f101efe97e
Failed to generate hash of commit
3 changed files with 10 additions and 1 deletions

View file

@ -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;

View file

@ -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; }

View file

@ -309,7 +309,6 @@ main(int argc, char* argv[])
} else {
girara_error("Invalid sandbox option");
ret = -1;
goto free_and_ret;
}
g_free(sandbox);