Re: BUG #13854: SSPI authentication failure: wrong realm name used - Mailing list pgsql-hackers

From Christian Ullrich
Subject Re: BUG #13854: SSPI authentication failure: wrong realm name used
Date
Msg-id 56F40B65.8050909@chrullrich.net
Whole thread Raw
In response to Re: BUG #13854: SSPI authentication failure: wrong realm name used  (Christian Ullrich <chris@chrullrich.net>)
Responses Re: BUG #13854: SSPI authentication failure: wrong realm name used  (Robbie Harwood <rharwood@redhat.com>)
List pgsql-hackers
On 2016-03-24 16:35, Christian Ullrich wrote:

> * From: Robbie Harwood [mailto:rharwood@redhat.com]
>
>> Christian Ullrich <chris@chrullrich.net> writes:

>>>    pg_SSPI_recvauth(Port *port)
>>>    {
>>>        int            mtype;
>>> +     int            status;
>>
>> The section of this function for include_realm checking already uses an
>> int status return code (retval).  I would expect to see them share a
>> variable rather than have both "retval" and "status".
>
> I would not, because retval is local to that last if, but you are right, status
> does not need to be in function scope.

Moved declaration.

>>> +     /* Build SAM name (DOMAIN\\user), then translate to UPN
>>> +        (user@kerberos.realm). The realm name is returned in
>>> +        lower case, but that is fine because in SSPI auth,
>>> +        string comparisons are always case-insensitive. */
>>
>> Since we're already considering changing things: this is not the comment
>> style for this file (though it is otherwise a good comment).
>
> True. Will fix.

Reformatted.

>>> +     upname = (char*)palloc(upnamesize);
>>
>> I don't believe this cast is typically included.
>
> Left over from when this was malloc() before Magnus' first look at it.

Removed.

Updated patch attached.

--
Christian


Attachment

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: Small patch: fix code duplication in heapam.c
Next
From: Robert Haas
Date:
Subject: Re: Rationalizing code-sharing among src/bin/ directories