Skip Menu |
 

From: "Eli Breder" <eli.breder@hummingbird.com>
To: <kfw-bugs@mit.edu>
Subject: KFW 3.1 Beta 4 problem with Leash password dialog
Date: Tue, 21 Nov 2006 12:47:29 -0500
It seems that AuthenticateProc() in athena\auth\leash\leashdll\lsh_pwd.c does not account for LPLSH_DLGINFO_EX structures with size of LSH_DLGINFO_EX_V2_SZ. The "An incorrect initialization data structure was provided." error dialog pops up.
 
I have client code which calls Leash_kinit_dlg_ex with a dialog info structure of LSH_DLGINFO_EX_V2_SZ size. This client code was written against KFW 2.6 APIs.
 
Thanks,
Eli Breder
Software Developer
Hummingbird Connectivity, a division of Open Text Corporation
1010 Sherbrooke West, Suite 811
Montreal, Quebec
H3A 2R7
Tel:  (514) 281-5551 ext. 231
 
Submit a patch.
The attached patch has been committed.
Please test.
Download lsh_pwd-diff-1.txt
unknown/exe 4.3KiB

Message body not shown because it is not plain text.

From: "Eli Breder" <eli.breder@hummingbird.com>
To: <rt-kfw@krbdev.mit.edu>
Subject: RE: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with Leash password dialog
Date: Thu, 23 Nov 2006 08:13:12 -0500
RT-Send-Cc:
I received no attachment with this email. Can you please send it again?

Thank you.

Eli Breder
Software Developer
Hummingbird Connectivity, a division of Open Text Corporation
1010 Sherbrooke West, Suite 811
Montreal, Quebec
H3A 2R7
Tel: (514) 281-5551 ext. 231
Fax: (514) 281-9958

eli.breder@hummingbird.com





Show quoted text
>>-----Original Message-----
>>From: Unprivileged W User,,,, [mailto:www@MIT.EDU] On Behalf
>>Of Jeffrey Altman via RT
>>Sent: Wednesday, November 22, 2006 7:23 PM
>>To: eli.breder@hummingbird.com
>>Subject: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with
>>Leash password dialog
>>
>>
>>The attached patch has been committed.
>>Please test.
Date: Thu, 23 Nov 2006 08:25:54 -0500
From: Jeffrey Altman <jaltman@mit.edu>
To: rt-kfw@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with Leash password dialog
RT-Send-Cc:
The patch is on the ticket. You can obtain it from there.

https://krbdev.mit.edu/rt/

ticket 4842

Eli Breder via RT wrote:
Show quoted text
> I received no attachment with this email. Can you please send it again?
>
> Thank you.
From: "Eli Breder" <eli.breder@hummingbird.com>
To: <rt-kfw@krbdev.mit.edu>
Subject: RE: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with Leash password dialog
Date: Thu, 23 Nov 2006 10:07:17 -0500
RT-Send-Cc:
Thank you. The patch fixes our problem.

Eli Breder
Software Developer
Hummingbird Connectivity, a division of Open Text Corporation
1010 Sherbrooke West, Suite 811
Montreal, Quebec
H3A 2R7
Tel: (514) 281-5551 ext. 231
Fax: (514) 281-9958

eli.breder@hummingbird.com





Show quoted text
>>-----Original Message-----
>>From: 0000-Admin [mailto:daemon@MIT.EDU] On Behalf Of Jeffrey
>>Altman via RT
>>Sent: Thursday, November 23, 2006 8:25 AM
>>To: eli.breder@hummingbird.com
>>Subject: Re: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem
>>with Leash password dialog
>>
>>
>>The patch is on the ticket. You can obtain it from there.
>>
>> https://krbdev.mit.edu/rt/
>>
>> ticket 4842
>>
>> Eli Breder via RT wrote:
>>> I received no attachment with this email. Can you please
>>send it again?
>>>
>>> Thank you.
From: "Eli Breder" <eli.breder@hummingbird.com>
To: <rt-kfw@krbdev.mit.edu>
Subject: RE: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with Leash password dialog
Date: Fri, 24 Nov 2006 12:37:28 -0500
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.1KiB
I reported that this patch fixed our problem. While it fixed the initial
problem of the error dialog popping up, it created a new problem where the
dialog title that our code passes via lpdi->title and the username are not
being displayed . I believe that the new code in lsh_pwd.c should either be
comparing against sizeof(LSH_DLGINFO_EX) or the various LSH_DLGINFO_EX_Vx_SZ
#defines and not sizeof(LSH_DLGINFO_EX_Vx_SZ).

