summaryrefslogtreecommitdiff
path: root/sh/prp
diff options
context:
space:
mode:
Diffstat (limited to 'sh/prp')
-rwxr-xr-xsh/prp8
1 files changed, 8 insertions, 0 deletions
diff --git a/sh/prp b/sh/prp
index 541b2ee..1bdab0e 100755
--- a/sh/prp
+++ b/sh/prp
@@ -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"