all repos — taro @ edbed1f7031b386ccfadcd2df2718c1bfa25e0fe

mblaze frontend in uxn + crystal

path traversal fix, license, update to 0.2.7
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQT/foVVmI9pK13hPWFohAcXSWbK8wUCZje9PAAKCRBohAcXSWbK
8xn+AQDS0tYSbTTR58+cjcu9Gl1ZJfLL3QF+YA3e/r30nSHvLAEAn+wIplyEQamb
GOS8QfDKi+NOgUDooEDWh28qJ/ceVQQ=
=GSda
-----END PGP SIGNATURE-----
commit

edbed1f7031b386ccfadcd2df2718c1bfa25e0fe

parent

539e8fc2629e2447fc44c2d1ed6d630bbd1c832b

4 files changed, 63 insertions(+), 15 deletions(-)

jump to
A LICENSE

@@ -0,0 +1,21 @@

+MIT License + +Copyright (c) 2023 Iris Lightshard <nilix@nilfm.cc> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.
M taro-ctl.crtaro-ctl.cr

@@ -234,9 +234,17 @@ run_cmd(cmd)

end def refile_mail(range_start : UInt16, range_end : UInt16, to_mbox : String) - to_mbox = to_mbox.gsub("'", "\'").gsub("../", "./").gsub("..", "") - cmd = "mrefile #{range_start}:#{range_end} '#{MBOX_ROOT}/#{to_mbox}'" - run_cmd(cmd) + 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 canonical_mbox.empty? + canonical_mbox = "#{MBOX_ROOT}/#{to_mbox}" + end + + if canonical_mbox.starts_with?(MBOX_ROOT) + cmd = "mrefile #{range_start}:#{range_end} #{canonical_mbox.gsub(" ", "\ ").gsub("\"", "\\\"").gsub("'", "\'")}" + run_cmd(cmd) + end end def search_mail(query : String, body : Bool, case_sensitive : Bool) : IO::Memory
M taro-ls.taltaro-ls.tal

@@ -85,7 +85,7 @@ load_theme

load_font #0280 .Screen/width DEO2 - #01c0 .Screen/height DEO2 + #0100 .Screen/height DEO2 ;list_data .list/data STZ2 ;mbox_data .mboxes/data STZ2

@@ -205,19 +205,35 @@ .pending_ops LDZ #01 SUB .pending_ops STZ

#01 .refresh/etc STZ &no_dec_pending .list/bytes LDZ2 .decoding/count LDZ2 NEQ2 ,&no_list JCN - #01 .refresh/list STZ - &no_list + .list scroll_to_content + #01 .refresh/list STZ + &no_list .mboxes/bytes LDZ2 .decoding/count LDZ2 NEQ2 ,&no_mbox JCN - #01 .refresh/mboxes STZ - &no_mbox + .mboxes scroll_to_content + #01 .refresh/mboxes STZ + &no_mbox JMP2r +@scroll_to_content ( listbox -- ) + + STHk LB_TOP LDZ2 STHrk LB_LEN LDZ2 GTH2 #00 EQU ,&nvm JCN + STHkr LB_LEN LDZ2 STHkr LB_HEIGHT LDZ2 SUB2 + STHkr LB_TOP STZ2 + &nvm + STHkr LB_SELECT_IDX LDZ2 STHkr LB_LEN LDZ2 GTH2 #00 EQU ,&done JCN + STHkr LB_LEN LDZ2 #0001 SUB2 + STHkr LB_SELECT_IDX STZ2 + @done + POPr +JMP2r + + ( -== message out ==- ) @send_get_mbox ( -- ) - #01 .Console/write DEO + GET_MBOX .Console/write DEO ;selected_mbox strlen SWP .Console/write DEO .Console/write DEO ;selected_mbox send_str

@@ -339,6 +355,7 @@

.pending_ops LDZk INC SWP STZ JMP2r + ( -== input ==- )

@@ -1315,9 +1332,9 @@ 0408 191e 1d00 0000 4080 00a8 5000 0000

] @metadata [ 00 "taro 0a - "v0.2.5 0a + "v0.2.7 0a "GUI 20 "for 20 "mblaze 0a - "Derek 20 "Stevens 20 "<nilix@nilfm.cc> 0a 00 + "Iris 20 "Lightshard 20 "<nilix@nilfm.cc> 0a 00 ] @selected_mbox "INBOX 00 $f9 ( default mailbox is INBOX, total space #06 + #f9 = #ff bytes )
M taro-readertaro-reader

@@ -16,6 +16,8 @@ application/vnd*)

libreoffice $1;; application/pdf) zathura $1;; + *) + less $1;; esac }

@@ -55,8 +57,8 @@ }

keep_track_of_mailfile() { orig=$1 - stamp=${orig%,} - new=$(\ls -1 ${stamp}*) + stamp=${orig%,*} + new=$(echo ${stamp}*) printf "${new}" }

@@ -65,9 +67,9 @@ local this=$(mseq $@)

mflag -S ${this} while true; do this=$(keep_track_of_mailfile ${this}) - if [ ! -e ${this} ]; then + if [ ! -e "${this}" ]; then printf "Looks like this email was refiled... Press Enter to close this window. " - read + read r break fi