aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2020-02-29 18:13:46 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2020-02-29 18:13:46 +0000
commitb9637eac9f3c40594a82188450383a8d6472b6f8 (patch)
tree956fe1d33d1153f928b993a917f22af705a5dd3b
parenteff0a75f2a1571e901f82ba631ee078d50ac82cd (diff)
downloadcpt-b9637eac9f3c40594a82188450383a8d6472b6f8.tar.gz
kiss: Abort if not TTY and needed
FossilOrigin-Name: 6b464ae8ed15a5bca76b4aecc7c0b17a55bf252231ff0991c289b9401a2cb233
-rwxr-xr-xkiss5
1 files changed, 5 insertions, 0 deletions
diff --git a/kiss b/kiss
index 821b77f..9d4e877 100755
--- a/kiss
+++ b/kiss
@@ -1216,6 +1216,11 @@ args() {
die "Arguments contain invalid characters: '!*[]'"
esac
+ # Abort early if output is not a TTY and the requirement is that it
+ # be so (password prompts, user input, etc). This is a safeguard.
+ [ "${action##[bciru]*}" ] || [ -t 1 ] ||
+ die "Output not a tty"
+
# Parse some arguments earlier to remove the need to duplicate code.
case $action in
c|checksum|s|search)