diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-06-19 06:12:25 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-06-19 06:12:25 -0700 |
commit | 680d6070c1343fa90d5f1ea59299db9063e9bb15 (patch) | |
tree | abedca54286718724c91a639245924fe918a53c3 | |
parent | 2b427902a9b23ecefab37fb3a47689ac978d2817 (diff) | |
download | txr-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); |