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 | 2f2d654c20c75a7cc6e5c1c28803f475c929abba (patch) | |
tree | abedca54286718724c91a639245924fe918a53c3 | |
parent | f063fb64a24be163903ec0560eaba9af05cab25c (diff) | |
download | txr-2f2d654c20c75a7cc6e5c1c28803f475c929abba.tar.gz txr-2f2d654c20c75a7cc6e5c1c28803f475c929abba.tar.bz2 txr-2f2d654c20c75a7cc6e5c1c28803f475c929abba.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); |