Irssi core bugs

All the Irssi bugs should go here, please select the proper version when reporting the bug.

Please see the Irssi core http://www.irssi.org/ChangeLog for recent updates.
| Tasklist |

FS#532 - $HOME environment variable handling

Attached to Project: Irssi core bugs
Opened by Arnaud (arnaud) - Tuesday, 25 September 2007, 22:31 GMT+2
Task Type Feature Request
Category core
Status Unconfirmed
Assigned To No-one
Operating System Other
Severity High
Priority Normal
Reported Version Irssi SVN
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

irssi doesn't handle the $HOME environment variable. The attached patch enables this behaviour, as precised in glib manual.
This task depends upon

Comment by Arnaud (arnaud) - Tuesday, 25 September 2007, 22:32 GMT+2
oups, forgot the patch ...
Comment by Emanuele Giaquinta (ayin) - Friday, 09 May 2008, 09:57 GMT+2
g_get_home_dir honours $HOME, but it prefers the passwd entry if it exists. Which problem are you trying to solve?
Comment by Arnaud (arnaud) - Friday, 09 May 2008, 11:02 GMT+2
Hi,

Thanks for responding. In fact, in some environment, I have $HOME != passwd entry, in this context, I want irssi to look bu default for its configuration file, plugins & co. in $HOME/.irssi/ rather than 'passwd entry'/.irssi/.

[1] precise a few case that need to be handled if $HOME is prefered, I'll update the patch it deals with this this evening.

- Arnaud

[1]: http://library.gnome.org/devel/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-get-home-dir
Comment by Emanuele Giaquinta (ayin) - Friday, 09 May 2008, 11:54 GMT+2
Can't you simply use --home=$HOME/.irssi ? I am not convinced that changing the behaviour now is a good idea.
Comment by Arnaud (arnaud) - Friday, 09 May 2008, 13:21 GMT+2
this is just painful, *every* others program I use behave correctly,
irssi is the only exception. Moreover, POSIX[1] defines $HOME as:

HOME
The system shall initialize this variable at the time
of login to be a pathname of the user's home directory

and every shell in the world will translate '~/.irssi/config'
(as indicated in irssi(1)) as '$HOME/.irssi/config', which is
different than ~foo/.irssi/config which will be expended with
the `foo''s home directory as configured in the passwd entry.

Ignoring (or bypassing it) $HOME if set is just a plain bug.

[1]: http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html
Comment by Emanuele Giaquinta (ayin) - Friday, 09 May 2008, 14:01 GMT+2
I know $HOME definition as per SUS, but it does not add anything to the discussion. This is not a matter of correct/incorrect behaviour but rather of expected/unexpected behaviour, unless you can prove your claim that this is a "plain bug".
I can understand it is annoying but i would prefer not to change it since it has been in this way since the beginning.
Comment by Arnaud (arnaud) - Friday, 09 May 2008, 14:41 GMT+2
well, irssi *does* behave unexpectedly, setting the $HOME environment variable to something different than the passwd entry make irssi still looks for its config file in the passwd entry, I don't know what extra proof you need to consider this as a bug. It relies on an incorrect interpretation of the standard by glib people.

The '--home' option is just a workaround to this bug. Such option is useless, $HOME is here to do the job.

For 99.9% of irssi's user, it won't make any difference at all as ~foo == "foo' $HOME", The remaining 0.1% is using '--home' to do what $HOME is for. So currently custom proprietary option are used and preferred over global and standard configuration ...
Comment by Emanuele Giaquinta (ayin) - Friday, 09 May 2008, 15:02 GMT+2
As i already said, i agree this is unexpected behaviour.
Your claim that irssi relies on an incorrect interpretation of the standard by glib makes no sense though. g_get_home_dir description is:

"Gets the current user's home directory as defined in the password database."
"Note that in contrast to traditional UNIX tools, this function prefers passwd entries over the HOME environment variable."

How is SUS supposed to be relevant here?

And no, the '--home' option was not meant as a workaround to this problem.
Comment by Arnaud (arnaud) - Friday, 09 May 2008, 15:18 GMT+2
(sorry for the duplicate comment)

> How is SUS supposed to be relevant here?
The least I can wait from glib is to conform to standard :/

> And no, the '--home' option was not meant as a workaround to this problem.
well, both do the same job, the two following are equivalent:
$ irssi --home=/foo
$ HOME=/foo irssi





Loading...