Skip to Content.
Sympa Menu

freetds - Re: PHP, FreeTDS and SQL Server 7

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Craig Davison <cd AT securityfocus.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: PHP, FreeTDS and SQL Server 7
  • Date: Fri, 19 Oct 2001 13:00:16 -0600 (MDT)


David, here's what worked for me:

Apply this patch first to src/tds/login.c

*** config.c Tue Jun 19 06:22:00 2001
--- config.c Mon Sep 24 22:01:49 2001
***************
*** 497,507 ****
}
else
{
! strncpy(pathname, dir, sizeof(pathname));
! strncat(pathname, "/", sizeof(pathname));
}
! strncat(pathname, file, sizeof(pathname));
! pathname[sizeof(pathname)-1] = '\0';
}


--- 497,507 ----
}
else
{
! strcpy(pathname, dir);
! strcat(pathname, "/");
}
! strcat(pathname, file);
! pathname[strlen(dir) + strlen(file) + 9] = '\0';
}


Then create a directory called /etc/freetds and copy your interfaces file
there. You need to make an entry in there called SYBASE with your
connection information (this is the only entry the code will read, even
if you specify otherwise).

Try sqsh -S SYBASE -U <user> to check and it should work fine. You need
to use SYBASE or specify no server at all in your code from this point
forward. Of course, if you have two or more database servers, you're
better off switching to 0.51 or 0.53pre1.

Hope that helps. I had a hell of a time with that bug.

--
Craig Davison
SecurityFocus
(403) 213-3939 ext. 228






Archive powered by MHonArc 2.6.24.

Top of Page