You are not logged in.

#1 2017-11-06 22:12:42

rossboulet
Member
Registered: 2015-01-23
Posts: 29

[SOLVED] freetds fisql query edit fails

I am connecting to an MS SQL Server with fisql from the freetds package. The connection is fine, but if I attempt to edit a query in the fisql utility, I get a vi screen with a "permission denied". If I run fisql with sudo, I get the query in vi but a "[readonly]" at the bottom. It seems the temporary file with the query is getting created with no permissions. If I shell out of vi and "chmod 600" the temporary file, I can reload it an do my edit.

[me@mysys ~]$ ls -l /tmp/fisqloQqXv9
---------- 1 rossboulet users 6 Nov  6 15:39 /tmp/fisqloQqXv9

I first noticed the issue on a 32 bit machine with a self compiled kernel, but I have reproduced it on a 64 bit machine with a stock, up to date lts kernel (4.9.60-1) and freetds (1.00.44-1).

Am I missing something else?

Last edited by rossboulet (2018-04-10 04:16:29)


I really hate this damn machine,
I wish that they would sell it.
It never does just what I want,
But only what I tell it.    -Anonymous

Offline

#2 2017-11-10 21:59:51

rossboulet
Member
Registered: 2015-01-23
Posts: 29

Re: [SOLVED] freetds fisql query edit fails

I found the issue, but I don't think this qualifies as solved. At some point in April of 2016, code was added to fisql.c to set a umask for the temporary file creation. The intention was to make the file accessible only to the current user. The program uses mkstemp() to create the file and mkstemp() creates a file with a 0600 mode. The umask() call specifies a mask of 0600 which filters out the mode bits, resulting in a file with 0000 (no access). This was corrected upstream in September 2017 in a development release, but has not made it to the stable releases yet.


I really hate this damn machine,
I wish that they would sell it.
It never does just what I want,
But only what I tell it.    -Anonymous

Offline

#3 2018-01-16 23:14:55

rossboulet
Member
Registered: 2015-01-23
Posts: 29

Re: [SOLVED] freetds fisql query edit fails

Just an update for my own reference. As of 2018-01-16 the current stable release is 1.00.80 from:
ftp://ftp.freetds.org/pub/freetds/stable

The fix for the problem in src/apps/fisql/fisql.c was committed on 2017-09-18 on github but has not made it to the current stable release yet.


I really hate this damn machine,
I wish that they would sell it.
It never does just what I want,
But only what I tell it.    -Anonymous

Offline

#4 2018-04-04 00:49:10

rossboulet
Member
Registered: 2015-01-23
Posts: 29

Re: [SOLVED] freetds fisql query edit fails

Another update. There have been several releases, but the fix to fisql.c has not been included. I posted about it on github and the developer responded. While he didn't exactly say, I got the impression it had simply been overlooked. There are two new releases (1.00.84 and 1.00.85) that do have the updated code. So it should just be a matter of time for these to trickle down.


I really hate this damn machine,
I wish that they would sell it.
It never does just what I want,
But only what I tell it.    -Anonymous

Offline

#5 2018-04-10 04:15:34

rossboulet
Member
Registered: 2015-01-23
Posts: 29

Re: [SOLVED] freetds fisql query edit fails

The repository now has version 1.00.86 and includes the fix. Marking as solved.


I really hate this damn machine,
I wish that they would sell it.
It never does just what I want,
But only what I tell it.    -Anonymous

Offline

Board footer

Powered by FluxBB