Skip to Content.
Sympa Menu

freetds - [freetds] CS_SERVERADDR tag is not handled correctly in ct_con_props

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Stephen Marshall <smarshall AT kayak.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] CS_SERVERADDR tag is not handled correctly in ct_con_props
  • Date: Thu, 2 Jan 2014 09:49:28 -0500

FreeTDS 0.91 does not honor the CS_SERVERADDR tag in the ct_con_props
function. This function and tag are used to allow database connections
using a "<host> <port>" syntax.

There is code in FreeTDS that compensates for this problem by allowing the
user to specify the server name as "<host>:<port>". FreeTDS supports this
syntax as a fallback case when a server name cannot be found in the
configuration file. See freetds file src/tds/config.c,
parse_server_name_for_port function for details. However, this is not a
standard part of the TDS protocol. Client applications conforming to the
standard can end up doing the wrong thing. I have noticed this problem in
the sqsh client, but may affect other clients as well.

The connection code should either be fixed or the CS_SERVERADDR macro
should be disabled. The latter would signal to client applications that
CS_SERVERADDR does not work per spec, which would allow client applications
to avoid calling this function when linked against FreeTDS.

Note: this problem was originally submitted as a bug to the sqsh project,
but latter determined to be a problem in FreeTDS. Further details of the
original submission can be found here:
http://sourceforge.net/p/sqsh/bugs/60/

Also note that I tried to fix this myself, but I got a little lost in
mapping of connection information between several different data
structures. It does not seem like the port information is carried through
all of them. With some guidance on how to proceed without inducing side
effects, I would be happy to work on this problem.




Archive powered by MHonArc 2.6.24.

Top of Page