commit a13b0bc8545c22eaaa1e0989aa7e08a62e3ae2c1
parent bbdbf4586fafdba8d055a676438c874631e229de
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 20 Jun 2020 14:45:04 +0200
files: disallow tabbing when in restricted mode
Tabbing can list all files in the given directory, but restricted mode
is supposed to prevent the user from any access to the filesystem...
This fixes https://savannah.gnu.org/bugs/?58632.
Bug existed (in this form) since version 1.3.4, commit f7b5d930.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -2076,8 +2076,8 @@ int do_writeout(bool exiting, bool withprompt)
answer = mallocstrcpy(answer, openfile->filename);
else {
/* Ask for (confirmation of) the filename. Disable tab completion
- * when using restricted mode and the filename isn't blank. */
- response = do_prompt(!ISSET(RESTRICTED) || openfile->filename[0] == '\0',
+ * when in restricted mode. */
+ response = do_prompt(!ISSET(RESTRICTED),
MWRITEFILE, given, NULL,
edit_refresh, "%s%s%s", msg,
#ifndef NANO_TINY