Thank you.

Eli Breder
Software Developer
Hummingbird Connectivity, a division of Open Text Corporation
1010 Sherbrooke West, Suite 811
Montreal, Quebec
H3A 2R7
Tel: (514) 281-5551 ext. 231
Fax: (514) 281-9958

eli.breder@hummingbird.com





Show quoted text
>>-----Original Message-----
>>From: 0000-Admin [mailto:daemon@MIT.EDU] On Behalf Of Jeffrey
>>Altman via RT
>>Sent: Thursday, November 23, 2006 8:25 AM
>>To: eli.breder@hummingbird.com
>>Subject: Re: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem
>>with Leash password dialog
>>
>>
>>The patch is on the ticket. You can obtain it from there.
>>
>> https://krbdev.mit.edu/rt/
>>
>> ticket 4842
>>
>> Eli Breder via RT wrote:
>>> I received no attachment with this email. Can you please
>>send it again?
>>>
>>> Thank you.
Date: Fri, 24 Nov 2006 12:42:54 -0500
From: Jeffrey Altman <jaltman@mit.edu>
To: rt-kfw@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with Leash password dialog
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.5KiB
As stated in the header file, if you are using LSH_DLGINFO_EX_V3_SZ
then the titile and username are no longer passed in the old fields.
If you want to use the old fields you should be allocating a data
structure or specifying the size as LSH_DLGINFO_EX_V1_SZ.

This is not a bug.

Eli Breder via RT wrote:
Show quoted text
> I reported that this patch fixed our problem. While it fixed the initial
> problem of the error dialog popping up, it created a new problem where the
> dialog title that our code passes via lpdi->title and the username are not
> being displayed . I believe that the new code in lsh_pwd.c should either be
> comparing against sizeof(LSH_DLGINFO_EX) or the various LSH_DLGINFO_EX_Vx_SZ
> #defines and not sizeof(LSH_DLGINFO_EX_Vx_SZ).
>
> Thank you.
>
> Eli Breder
> Software Developer
> Hummingbird Connectivity, a division of Open Text Corporation
> 1010 Sherbrooke West, Suite 811
> Montreal, Quebec
> H3A 2R7
> Tel: (514) 281-5551 ext. 231
> Fax: (514) 281-9958
>
> eli.breder@hummingbird.com
>
>
>
>
>
>>> -----Original Message-----
>>> From: 0000-Admin [mailto:daemon@MIT.EDU] On Behalf Of Jeffrey
>>> Altman via RT
>>> Sent: Thursday, November 23, 2006 8:25 AM
>>> To: eli.breder@hummingbird.com
>>> Subject: Re: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem
>>> with Leash password dialog
>>>
>>>
>>> The patch is on the ticket. You can obtain it from there.
>>>
>>> https://krbdev.mit.edu/rt/
>>>
>>> ticket 4842
>>>
>>> Eli Breder via RT wrote:
>>>> I received no attachment with this email. Can you please
>>> send it again?
>>>> Thank you.
>
From: "Eli Breder" <eli.breder@hummingbird.com>
To: <rt-kfw@krbdev.mit.edu>
Subject: RE: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with Leash password dialog
Date: Fri, 24 Nov 2006 14:39:13 -0500
RT-Send-Cc:
Download (untitled) / with headers
text/plain 2.8KiB
My data structure is of size LSH_DLGINFO_EX_V2_SZ and I do set the dialog
size field to LSH_DLGINFO_EX_V2_SZ.

The bug is in lsh_pwd.c at the following line (and others like it):

if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V3_SZ ))
SetWindowText(hDialog, lpdi->in.title);
else
SetWindowText(hDialog, lpdi->title);

sizeof(LSH_DLGINFO_EX_V3_SZ )evaluates to 2 and will always be less than my
lpdi->size (which is set to LSH_DLGINFO_EX_V2_SZ, which in turn evaluates to
304) the fix is to remove the sizeof:

if ( lpdi->size >= LSH_DLGINFO_EX_V3_SZ)

Or check the size of the LSH_DLGINFO_EX structure:

if ( lpdi->size >= sizeof(LSH_DLGINFO_EX))

There are other parts of the code which have the same problem.

Eli Breder
Software Developer
Hummingbird Connectivity, a division of Open Text Corporation
1010 Sherbrooke West, Suite 811
Montreal, Quebec
H3A 2R7
Tel: (514) 281-5551 ext. 231
Fax: (514) 281-9958

eli.breder@hummingbird.com





