Subject: | kadmin hangs indefinitely when admin princ has escaped chars |
Cc: | Mark.Phalan@Sun.COM |
kadmin hangs indefinitely when an admin principal contains escaped '@'s
or '\'s.
bash-3.00# /usr/local/bin/kinit 'pop\@home/admin'
Password for pop\@home/admin@ACME.COM:
bash-3.00# /usr/local/sbin/kadmin
<hangs indefinitely here>
I've attached a suggested fix.
--- kadmin.c- Wed Apr 26 14:39:39 2006
+++ kadmin.c Wed Apr 26 14:40:43 2006
@@ -342,7 +342,7 @@
if (realm - canon && *(realm - 1) != '\\')
break;
else
- realm = strchr(realm, '@');
+ realm = strchr(realm + 1, '@');
}
if (realm)
*realm++ = '\0';
@@ -351,7 +351,7 @@
if (cp - canon && *(cp - 1) != '\\')
break;
else
- cp = strchr(cp, '/');
+ cp = strchr(cp + 1, '/');
}
if (cp != NULL)
*cp = '\0';
+++ kadmin.c Wed Apr 26 14:40:43 2006
@@ -342,7 +342,7 @@
if (realm - canon && *(realm - 1) != '\\')
break;
else
- realm = strchr(realm, '@');
+ realm = strchr(realm + 1, '@');
}
if (realm)
*realm++ = '\0';
@@ -351,7 +351,7 @@
if (cp - canon && *(cp - 1) != '\\')
break;
else
- cp = strchr(cp, '/');
+ cp = strchr(cp + 1, '/');
}
if (cp != NULL)
*cp = '\0';