FreeTDS / freetds

Official FreeTDS repository
http://www.freetds.org/
GNU General Public License v2.0
460 stars 157 forks source link

XDG Base Directory Specification not followed #400

Open maresb opened 3 years ago

maresb commented 3 years ago

According to the XDG Base Directory Specification, I would expect to be able to place my ~/.freetds.conf file instead in $HOME/.config/freetds/freetds.conf, but this is currently unsupported by FreeTDS. (More generally, it should look in $XDG_CONFIG_HOME/freetds/freetds.conf when XDG_CONFIG_HOME is defined.)

Would you be open to supporting this? Specifically, searching for the config file inside $XDG_CONFIG_HOME or $HOME/.config before looking for ~/.freetds.conf? Thanks!

fziglio commented 3 years ago

Not that freetds it's a desktop application. Yes, I would like to have ~/.config/freetds instead of the old configurations all in the home, it would make sense. About the XDG_CONFIG_HOME freetds don't even trust HOME environment and use getpwuid (or system equivalent, HOME is used only as a last resort).

Well, not that it cannot be overwritten by many environment variables at the moment (like FREETDSCONF or FREETDS).

I think all you need is in src/tds/config.c.