Commit fbb6208d authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

browser, files: use full path in error message when in confined mode

The relative path could be . or .. or even empty, which is uninformative.

This fixes the last part of https://savannah.gnu.org/bugs/?47798.
parent c0285682
Showing with 4 additions and 4 deletions
+4 -4
...@@ -248,7 +248,7 @@ char *do_browser(char *path, DIR *dir) ...@@ -248,7 +248,7 @@ char *do_browser(char *path, DIR *dir)
/* TRANSLATORS: This refers to the option --operatingdir, /* TRANSLATORS: This refers to the option --operatingdir,
* not to --restricted. */ * not to --restricted. */
statusline(ALERT, _("Can't go outside of %s " statusline(ALERT, _("Can't go outside of %s "
"in confined mode"), operating_dir); "in confined mode"), full_operating_dir);
free(new_path); free(new_path);
continue; continue;
} }
...@@ -300,7 +300,7 @@ char *do_browser(char *path, DIR *dir) ...@@ -300,7 +300,7 @@ char *do_browser(char *path, DIR *dir)
* directory outside the operating directory. */ * directory outside the operating directory. */
if (check_operating_dir(filelist[selected], FALSE)) { if (check_operating_dir(filelist[selected], FALSE)) {
statusline(ALERT, _("Can't go outside of %s " statusline(ALERT, _("Can't go outside of %s "
"in confined mode"), operating_dir); "in confined mode"), full_operating_dir);
continue; continue;
} }
#endif #endif
......
...@@ -428,7 +428,7 @@ bool open_buffer(const char *filename, bool undoable) ...@@ -428,7 +428,7 @@ bool open_buffer(const char *filename, bool undoable)
#ifndef DISABLE_OPERATINGDIR #ifndef DISABLE_OPERATINGDIR
if (check_operating_dir(filename, FALSE)) { if (check_operating_dir(filename, FALSE)) {
statusline(ALERT, _("Can't insert file from outside of %s"), statusline(ALERT, _("Can't insert file from outside of %s"),
operating_dir); full_operating_dir);
return FALSE; return FALSE;
} }
#endif #endif
...@@ -1777,7 +1777,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type ...@@ -1777,7 +1777,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
/* If we're writing a temporary file, we're probably going outside /* If we're writing a temporary file, we're probably going outside
* the operating directory, so skip the operating directory test. */ * the operating directory, so skip the operating directory test. */
if (!tmp && check_operating_dir(realname, FALSE)) { if (!tmp && check_operating_dir(realname, FALSE)) {
statusline(ALERT, _("Can't write outside of %s"), operating_dir); statusline(ALERT, _("Can't write outside of %s"), full_operating_dir);
goto cleanup_and_exit; goto cleanup_and_exit;
} }
#endif #endif
......
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