improve feedback

This commit is contained in:
valoq 2022-11-10 16:15:57 +01:00
parent 004a35dba1
commit 5ba87e5c72
Failed to generate hash of commit
2 changed files with 17 additions and 2 deletions

View file

@ -308,6 +308,11 @@ cmd_save(girara_session_t* session, girara_list_t* argument_list)
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
if (zathura->global.sandbox == ZATHURA_SANDBOX_STRICT) {
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Saving is not permitted in strict sandbox mode"));
return false;
}
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, _("No document opened."));
return false;
@ -330,6 +335,11 @@ cmd_savef(girara_session_t* session, girara_list_t* argument_list)
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
if (zathura->global.sandbox == ZATHURA_SANDBOX_STRICT) {
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Saving is not permitted in strict sandbox mode"));
return false;
}
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, _("No document opened."));
return false;
@ -426,6 +436,12 @@ cmd_export(girara_session_t* session, girara_list_t* argument_list)
g_return_val_if_fail(session != NULL, false);
g_return_val_if_fail(session->global.data != NULL, false);
zathura_t* zathura = session->global.data;
if (zathura->global.sandbox == ZATHURA_SANDBOX_STRICT) {
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Exporting attachments is not permitted in strict sandbox mode"));
return false;
}
if (zathura->document == NULL) {
girara_notify(session, GIRARA_ERROR, _("No document opened."));
return false;

View file

@ -203,7 +203,7 @@ seccomp_enable_strict_filter(zathura_t* zathura)
/* ALLOW_RULE (open); specified below */
/* ALLOW_RULE (openat); specified below */
/* ALLOW_RULE(pipe); unused? */
/* ALLOW_RULE(pipe2); unused? required by x11, see below */
ALLOW_RULE(pipe2);
ALLOW_RULE(poll);
ALLOW_RULE(pwrite64); /* equals pwrite */
ALLOW_RULE(pread64); /* equals pread */
@ -257,7 +257,6 @@ seccomp_enable_strict_filter(zathura_t* zathura)
ALLOW_RULE(setsockopt);
ALLOW_RULE(getsockopt);
ALLOW_RULE(getsockname);
ALLOW_RULE(pipe2);
ALLOW_RULE(connect);
ALLOW_RULE(umask);
ALLOW_RULE(uname);