unalias kinit 2>/dev/null
if [ 1 = 0 -a -z "$OLDSOLARIS" -a -z "$OLDREDHAT" ]; then
- if tty -s; then
+ if [ -t 0 ]; then
+ # Canonicalise the cache name.
+ if [ -n "$KRB5CCNAME" -a "${KRB5CCNAME##*:}" = "$KRB5CCNAME" ]; then
+ export KRB5CCNAME="FILE:$KRB5CCNAME"
+ fi
+
if [ ! "$SUDO_UID" ]; then
if klist -s 2>/dev/null; then
# We already have a ticket cache. Renew it.