Re: Kerberos and ODBC
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
2011/2/21 Kyle Strickland <[email protected]>: > 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 _______________________________________________ FreeTDS mailing list [email protected] http://lists.ibiblio.org/mailman/listinfo/freetds