From 680d6070c1343fa90d5f1ea59299db9063e9bb15 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 19 Jun 2020 06:12:25 -0700 Subject: 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. --- parser.c | 6 ++++-- 1 file 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); -- cgit v1.2.3