From Nicolas.Williams@ubsw.com Mon Nov 5 13:55:35 2001 Received: from fort-point-station.mit.edu (FORT-POINT-STATION.MIT.EDU [18.72.0.53]) by rt-11.mit.edu (8.9.3/8.9.3) with ESMTP id NAA11490 for ; Mon, 5 Nov 2001 13:55:34 -0500 (EST) Received: from gate2.stm.ubswarburg.com (gate2.stm.ubswarburg.com [151.191.1.12]) by fort-point-station.mit.edu (8.9.2/8.9.2) with ESMTP id NAA20532 for ; Mon, 5 Nov 2001 13:55:34 -0500 (EST) Received: (from smap@localhost) by gate2.stm.ubswarburg.com (8.8.8/8.8.8) id NAA15022 for ; Mon, 5 Nov 2001 13:55:32 -0500 (EST) Received: from (thirteen.ubswarburg.com [192.168.0.7]) by gate2 via smap (V2.0/ubsw) id xma014938; Mon, 5 Nov 2001 13:55:07 -0500 Received: from sm0p9035pos.stm.swissbank.com (virscan4 [192.168.0.7]) by virscan4.swissbank.com (8.8.8/8.8.8) with ESMTP id NAA22655 for ; Mon, 5 Nov 2001 13:56:39 -0500 (EST) Received: from sm2p1386swk.stm.swissbank.com (sm2p1386swk.stm.swissbank.com [151.191.93.86]) by sm0p9035pos.stm.swissbank.com (8.8.8/8.8.8) with ESMTP id NAA00172 for ; Mon, 5 Nov 2001 13:55:06 -0500 (EST) Received: (willian@localhost) by sm2p1386swk.stm.swissbank.com (8.9.3+Sun/8.6.12) id NAA25852 for krb5-bugs@mit.edu; Mon, 5 Nov 2001 13:55:06 -0500 (EST) Message-Id: <20011105135506.L26615@wdr.com> Date: Mon, 5 Nov 2001 13:55:06 -0500 From: Nicolas Williams 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 Subject: Re: Infinite loop in src/kadmin/cli/kadmin.c:kadmin_parse_name() References: <200111051542.KAA22169@sm0d1989cmp.stm.swissbank.com> >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.