summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-05-26 22:49:23 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-05-26 22:49:23 +0200
commitd9379fd4f43dc7888d5fb82630ddd9b0bfa9e892 (patch)
tree581602986de639120a9bfa2606a87502e39c5d8a
parent36b1de62c371746603ef0221103aa10787ae40b3 (diff)
downloadmum-d9379fd4f43dc7888d5fb82630ddd9b0bfa9e892.tar.gz
getpw: Handle SIGINT properly
-rwxr-xr-xsrc/getpw2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/getpw b/src/getpw
index 8115716..5416797 100755
--- a/src/getpw
+++ b/src/getpw
@@ -2,6 +2,8 @@
# getpw -- read password
+trap 'stty echo; echo; exit 130' INT
+
printf 'Enter password: ' > /dev/tty
stty -f /dev/tty -echo
read PASSWORD < /dev/tty