Add target UID to KRB5CCNAME when becoming.
authorIain Patterson <me@iain.cx>
Fri, 12 Feb 2010 10:51:17 +0000 (10:51 +0000)
committerIain Patterson <me@iain.cx>
Thu, 18 Feb 2010 17:45:21 +0000 (17:45 +0000)
.profile.d/krb5.bashrc

index 973101f..979bd71 100644 (file)
@@ -59,7 +59,7 @@ if [ -z "$OLDSOLARIS" -a -z "$OLDREDHAT" ]; then
       # Don't break permissions of inherited cache under sudo.
       cache="${KRB5CCNAME##FILE:}"
       if [ ! "$cache" = "$KRB5CCNAME" ]; then
-        ccname="${cache/_$SUDO_UID/_sudo_$SUDO_UID}_$$"
+        ccname="${cache/_$SUDO_UID/_${UID}_sudo_$SUDO_UID}_$$"
         export KRB5CCNAME="FILE:$ccname"
         if cat "$cache" > "$ccname" 2>/dev/null; then
           klist -s 2>/dev/null && kinit -R 2>/dev/null || kinit $PRINCIPAL