From 77db9042493a3b6adab6e2e95baedc3e691a4212 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Tue, 1 Nov 2011 10:56:53 +0000 Subject: [PATCH] Really fix KRB5CCNAME. Pass KRB5CCNAME through to the failsafe kinit only if -c wasn't used. --- .profile.d/krb5.bashrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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+"$@"} ) } -- 2.20.1