fix for spurious server not found in configuration file

[email protected] (Christos Zoulas)
Newsgroups gmane.comp.db.tds.freetds
Organization Astron Software
Message-ID <[email protected]>
Hello,

I really don't want to list > 50 servers in my freetds.conf file to avoid
seeing the message:

Msg 20012, Level 2, State -1, Server OpenClient, Line -1
Server name not found in configuration files.

So, I added this to config.c (which was to actually do what the logging
comment promised but did not deliver):

Index: src/tds/config.c
===================================================================
RCS file: /src/twosigma/cvsroot/external/public/freetds/src/tds/config.c,v
retrieving revision 1.1.1.13
retrieving revision 1.16
diff -u -r1.1.1.13 -r1.16
--- src/tds/config.c	13 Nov 2009 18:22:47 -0000	1.1.1.13
+++ src/tds/config.c	13 Nov 2009 19:39:28 -0000	1.16
@@ -195,7 +195,8 @@
 		if (!tds_read_interfaces(tds_dstr_cstr(&login->server_name), connection)) {
 			tdsdump_log(TDS_DBG_INFO1, "Failed to find [%s] in configuration files; trying '%s' instead.\n", 
 						   tds_dstr_cstr(&login->server_name), tds_dstr_cstr(&connection->server_name));
-			tdserror(tds->tds_ctx, tds, TDSEINTF, 0);
+			if (!tds_read_conf_file(connection, tds_dstr_cstr(&connection->server_name)))
+				tdserror(tds->tds_ctx, tds, TDSEINTF, 0);
 		}
 	}
 

So adding
[SYBASE]

to the bottom of your freetds.conf file will silence the nuisance.

Best,

christos
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.