How to compile SQSH with FreeTDS .60?

Jay Sauls jaysauls at hotmail.com
Tue Oct 8 11:53:42 EDT 2002


When I tried to patch the config.c file, patch failed, looks like version 
1.38 that was referenced in the diff of config.c isn't the same version 
that's in the freetds-current.tgz file.

I manually applied the patch, since I could tell what you were trying to do. 
  I was considering getting all the files from CVS, but I wasn't sure about 
the stability of the tree, so I didn't.


I fixed one really stupid mistake on my part:

mv ~jays/freetds.conf ~jays/.freetds.conf

That really seemed to help sqsh find the file.

I removed my FREETDSCONF environment variable.

I reconfigured my SQLServer for mixed mode and updated freetds.conf to 
match:

# jay's SQLServer
[jayssql]
        host = jays.corp.digimine.com
        port = 1433
        tds version = 8.0
        try domain login = no
        nt domain = corp
        try server login = yes
        dump file = /home/jays/jays.tdsdump.txt
        debug level = 99

and ran sqsh:

[jays at jays-linux jays]$ sqsh -S jayssql -U sa
sqsh-2.1 Copyright (C) 1995-2001 Scott C. Gray
This is free software with ABSOLUTELY NO WARRANTY
For more information type '\warranty'
Password:
[3] jayssql.master.1>

so far so good.

here's what the TDSDUMPCONFIG looked like for that connection:

2002-10-08 10:44:12 Attempting to read conf files.
2002-10-08 10:44:12 Found conf file in  (.freetds.conf). Reading section 
jayssql.
2002-10-08 10:44:12 Looking for section global.
2002-10-08 10:44:12 ... Found section global.
2002-10-08 10:44:12 Got a match.
2002-10-08 10:44:12 option = 'tds version' value = '4.2'.
2002-10-08 10:44:12 option = 'initial block size' value = '512'.
2002-10-08 10:44:12 option = 'swap broken dates' value = 'no'.
2002-10-08 10:44:12 no is a 'no/off/false'.
2002-10-08 10:44:12 option = 'swap broken money' value = 'no'.
2002-10-08 10:44:12 UNRECOGNIZED option 'swap broken money'...ignoring.
2002-10-08 10:44:12 option = 'try server login' value = 'yes'.
2002-10-08 10:44:12 yes is a 'yes/on/true'.
2002-10-08 10:44:12 option = 'try domain login' value = 'no'.
2002-10-08 10:44:12 no is a 'no/off/false'.
2002-10-08 10:44:12 option = 'cross domain login' value = 'no'.
2002-10-08 10:44:12 UNRECOGNIZED option 'cross domain login'...ignoring.
2002-10-08 10:44:12 ... Found section jdbc.
2002-10-08 10:44:12 ... Found section jayssql.
2002-10-08 10:44:12 Looking for section jayssql.
2002-10-08 10:44:12 ... Found section global.
2002-10-08 10:44:12 ... Found section jdbc.
2002-10-08 10:44:12 ... Found section jayssql.
2002-10-08 10:44:12 Got a match.
2002-10-08 10:44:12 option = 'host' value = 'jays.corp.digimine.com'.
2002-10-08 10:44:12 Found host entry jays.corp.digimine.com.
2002-10-08 10:44:12 IP addr is 172.17.1.50.
2002-10-08 10:44:12 option = 'port' value = '1433'.
2002-10-08 10:44:12 option = 'tds version' value = '8.0'.
2002-10-08 10:44:12 option = 'try domain login' value = 'no'.
2002-10-08 10:44:12 no is a 'no/off/false'.
2002-10-08 10:44:12 option = 'nt domain' value = 'corp'.
2002-10-08 10:44:12 option = 'try server login' value = 'yes'.
2002-10-08 10:44:12 yes is a 'yes/on/true'.
2002-10-08 10:44:12 option = 'dump file' value = 
'/home/jays/jays.tdsdump.txt'.
2002-10-08 10:44:12 option = 'debug level' value = '99'.
2002-10-08 10:44:12 ...Success.

Now, I left the SQL Server in mixed mode, but changed freetds.conf to use 
integrated auth:

# jay's SQLServer
[jayssql]
        host = jays.corp.digimine.com
        port = 1433
        tds version = 8.0
        try domain login = yes
        nt domain = corp
        try server login = no
        dump file = /home/jays/jays.tdsdump.txt
        debug level = 99

Try to connect with tsql.  (Note that the jays user account is an NT domain 
account, not a local SQLServer account)

[jays at jays-linux jays]$ tsql -S jayssql -U jays
Password:
Msg 5703, Level 0, State 1, Server JAYS, Line 0
Changed language setting to us_english.
1> exit

success!  Now try to connect with sqsh:

[jays at jays-linux jays]$ sqsh -S jayssql -U jays
sqsh-2.1 Copyright (C) 1995-2001 Scott C. Gray
This is free software with ABSOLUTELY NO WARRANTY
For more information type '\warranty'
Password:
Msg 18456, Level 14, State 1

Login failed for user 'jays'.
Login incorrect.

Weird error message.  I would have expected "not associated with a trusted 
connection."

