Skip to Content.
Sympa Menu

freetds - Re: [freetds] Kerberos and ODBC

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Kerberos and ODBC
  • Date: Wed, 23 Feb 2011 09:14:19 +0100

2011/2/21 Kyle Strickland <KyleStrickland AT aw-nc.com>:
> Hi folks,
>
> A question and a possible answer here:
>
> Question: What is the Right Way to get Kerberos login to work with FreeTDS
> and unixODBC?  (Note: I did not try setting up a freetds.conf file.  I was
> hoping to forego that and just use odbc.ini.)
>
> Possible Answer: It's broken.  I was unable to get it to work without
> modifying src/odbc/connectparams.c.  Looks like whatever you do with just
> the odbc.ini file, only connection->server_name gets filled in, but
> connection->server_host_name is left blank.  (See
> connectparams.c:odbc_get_dsn_info().)  Later, in
> src/tds/gssapi.c:tds_gss_get_auth(), connection->server_host_name is used to
> create the SPN, but since that is blank, the SPN comes out as
> "MSSQLSvc/:1433".  From that point, it's clear that auth is going to fail.
>  So modifying odbc_get_dsn_info to drop the "Server" parameter into
> connection->server_host_name instead of connection->server_name, seems to
> fix that and everything works (for me anyway).
>
> I am fairly new to using this library and unixODBC, so I'm wondering if I'm
> missing something that should be obvious, or if this is a bug.  And if it's
> a bug, is this the right way to fix it, or is this going to break whatever
> the normal usage pattern is supposed to be?
>
> Diff attached.
>
> Thanks!
>

I backported a fix from CVS HEAD. You can find full patch at
http://freetds.sourceforge.net/ (post 0.82 patch). Your patch is
correct but for coherence I prefer to backport.

freddy77




Archive powered by MHonArc 2.6.24.

Top of Page