mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 12:36:00 +01:00
Check sandbox mode before running xdg-open
This commit is contained in:
parent
abb76d8dfe
commit
18ae9da3e1
1 changed files with 5 additions and 5 deletions
|
@ -235,7 +235,9 @@ link_launch(zathura_t* zathura, const zathura_link_t* link)
|
||||||
g_free(dir);
|
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."));
|
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Failed to run xdg-open."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,11 +261,9 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
|
||||||
case ZATHURA_LINK_URI:
|
case ZATHURA_LINK_URI:
|
||||||
if (zathura->global.sandbox == ZATHURA_SANDBOX_STRICT) {
|
if (zathura->global.sandbox == ZATHURA_SANDBOX_STRICT) {
|
||||||
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Opening external applications in strict sandbox mode is not permitted"));
|
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Opening external applications in strict sandbox mode is not permitted"));
|
||||||
} else {
|
} else if (girara_xdg_open(link->target.value) == false) {
|
||||||
if (girara_xdg_open(link->target.value) == false) {
|
|
||||||
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Failed to run xdg-open."));
|
girara_notify(zathura->ui.session, GIRARA_ERROR, _("Failed to run xdg-open."));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ZATHURA_LINK_LAUNCH:
|
case ZATHURA_LINK_LAUNCH:
|
||||||
link_launch(zathura, link);
|
link_launch(zathura, link);
|
||||||
|
|
Loading…
Reference in a new issue