bugreport: tsql connect fails when log file is unwriteable

Petr Klíma <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
tsql fails connect when log file is unwriteable.
No error message indicating "log file is unwriteable", but misterious 
"Unable to connect: Adaptive Server is unavailable or does not exist."

It has two efects ...

- you can not debug connections from php module on http server (runs 
under id=apache)
- when you try souch debug, all your applications using freetds directly 
or indirectly (php_mssql, php_odbc ...) fails to connect to server



Patch not provided, C knowledge not installed



supporting informations:
=====================================================
# tsql -C
Compile-time settings (established with the "configure" script)
                             Version: freetds v0.82
              freetds.conf directory: /etc
      MS db-lib source compatibility: yes
         Sybase binary compatibility: yes
                       Thread safety: yes
                       iconv library: yes
                         TDS version: 4.2
                               iODBC: no
                            unixodbc: yes

# cat /etc/freetds.conf
[global]
     initial block size = 512
     text size = 64512

[hrochSRV2]
         # connect to MSSQL 2008 server instance
         tds version = 8.0
         client charset = UTF-8
         dump file = /tmp/freetds.log
         dump file append = yes
         host = hroch.xxxxxxxx.xx
         port = 49327
         instance = SRV2

# ---------------------------------------
#  this is OK
# ---------------------------------------

# rm /tmp/freetds.log
# touch /tmp/freetds.log
# ll /tmp/freetds.log
-rw-r--r-- 1 root root 0 bre  3 10:35 /tmp/freetds.log
#
#
#
# export LANG=C; tsql -S hrochSRV2 -U aaaa -P bbbbb
locale is "C"
locale charset is "ANSI_X3.4-1968"
1> use AGROTEST ;
2> go
1> select kodfmista as id from cis_adresyF;
2> go
id
10
11
.
.
.
764200
(1353 rows affected)
1> exit
#

# ---------------------------------------
#  this FAILS
# ---------------------------------------


# rm /tmp/freetds.log
# touch /tmp/freetds.log
# ll /tmp/freetds.log
-rw-r--r-- 1 root root 0 Mar  3 10:41 /tmp/freetds.log
#
#

# ---------------------------
# log as unprivileged user
# ---------------------------
# su -l -s /bin/bash apache
-bash-3.2$
-bash-3.2$
-bash-3.2$ export LANG=C; tsql -S hrochSRV2 -U aaaaaa -P bbbbbb
locale is "C"
locale charset is "ANSI_X3.4-1968"
Msg 20009, Level 9, State -1, Server OpenClient, Line -1
Unable to connect: Adaptive Server is unavailable or does not exist
There was a problem connecting to the server
-bash-3.2$


       Petr Klíma
    <[email protected]>
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.