Show quoted text
>>-----Original Message-----
>>From: 0000-Admin [mailto:daemon@MIT.EDU] On Behalf Of Jeffrey
>>Altman via RT
>>Sent: Friday, November 24, 2006 12:42 PM
>>To: eli.breder@hummingbird.com
>>Subject: Re: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem
>>with Leash password dialog
>>
>>
>>As stated in the header file, if you are using
>>LSH_DLGINFO_EX_V3_SZ then the titile and username are no
>>longer passed in the old fields.
>>If you want to use the old fields you should be allocating a
>>data structure or specifying the size as LSH_DLGINFO_EX_V1_SZ.
>>
>>This is not a bug.
>>
>> Eli Breder via RT wrote:
>>> I reported that this patch fixed our problem. While it fixed the
>>> initial problem of the error dialog popping up, it created a new
>>> problem where the dialog title that our code passes via lpdi->title
>>> and the username are not being displayed . I believe that
>>the new code
>>> in lsh_pwd.c should either be comparing against
>>sizeof(LSH_DLGINFO_EX)
>>> or the various LSH_DLGINFO_EX_Vx_SZ #defines and not
>>sizeof(LSH_DLGINFO_EX_Vx_SZ).
>>>
>>> Thank you.
>>>
>>> Eli Breder
>>> Software Developer
>>> Hummingbird Connectivity, a division of Open Text Corporation 1010
>>> Sherbrooke West, Suite 811 Montreal, Quebec H3A 2R7
>>> Tel: (514) 281-5551 ext. 231
>>> Fax: (514) 281-9958
>>>
>>> eli.breder@hummingbird.com
>>>
>>>
>>>
>>>
>>>
>>>>> -----Original Message-----
>>>>> From: 0000-Admin [mailto:daemon@MIT.EDU] On Behalf Of
>>Jeffrey Altman
>>>>> via RT
>>>>> Sent: Thursday, November 23, 2006 8:25 AM
>>>>> To: eli.breder@hummingbird.com
>>>>> Subject: Re: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with
>>>>> Leash password dialog
>>>>>
>>>>>
>>>>> The patch is on the ticket. You can obtain it from there.
>>>>>
>>>>> https://krbdev.mit.edu/rt/
>>>>>
>>>>> ticket 4842
>>>>>
>>>>> Eli Breder via RT wrote:
>>>>>> I received no attachment with this email. Can you please
>>>>> send it again?
>>>>>> Thank you.
>>>
Date: Fri, 24 Nov 2006 14:50:38 -0500
From: Jeffrey Altman <jaltman@mit.edu>
To: rt-kfw@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with Leash password dialog
RT-Send-Cc:
If you have identified how the code should be fixed, send a patch.
There is no one from MIT that works on KFW at the present time.

My company, Secure Endpoints Inc., is not paid to do this either.
I should not have to go back to attempt to re-implement a fix
that you have already developed.
Date: Fri, 24 Nov 2006 14:56:06 -0500
From: Jeffrey Altman <jaltman@mit.edu>
To: rt-kfw@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with Leash password dialog
RT-Send-Cc:
Patch attached. I suspect this is what you would have submitted.
Please confirm.
Index: lsh_pwd.c
===================================================================
RCS file: /cvs/pismere/pismere/athena/auth/leash/leashdll/lsh_pwd.c,v
retrieving revision 1.49
diff -u -r1.49 lsh_pwd.c
--- lsh_pwd.c 23 Nov 2006 00:21:14 -0000 1.49
+++ lsh_pwd.c 24 Nov 2006 19:54:27 -0000
@@ -1548,7 +1548,7 @@

if ((lpdi->size != LSH_DLGINFO_EX_V1_SZ &&
lpdi->size != LSH_DLGINFO_EX_V2_SZ &&
- lpdi->size < sizeof(LSH_DLGINFO_EX_V3_SZ)) ||
+ lpdi->size < LSH_DLGINFO_EX_V3_SZ) ||
lpdi->dlgtype != DLGTYPE_PASSWD) {

MessageBox(hDialog, "An incorrect initialization data structure was provided.",
@@ -1557,26 +1557,26 @@
return FALSE;
}

- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V2_SZ) ) {
+ if ( lpdi->size >= LSH_DLGINFO_EX_V2_SZ ) {
lpdi->out.username[0] = 0;
lpdi->out.realm[0] = 0;
}
- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V3_SZ) ) {
+ if ( lpdi->size >= LSH_DLGINFO_EX_V3_SZ ) {
lpdi->out.ccache[0] = 0;
}

- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V3_SZ) )
+ if ( lpdi->size >= LSH_DLGINFO_EX_V3_SZ )
SetWindowText(hDialog, lpdi->in.title);
else
SetWindowText(hDialog, lpdi->title);

