From: Iain Patterson Date: Tue, 1 Nov 2011 10:56:53 +0000 (+0000) Subject: Really fix KRB5CCNAME. X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=77db9042493a3b6adab6e2e95baedc3e691a4212;p=profile.git Really fix KRB5CCNAME. Pass KRB5CCNAME through to the failsafe kinit only if -c wasn't used. --- diff --git a/.profile.d/krb5.bashrc b/.profile.d/krb5.bashrc index 2ca4337..034dadd 100644 --- a/.profile.d/krb5.bashrc +++ b/.profile.d/krb5.bashrc @@ -87,6 +87,11 @@ fi unset cache ccname default ng function kinit() { - [ -n "$KRB5CCNAME" ] && krb5ccname="env KRB5CCNAME=$KRB5CCNAME" - ( builtin cd /; exec -c $krb5ccname 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+"$@"} ) }