Commit 18ae9da3 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Check sandbox mode before running xdg-open

parent abb76d8d
......@@ -235,7 +235,9 @@ link_launch(zathura_t* zathura, const zathura_link_t* link)
g_free(dir);
}
if (girara_xdg_open(path) == false) {
if (zathura->global.sandbox == ZATHURA_SANDBOX_STRICT) {
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Opening external applications in strict sandbox mode is not permitted"));
} else if (girara_xdg_open(path) == false) {
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Failed to run xdg-open."));
}
......@@ -259,10 +261,8 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
case ZATHURA_LINK_URI:
if (zathura->global.sandbox == ZATHURA_SANDBOX_STRICT) {
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Opening external applications in strict sandbox mode is not permitted"));
} else {
if (girara_xdg_open(link->target.value) == false) {
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Failed to run xdg-open."));
}
} else if (girara_xdg_open(link->target.value) == false) {
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Failed to run xdg-open."));
}
break;
case ZATHURA_LINK_LAUNCH:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment