X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2Fkrb5.bashrc;h=4c5f71d1a43a43aa200f864d4e9e1fbb1fafc2dd;hb=2f9e7ea7eef75b2db46c90066f24c37f8733cbfb;hp=477dc3f78600c8ad7a51779514d00ef350248fd3;hpb=a324d2bcb5a8fc1c8638aa19c60078b94b4e4ecf;p=profile.git diff --git a/.profile.d/krb5.bashrc b/.profile.d/krb5.bashrc index 477dc3f..4c5f71d 100644 --- a/.profile.d/krb5.bashrc +++ b/.profile.d/krb5.bashrc @@ -3,7 +3,7 @@ alias pssh='ssh -o preferredauthentications=password,keyboard-interactive' unalias kinit 2>/dev/null if [ 1 = 0 -a -z "$OLDSOLARIS" -a -z "$OLDREDHAT" ]; then - if tty -s; then + if [ -t 0 ]; then if [ ! "$SUDO_UID" ]; then if klist -s 2>/dev/null; then # We already have a ticket cache. Renew it. @@ -87,5 +87,11 @@ fi unset cache ccname default ng function kinit() { - ( builtin cd /; exec -c kinit ${1+"$@"} ) + local args= + local krb5ccname= + if [ -n "$KRB5CCNAME" ]; then + args="$@" + [ "${args/-c /}" = "$args" ] && krb5ccname="-c $KRB5CCNAME" + fi + ( builtin cd /; exec -c kinit $krb5ccname ${1+"$@"} ) }