From 346536564be30c25ce6e49966f0137895591708f Mon Sep 17 00:00:00 2001 From: valoq Date: Sun, 15 Apr 2018 13:00:31 +0200 Subject: [PATCH 1/2] sandbox fixes --- zathura/commands.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zathura/commands.c b/zathura/commands.c index 64b9ccf..285739f 100644 --- a/zathura/commands.c +++ b/zathura/commands.c @@ -532,6 +532,15 @@ cmd_exec(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; + char* sandbox = NULL; + girara_setting_get(zathura->ui.session, "sandbox", &sandbox); + if (g_strcmp0(sandbox, "strict") == 0) { + girara_notify(zathura->ui.session, GIRARA_ERROR, _("Exec is not permitted in strict sandbox mode")); + g_free(sandbox); + return false; + } + g_free(sandbox); + if (zathura->document != NULL) { const char* path = zathura_document_get_path(zathura->document); From 193b825ddd8c2f84ce5484a6f53332918cd2f46b Mon Sep 17 00:00:00 2001 From: valoq Date: Fri, 25 May 2018 21:05:41 +0200 Subject: [PATCH 2/2] check sandbox cleanup --- zathura/commands.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/zathura/commands.c b/zathura/commands.c index 285739f..ee8cdac 100644 --- a/zathura/commands.c +++ b/zathura/commands.c @@ -532,14 +532,10 @@ cmd_exec(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; - char* sandbox = NULL; - girara_setting_get(zathura->ui.session, "sandbox", &sandbox); - if (g_strcmp0(sandbox, "strict") == 0) { + if (zathura->global.sandbox == ZATHURA_SANDBOX_STRICT) { girara_notify(zathura->ui.session, GIRARA_ERROR, _("Exec is not permitted in strict sandbox mode")); - g_free(sandbox); return false; } - g_free(sandbox); if (zathura->document != NULL) { const char* path = zathura_document_get_path(zathura->document);