diff options
| author | Xiao Pan <gky44px1999@gmail.com> | 2024-02-28 23:14:00 -0800 | 
|---|---|---|
| committer | Xiao Pan <gky44px1999@gmail.com> | 2024-02-28 23:14:00 -0800 | 
| commit | 13dfec54b934922384f92826dfc7bc2fa7726223 (patch) | |
| tree | 331e48c9cf815fb0b58daa19d20d28643cd043ff /sh | |
| parent | 75795e120a5a49950a24b25999521faf9cb7edf1 (diff) | |
unset prp pass vars just in case it being sourced
Diffstat (limited to 'sh')
| -rwxr-xr-x | sh/prp | 8 | 
1 files changed, 8 insertions, 0 deletions
| @@ -1,6 +1,9 @@  #!/bin/sh  # PRactice Password +# maybe will leak password to ps/top/htop and swap file +# not sure I only compare the password variables will leak or not +  read_pass () {  	stty -echo  	# -r necessary because password may contain backslash \ @@ -17,4 +20,9 @@ while ! [ "$entered_pass" = "$correct_pass" ]; do  	echo "Wrong password, enter again:"  	read_pass  done + +# `. /bin/prp` will set these password variables as environment variables and can be accessed by the whole shell, so I unset these just in case +unset entered_pass +unset correct_pass +  echo "Correct password" | 
