taro-ls: fix bad label; taro-ctl: add backup anti traversal for refile

This commit is contained in:
Iris Lightshard 2024-05-05 18:39:51 -06:00
parent edbed1f703
commit 5f40f208ed
Signed by: nilix
GPG key ID: 688407174966CAF3
2 changed files with 3 additions and 3 deletions

View file

@ -236,9 +236,9 @@ module Taro
def refile_mail(range_start : UInt16, range_end : UInt16, to_mbox : String) def refile_mail(range_start : UInt16, range_end : UInt16, to_mbox : String)
canonical_mbox = run_cmd("readlink -f '#{MBOX_ROOT}/#{to_mbox.gsub("'", "\'")}'").to_s canonical_mbox = run_cmd("readlink -f '#{MBOX_ROOT}/#{to_mbox.gsub("'", "\'")}'").to_s
# if readlink is not available, fall back to what the user gave :shrug: # if readlink is not available, do this naive trick with cd :shrug:
if canonical_mbox.empty? if canonical_mbox.empty?
canonical_mbox = "#{MBOX_ROOT}/#{to_mbox}" canonical_mbox = run_cmd("cd #{MBOX_ROOT}/#{to_mbox}; pwd").to_s
end end
if canonical_mbox.starts_with?(MBOX_ROOT) if canonical_mbox.starts_with?(MBOX_ROOT)

View file

@ -224,7 +224,7 @@ JMP2r
STHkr LB_SELECT_IDX LDZ2 STHkr LB_LEN LDZ2 GTH2 #00 EQU ,&done JCN STHkr LB_SELECT_IDX LDZ2 STHkr LB_LEN LDZ2 GTH2 #00 EQU ,&done JCN
STHkr LB_LEN LDZ2 #0001 SUB2 STHkr LB_LEN LDZ2 #0001 SUB2
STHkr LB_SELECT_IDX STZ2 STHkr LB_SELECT_IDX STZ2
@done &done
POPr POPr
JMP2r JMP2r