shithub: riscv

Download patch

ref: 2763229c0032c35dcd035eb7fa315c48d1c9e1ad
parent: ff47cbd46489ed73eeb06861e6df7ac6f5bb1a44
author: cinap_lenrek <[email protected]>
date: Tue Apr 19 20:41:03 EDT 2016

rcpu: make sure not to leak /env/fn#server and /env/fn#aanserver for drawterm (thanks mischief)

--- a/rc/bin/rconnect
+++ b/rc/bin/rconnect
@@ -60,9 +60,9 @@
 			rfork n
 			fn server {
 				echo -n aanserver $netdir >/proc/$pid/args
+				rm -f /env/^('fn#server' 'fn#aanserver')
 				. <{n=`{read} && ! ~ $#n 0 && read -c $n} >[2=1]
 			}
-			rm -f /env/^'fn#aanserver'
 			exec tlssrv -A /bin/rc -c server
 			exit
 		}
--- a/rc/bin/service/tcp17019
+++ b/rc/bin/service/tcp17019
@@ -3,6 +3,7 @@
 remote=$2!`{cat $3/remote}
 fn server {
 	echo -n $netdir $remote >/proc/$pid/args
+	rm -f /env/'fn#server'
 	. <{n=`{read} && ! ~ $#n 0 && read -c $n} >[2=1]
 }
 exec tlssrv -a /bin/rc -c server