[3265] in Kerberos-V5-bugs
pending/1010: Re: Infinite loop in src/kadmin/cli/kadmin.c:kadmin_parse_name()
daemon@ATHENA.MIT.EDU (Nicolas Williams)
Mon Nov 5 13:56:06 2001
Resent-From: gnats@rt-11.mit.edu (GNATS Management)
Resent-To: gnats-admin@rt-11.mit.edu
Resent-Reply-To: krb5-bugs@MIT.EDU,
Nicolas Williams <Nicolas.Williams@ubsw.com>
Message-Id: <20011105135506.L26615@wdr.com>
Date: Mon, 5 Nov 2001 13:55:06 -0500
From: Nicolas Williams <Nicolas.Williams@ubsw.com>
To: krb5-bugs@mit.edu
In-Reply-To: <200111051542.KAA22169@sm0d1989cmp.stm.swissbank.com>; from Nicolas Williams on Mon, Nov 05, 2001 at 10:42:32AM -0500
>Number: 1010
>Category: pending
>Synopsis: Re: Infinite loop in src/kadmin/cli/kadmin.c:kadmin_parse_name()
>Confidential: yes
>Severity: serious
>Priority: medium
>Responsible: gnats-admin
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Mon Nov 5 13:56:01 EST 2001
>Last-Modified:
>Originator:
>Organization:
>Release:
>Environment:
>Description:
>How-To-Repeat:
>Fix:
>Audit-Trail:
>Unformatted:
Ooops. The patch is a bit more involved, actually... The else clause of
that if statement does "cp = strchr(cp, '@');" and it really should read
"cp = strchr(cp + 1, '@');".
Of course, why kadmin.local would use a different function that the
rest of the krb5 stuff, including the kadmin client cli, baffles me.
Particularly when krb5_parse_name() does everything that
kadmin_parse_name() would...
So perhaps the better patch would be to remove kadmin_parse_name()
altogether.
Cheers,
Nico
On Mon, Nov 05, 2001 at 10:42:32AM -0500, Nicolas Williams wrote:
>
> >Submitter-Id: net
> >Originator: Nicolas Williams
> >Organization: UBS Warburg / Perot Systems Corp.
> --
> >Confidential: no
> >Synopsis: kadmin_parse_name() loops forever with, e.g., '@SOME.REALM'
> >Severity: non-critical
> >Priority: medium
> >Category: krb5-admin
> >Class: sw-bug
> >Release: krb5-1.2.2
> >Environment: Ultra-SPARC, Solaris 2.6
> System: SunOS sm0d1989cmp 5.6 Generic_105181-12 sun4u sparc SUNW,Ultra-2
> Architecture: sun4
>
> >Description:
> Line 149 of src/kadmin/cli/kadmin.c should read:
>
> if (cp == fullname || *(cp - 1) != '\\')
>
> instead of:
>
> if (cp - fullname && *(cp - 1) != '\\')
>
> The expression (cp - fullname) is always true except when the
> name being parsed starts with '@' and therefore is useless.
>
> I believe the break condition was meant to be (cp == fullname || ...).
>
> >How-To-Repeat:
> kadmin.local -q "ank -randkey @SWISSBANK.COM"
> >Fix:
> Here's the unified patch:
>
> Index: PER-122.19/kadmin/cli/kadmin.c
> --- PER-122.19/kadmin/cli/kadmin.c Wed, 14 Mar 2001 14:20:32 -0500
> +++ PER-122.19(w)/kadmin/cli/kadmin.c Mon, 05 Nov 2001 10:39:06 -0500
> @@ -146,7 +146,7 @@
> strcpy(fullname, name);
> cp = strchr(fullname, '@');
> while (cp) {
> - if (cp - fullname && *(cp - 1) != '\\')
> + if (cp == fullname || *(cp - 1) != '\\')
> break;
> else
> cp = strchr(cp, '@');
--
Visit our website at http://www.ubswarburg.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.