SetProp(hDialog, "HANDLES_HELP", (HANDLE)1);

- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V3_SZ) )
+ if ( lpdi->size >= LSH_DLGINFO_EX_V3_SZ )
lstrcpy(username, lpdi->in.username);
else if (lpdi->username)
lstrcpy(username, lpdi->username);
- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V3_SZ) )
+ if ( lpdi->size >= LSH_DLGINFO_EX_V3_SZ )
lstrcpy(realm, lpdi->in.realm);
else if (lpdi->realm)
lstrcpy(realm, lpdi->realm);
@@ -2008,7 +2008,7 @@
Leash_set_default_noaddresses(noaddresses);
}

- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V2_SZ) ) {
+ if ( lpdi->size >= LSH_DLGINFO_EX_V2_SZ ) {
strncpy(lpdi->out.username, username, LEASH_USERNAME_SZ);
lpdi->out.username[LEASH_USERNAME_SZ-1] = 0;
strncpy(lpdi->out.realm, realm, LEASH_REALM_SZ);
@@ -2069,7 +2069,7 @@

*( (LPLSH_DLGINFO_EX far *)(&lpdi) ) = (LPLSH_DLGINFO_EX)(LPSTR)lParam;

- if ((lpdi->size < sizeof(LSH_DLGINFO_EX_V3_SZ) &&
+ if ((lpdi->size < LSH_DLGINFO_EX_V3_SZ &&
lpdi->size != LSH_DLGINFO_EX_V1_SZ &&
lpdi->size != LSH_DLGINFO_EX_V2_SZ) ||
lpdi->dlgtype != DLGTYPE_CHPASSWD) {
@@ -2080,26 +2080,26 @@
return FALSE;
}

- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V2_SZ) ) {
+ if ( lpdi->size >= LSH_DLGINFO_EX_V2_SZ ) {
lpdi->out.username[0] = 0;
lpdi->out.realm[0] = 0;
}
- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V3_SZ) ) {
+ if ( lpdi->size >= LSH_DLGINFO_EX_V3_SZ ) {
lpdi->out.ccache[0] = 0;
}

- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V3_SZ) )
+ if ( lpdi->size >= LSH_DLGINFO_EX_V3_SZ )
SetWindowText(hDialog, lpdi->in.title);
else
SetWindowText(hDialog, lpdi->title);

SetProp(hDialog, "HANDLES_HELP", (HANDLE)1);

- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V3_SZ) )
+ if ( lpdi->size >= LSH_DLGINFO_EX_V3_SZ )
lstrcpy(username, lpdi->in.username);
else if (lpdi->username)
lstrcpy(username, lpdi->username);
- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V3_SZ) )
+ if ( lpdi->size >= LSH_DLGINFO_EX_V3_SZ )
lstrcpy(realm, lpdi->in.realm);
else if (lpdi->realm)
lstrcpy(realm, lpdi->realm);
@@ -2374,7 +2374,7 @@
return TRUE;
}

- if ( lpdi->size >= sizeof(LSH_DLGINFO_EX_V2_SZ) ) {
+ if ( lpdi->size >= LSH_DLGINFO_EX_V2_SZ ) {
strncpy(lpdi->out.username, username, LEASH_USERNAME_SZ);
lpdi->out.username[LEASH_USERNAME_SZ-1] = 0;
strncpy(lpdi->out.realm, realm, LEASH_REALM_SZ);
From: "Eli Breder" <eli.breder@hummingbird.com>
To: <rt-kfw@krbdev.mit.edu>
Subject: RE: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem with Leash password dialog
Date: Fri, 24 Nov 2006 15:39:53 -0500
RT-Send-Cc:
Yes it is.

Eli Breder
Software Developer
Hummingbird Connectivity, a division of Open Text Corporation
1010 Sherbrooke West, Suite 811
Montreal, Quebec
H3A 2R7
Tel: (514) 281-5551 ext. 231
Fax: (514) 281-9958

eli.breder@hummingbird.com





Show quoted text
>>-----Original Message-----
>>From: 0000-Admin [mailto:daemon@MIT.EDU] On Behalf Of Jeffrey
>>Altman via RT
>>Sent: Friday, November 24, 2006 2:55 PM
>>To: eli.breder@hummingbird.com
>>Subject: Re: [krbdev.mit.edu #4842] KFW 3.1 Beta 4 problem
>>with Leash password dialog
>>
>>
>>Patch attached. I suspect this is what you would have submitted.
>>Please confirm.
>>