Skip Menu |
 

Subject: kadmin_unlock() calls kadm5_lock() instead of kadm5_unlock()
Cc: Mark.Phalan@Sun.Com

from krb 1.5 src/kadmin/cli/kadmin.c:597

kadmin_unlock() calls kadm5_lock() when it should be calling
kadm5_unlock(), this in effect makes the "unlock" subcommand of kadmin
useless.

See attached diff for suggested fix.
Download unlock.diff
application/octet-stream
From krb5-bugs-incoming-bounces@PCH.mit.edu Tue Jan 9 20:19:14 2007
Received: from pch.mit.edu (PCH.MIT.EDU [18.7.21.90]) by krbdev.mit.edu (8.9.3p2) with ESMTP
id UAA07269; Tue, 9 Jan 2007 20:19:14 -0500 (EST)
Received: from pch.mit.edu (pch.mit.edu [127.0.0.1])
by pch.mit.edu (8.13.6/8.12.8) with ESMTP id l0A1Iiuo008511;
Tue, 9 Jan 2007 20:18:44 -0500
Received: from pacific-carrier-annex.mit.edu (PACIFIC-CARRIER-ANNEX.MIT.EDU
[18.7.21.83])
by pch.mit.edu (8.13.6/8.12.8) with ESMTP id l0A1Igae008508
for <krb5-bugs-incoming@PCH.mit.edu>; Tue, 9 Jan 2007 20:18:42 -0500
Received: from mit.edu (W92-130-BARRACUDA-2.MIT.EDU [18.7.21.223])
by pacific-carrier-annex.mit.edu (8.13.6/8.9.2) with ESMTP id
l0A1IQiS019690
for <krb5-bugs@mit.edu>; Tue, 9 Jan 2007 20:18:26 -0500 (EST)
Received: from sca-ea-mail-1.sun.com (sca-ea-mail-1.Sun.COM [192.18.43.24])
(using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits))
(No client certificate requested)
by mit.edu (Spam Firewall) with ESMTP id 89351373D9E
for <krb5-bugs@mit.edu>; Tue, 9 Jan 2007 20:18:25 -0500 (EST)
Received: from centralmail4brm.central.Sun.COM ([129.147.62.198])
by sca-ea-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id
l0A1IN24013967
for <krb5-bugs@mit.edu>; Tue, 9 Jan 2007 17:18:23 -0800 (PST)
Received: from alton.central.sun.com (alton.Central.Sun.COM [129.153.128.101])
by centralmail4brm.central.Sun.COM (8.13.6+Sun/8.13.6/ENSMAIL,
v2.2) with ESMTP id l0A1INIW018065
for <krb5-bugs@mit.edu>; Tue, 9 Jan 2007 18:18:23 -0700 (MST)
Received: from alton.central.sun.com (localhost [127.0.0.1])
by alton.central.sun.com (8.13.7+Sun/8.13.7) with ESMTP id
l0A1INXt028588
for <krb5-bugs@mit.edu>; Tue, 9 Jan 2007 19:18:23 -0600 (CST)
Received: (from willf@localhost)
by alton.central.sun.com (8.13.7+Sun/8.13.3/Submit) id l0A1IMuu028578;
Tue, 9 Jan 2007 19:18:22 -0600 (CST)
Date: Tue, 9 Jan 2007 19:18:22 -0600 (CST)
Message-Id: <200701100118.l0A1IMuu028578@alton.central.sun.com>
To: krb5-bugs@mit.edu
Subject: bug in kadmin_unlock()
From: william.fiveash@sun.com
X-send-pr-version: 3.99
X-Spam-Score: 0.55
X-Spam-Flag: NO
X-Scanned-By: MIMEDefang 2.42
X-BeenThere: krb5-bugs-incoming@mailman.mit.edu
X-Mailman-Version: 2.1.6
Precedence: list
Reply-To: william.fiveash@sun.com
Sender: krb5-bugs-incoming-bounces@PCH.mit.edu
Errors-To: krb5-bugs-incoming-bounces@PCH.mit.edu


Show quoted text
>Submitter-Id: net
>Originator: William Fiveash
>Organization: Sun Microsystems

Show quoted text
>Confidential: no
>Synopsis:
>Severity: non-critical
>Priority: low
>Category: krb5-admin
>Class: sw-bug
>Release: krb5-1.6
>Environment:

System: SunOS alton 5.10 Generic_118833-18 sun4u sparc SUNW,Sun-Blade-1000
Architecture: sun4

Show quoted text
>Description:

While porting code I noticed this in src/kadmin/cli/kadmin.c:

void kadmin_unlock(argc, argv)
int argc;
char *argv[];
{
kadm5_ret_t retval;

if (!locked)
return;
retval = kadm5_lock(handle);
!!!!!!!!!! should be kadm5_unlock() no?
if (retval) {
com_err("unlock", retval, "");
return;
}
locked = 0;
}

Show quoted text
>How-To-Repeat:

Show quoted text
>Fix:

See Description.
Date: Tue, 9 Jan 2007 21:47:56 -0600
From: Will Fiveash <William.Fiveash@sun.com>
To: rt@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #5309]
RT-Send-Cc:
The Synopsis should be:

Synopsis: bad logic in kadmin_unlock()

On Tue, Jan 09, 2007 at 08:19:22PM -0500, The RT System itself via RT wrote:
Show quoted text
> >Confidential: no
> >Synopsis:
> >Severity: non-critical
> >Priority: low
> >Category: krb5-admin
> >Class: sw-bug
> >Release: krb5-1.6
> >Environment:
>
> System: SunOS alton 5.10 Generic_118833-18 sun4u sparc SUNW,Sun-Blade-1000
> Architecture: sun4
>
> >Description:
>
> While porting code I noticed this in src/kadmin/cli/kadmin.c:
>
> void kadmin_unlock(argc, argv)
> int argc;
> char *argv[];
> {
> kadm5_ret_t retval;
>
> if (!locked)
> return;
> retval = kadm5_lock(handle);
> !!!!!!!!!! should be kadm5_unlock() no?
> if (retval) {
> com_err("unlock", retval, "");
> return;
> }
> locked = 0;
> }
>
> >How-To-Repeat:
>
> >Fix:
>
> See Description.
>
> _______________________________________________
> krb5-bugs mailing list
> krb5-bugs@mit.edu
> https://mailman.mit.edu/mailman/listinfo/krb5-bugs

--
Will Fiveash
Sun Microsystems Inc.
Austin, TX, USA (TZ=CST6CDT)
From: tlyu@mit.edu
Subject: SVN Commit
Will Fiveash and Mark Phalan report that kadmin's unlock command calls
kadm5_lock() instead of of kadm5_unlock(). Apply the obvious fix.


Commit By: tlyu



Revision: 20094
Changed Files:
_U trunk/
U trunk/src/kadmin/cli/kadmin.c
From: tlyu@mit.edu
Subject: SVN Commit
pull up r20094 from trunk

r20094@cathode-dark-space: tlyu | 2007-10-04 18:13:13 -0400
ticket: 4136
target_version: 1.6.3
tags: pullup

Will Fiveash and Mark Phalan report that kadmin's unlock command calls
kadm5_lock() instead of of kadm5_unlock(). Apply the obvious fix.




Commit By: tlyu



Revision: 20095
Changed Files:
_U branches/krb5-1-6/
U branches/krb5-1-6/src/kadmin/cli/kadmin.c