Re: Patch For sspi.c To Use Windows Authentication

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAHt6W4dfgn-HfRCjwOZnS2KbDa0QiKCx47SiEHe4QcCyVFRGAA@mail.gmail.com>
Yes, I think your connection is using Kerberos. We have similar code
even for gssapi (that provide Kerberos for the Unix world). It must be
return tds_flush_packet(tds), not return status. Also you miss a
CompleteAuthToken call on SEC_I_COMPLETE_AND_CONTINUE.

Frediano


2012/10/29  <[email protected]>:
>
> A user on my TinyTDS/SQLServer list reported this bug with FreeTDS. They could not get Windows authentication to work and had to make the following change to sspi.c
>
>>  free(auth_buf);
>> // code added start
>>  if (status == SEC_I_COMPLETE_AND_CONTINUE || status == SEC_I_CONTINUE_NEEDED) {
>>   if (out_buf.cbBuffer > 0)
>>   {
>>    tds_put_n(tds, auth->tds_auth.packet, out_buf.cbBuffer);
>>    tds_flush_packet(tds);
>>    return status;
>>   }
>>  }
>> // code added end
>>  if (status != SEC_E_OK)
>>   return TDS_FAIL;
>
> After that change, they got Windows authentication working and saw the following FreeTDS debug info.
>
>> AUTH
>> ENVCHANGE
>> INFO
>> ENVCHANGE
>> ENVCHANGE
>> INFO
>> LOGINACK
>> ENVCHANGE
>> DONE
>> Finally, there is the LOGINACK and DONE tokens : )
>
> Opinions on doing this patch?
>
>
>  - Ken
>
>
>
>
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.