Here's what weirder: with the same freetds.conf:

[jays at jays-linux jays]$ sqsh -S jayssql -U sa
sqsh-2.1 Copyright (C) 1995-2001 Scott C. Gray
This is free software with ABSOLUTELY NO WARRANTY
For more information type '\warranty'
Password:
[3] jayssql.master.1>

Why would "sa" work if freetds.conf said to use domain logon?

Here's what TDSDUMPCONFIG looked like:
2002-10-08 10:52:29 Attempting to read conf files.
2002-10-08 10:52:29 Found conf file in  (.freetds.conf). Reading section 
jayssql.
2002-10-08 10:52:29 Looking for section global.
2002-10-08 10:52:29 ... Found section global.
2002-10-08 10:52:29 Got a match.
2002-10-08 10:52:29 option = 'tds version' value = '4.2'.
2002-10-08 10:52:29 option = 'initial block size' value = '512'.
2002-10-08 10:52:29 option = 'swap broken dates' value = 'no'.
2002-10-08 10:52:29 no is a 'no/off/false'.
2002-10-08 10:52:29 option = 'swap broken money' value = 'no'.
2002-10-08 10:52:29 UNRECOGNIZED option 'swap broken money'...ignoring.
2002-10-08 10:52:29 option = 'try server login' value = 'yes'.
2002-10-08 10:52:29 yes is a 'yes/on/true'.
2002-10-08 10:52:29 option = 'try domain login' value = 'no'.
2002-10-08 10:52:29 no is a 'no/off/false'.
2002-10-08 10:52:29 option = 'cross domain login' value = 'no'.
2002-10-08 10:52:29 UNRECOGNIZED option 'cross domain login'...ignoring.
2002-10-08 10:52:29 ... Found section jdbc.
2002-10-08 10:52:29 ... Found section jayssql.
2002-10-08 10:52:29 Looking for section jayssql.
2002-10-08 10:52:29 ... Found section global.
2002-10-08 10:52:29 ... Found section jdbc.
2002-10-08 10:52:29 ... Found section jayssql.
2002-10-08 10:52:29 Got a match.
2002-10-08 10:52:29 option = 'host' value = 'jays.corp.digimine.com'.
2002-10-08 10:52:29 Found host entry jays.corp.digimine.com.
2002-10-08 10:52:30 IP addr is 172.17.1.50.
2002-10-08 10:52:30 option = 'port' value = '1433'.
2002-10-08 10:52:30 option = 'tds version' value = '8.0'.
2002-10-08 10:52:30 option = 'try domain login' value = 'yes'.
2002-10-08 10:52:30 yes is a 'yes/on/true'.
2002-10-08 10:52:30 option = 'nt domain' value = 'corp'.
2002-10-08 10:52:30 option = 'try server login' value = 'no'.
2002-10-08 10:52:30 no is a 'no/off/false'.
2002-10-08 10:52:30 option = 'dump file' value = 
'/home/jays/jays.tdsdump.txt'.
2002-10-08 10:52:30 option = 'debug level' value = '99'.
2002-10-08 10:52:30 ...Success.

'try domain login' is set to true and 'try server login' is set to no, so I 
don't know why the server login worked....


>From: James K. Lowden <jklowden at speakeasy.org>
>Reply-To: "TDS Development Group" <freetds at franklin.oit.unc.edu>
>To: "TDS Development Group" <freetds at franklin.oit.unc.edu>
>Subject: [freetds] Re: How to compile SQSH with FreeTDS .60?
>Date: Mon, 7 Oct 2002 21:57:54 -0400
>
>Hello again Jay,
>
>On Mon, 07 Oct 2002 16:27:59 -0700, "Jay Sauls" <jaysauls at hotmail.com>
>wrote:
> > out of desperation, I set
> >
> > export FREETDSCONF=/usr/local/etc/freetds.conf
>
>That shouldn't happen.  You shouldn't *need* FREETDSCONF, and its absence
>should result in a segment violation when you use TDSDUMPCONFIG.
>
>Could you please apply the attached patch and see if you still get a
>segfault when FREETDSCONF is not set?  It might fix the segfault, and it
>will make the TDSDUMPCONFIG more vocal.
>
>This line is very peculiar in your log:
>
>2002-10-07 16:23:17 Found conf file in  (from $FREETDSCONF). Reading
>section jayssql.
>                                       ^^ in what?
>
>That contents of FREETDSCONF should appear after "Found conf file in".  My
>patch (already committed in cvs) should make that explicit.
>
>I have attached the TDSDUMPCONFIG output, too, for the following
>successful connection:
>
>	sqsh -S JDBC -U guest -P sybase
>
>That's *not* a domain login of course, but can you reproduce it?  I'd like
>to make sure we're chasing:
>
>*	domain login
>*	from sqsh
>
>and that every other combination works.
>
>Gads.  I really should take up knitting or something.
>
>--jkl
><< freetds.diff >>
><< tdsdumpconfig >>
>---
>You are currently subscribed to freetds as: [jaysauls at hotmail.com]
>To unsubscribe, forward this message to 
>$subst('Email.Unsub')




_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com




More information about the FreeTDS mailing list