Skip to Content.
Sympa Menu

freetds - RE: [freetds] mssql_connect fails with PHP 4.3.4 on RH Linux 9

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James McGowan" <jmcgowan AT luxurylink.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] mssql_connect fails with PHP 4.3.4 on RH Linux 9
  • Date: Thu, 4 Dec 2003 16:40:02 -0800

Yes, that was all it was. Thanks a million, Daniel. It was read access on
/usr/local for other that was the culprit.

You hear that, other list members? Daniel Fazekas is a hero!

Jim

> -----Original Message-----
> From: Daniel Fazekas [mailto:fdsubs AT axelero.hu]
> Sent: Thursday, December 04, 2003 3:37 PM
> To: FreeTDS Development Group
> Subject: Re: [freetds] mssql_connect fails with PHP 4.3.4 on
> RH Linux 9
>
>
>
> On Dec 4, 2003, at 23:51, James McGowan wrote:
>
> > OK, I created a simple PHP script with a simple SQL query.
> When run as
> > root, the log file fills with fascinating info and the
> correct result
> > is returned. However, when run from the nobody account (or
> from my own
> > login), the log contains only these lines:
>
> So the one thing we now know for certain is that it has
> something to do
> with access rights.
>
> Actually, this could be as simple as the non-root accounts having no
> read access to your freetds.conf file.
>
> Try viewing them with their credentials, and I'm sure you'll get
> something like this:
>
> [fds@]$ cat /usr/local/etc/freetds.conf
> cat: /usr/local/etc/freetds.conf: Permission denied
>
> (You have freetds installed in /usr/local/freetds/etc
> instead, as far
> as I remember.)
>
> To test it, I chmod'ded my freetds.conf to make sure only
> root can read
> it, and sure enough, I got the same errror message from PHP
> as you did,
> and I also got the same error message in the log.. Which is generated
> in login.c's tds_login().
>
>
> Chances are, all you have to do is
>
> chmod 644 /usr/local/freetds/etc/freetds.conf
>
> and that's it for this lengthy problem. :)
>
> This sounds a bit too simple to believe so there might be a
> bit more to
> it, such as not having "execute" rights for all the parent folders,
> namely, /usr, /usr/local, /usr/local/freetds and
> /usr/local/freetds/etc... Make sure other has at least execute to all
> of them.
>
> chmod 755 /usr /usr/local /usr/local/freetds /usr/local/freetds/etc
>
>
> Now there are still many imaginative ways in which you could deny
> access to a certain file, running a paranoid high security kernel,
> chroot caged accounts and the like, but it all comes down to:
> make sure
> you can read that freetds.conf file from those accounts.
>
> --
> fds
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>




Archive powered by MHonArc 2.6.24.

Top of Page