summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-06-19 06:12:25 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-06-19 06:12:25 -0700
commit680d6070c1343fa90d5f1ea59299db9063e9bb15 (patch)
treeabedca54286718724c91a639245924fe918a53c3
parent2b427902a9b23ecefab37fb3a47689ac978d2817 (diff)
downloadtxr-680d6070c1343fa90d5f1ea59299db9063e9bb15.tar.gz
txr-680d6070c1343fa90d5f1ea59299db9063e9bb15.tar.bz2
txr-680d6070c1343fa90d5f1ea59299db9063e9bb15.zip
listener: perms complaint for missing .txr_history
* parser.c (repl): The listener wrongly complains that .txr_history has bad permissions when it doesn't exist. New users of TXR won't have a history file, so this looks sloppy. Since we load the history file regardless of the check, let's do the check in the case when the file has successfully loaded.
-rw-r--r--parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/parser.c b/parser.c
index 8b0d1dd4..7698ac24 100644
--- a/parser.c
+++ b/parser.c
@@ -1475,9 +1475,11 @@ val repl(val bindings, val in_stream, val out_stream, val env)
lino_hist_set_max_len(ls, c_num(cdr(hist_len_var)));
if (histfile_w) {
- if (!funcall1(path_private_to_me_p, histfile))
+ if (lino_hist_load(ls, histfile_w) == 0 &&
+ !funcall1(path_private_to_me_p, histfile))
+ {
report_security_problem(histfile);
- lino_hist_load(ls, histfile_w);
+ }
}
lino_set_noninteractive(ls, opt_noninteractive);