From: Alex Dehnert Date: Fri, 17 May 2013 06:31:04 +0000 (-0400) Subject: krbroot: harden the shell settings X-Git-Url: https://www.dehnerts.com/gitweb/?p=user%2Falex%2Fsoftware%2Fmy-snippets.git;a=commitdiff_plain;h=feda579ec7b7e241708573a22d8c66e571a6cafe krbroot: harden the shell settings See https://sipb.mit.edu/doc/safe-shell/ for the logic. --- diff --git a/krbroot b/krbroot index 5f0515d..37e0429 100755 --- a/krbroot +++ b/krbroot @@ -1,5 +1,7 @@ #!/bin/sh +set -euf + usage="Usage: $0 [-i instance] [-p principal] [-a addrend] subcommand [args]" principal="$ATHENA_USER/root@ATHENA.MIT.EDU" @@ -23,7 +25,7 @@ init () { kinit -F -5 -l15m "$principal" "$@" } -case $1 in +case ${1:-} in init) shift; exec kinit -F -5 -l15m "$principal" "$@"