Skip to Content.
Sympa Menu

freetds - Re: [freetds] ct_config set CS_IFILE property is not working?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] ct_config set CS_IFILE property is not working?
  • Date: Wed, 4 Jan 2012 23:45:54 -0500

On Tue, 3 Jan 2012 09:07:31 +0100
dariusz ostolski <dariusz.ostolski AT gmail.com> wrote:

> 1. Can You confirm that I cannot set custom path to interfaces file
> using ct_config?

Yes. The FreeTDS function supports only three properties, CS_IFILE
not among them.

> 2. What alternatives do I have? I don't want to modify $SYBASE
> environment variable and I wouldn't like to use any function outside
> ct library?

USTL. There's a static constant src/tds/config.c::interfaces_path.
Add to the case statement in ct_config, diddle just a bit with the
logic around config.c:1095:

if (!sybase || !sybase[0])
sybase = interfaces_path;

...
found = search_interface_file(login, sybase,
"interfaces", server);

to something like:

static const char default_interfaces_path[] = "/etc/freetds";
// should be $PREFIX from configure
/* interfaces_path can be set by ct_config CS_IFILE */
const char *interfaces_path = default_interfaces_path;
...
if (interfaces_path == default_interfaces_path) {
if (!sybase || !sybase[0])
sybase = interfaces_path;
} else {
sybase = interfaces_path;
}

and call it a day. If you post such a patch, I'll include it in the
main branch.

That's just a hack, though. For extra credit, the path should be in
CS_CONTEXT.

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page