Irssi core bugs

Notice: Undefined index: tasklist_type in /var/www/bugs.irssi.org/includes/class.tpl.php(128) : eval()'d code on line 85 Notice: Undefined index: tasklist_type in /var/www/bugs.irssi.org/includes/class.tpl.php(128) : eval()'d code on line 90
  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Feature Request
  • Category core
  • Assigned To No-one
  • Operating System Other
  • Severity High
  • Priority Normal
  • Reported Version Irssi SVN
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 0
  • Private No
Attached to Project: Irssi core bugs
Opened by Arnaud (arnaud) - 2007-09-25

FS#532 - $HOME environment variable handling

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

This task does not depend on any other tasks.

Arnaud (arnaud)
Tuesday, 25 September 2007, 20:32 GMT
oups, forgot the patch ...
Emanuele Giaquinta (ayin)
Friday, 09 May 2008, 07:57 GMT
g_get_home_dir honours $HOME, but it prefers the passwd entry if it exists. Which problem are you trying to solve?
Arnaud (arnaud)
Friday, 09 May 2008, 09:02 GMT
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
Emanuele Giaquinta (ayin)
Friday, 09 May 2008, 09:54 GMT
Can't you simply use --home=$HOME/.irssi ? I am not convinced that changing the behaviour now is a good idea.
Arnaud (arnaud)
Friday, 09 May 2008, 11:21 GMT
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
Emanuele Giaquinta (ayin)
Friday, 09 May 2008, 12:01 GMT
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.
Arnaud (arnaud)
Friday, 09 May 2008, 12:41 GMT
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 ...
Emanuele Giaquinta (ayin)
Friday, 09 May 2008, 13:02 GMT
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.
Arnaud (arnaud)
Friday, 09 May 2008, 13:18 GMT
(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





David (phyber)
Tuesday, 15 April 2014, 11:31 GMT
This has been fixed since glib 2.36, from the glib 2.40 documentation:

> As with most UNIX tools, this function will return the value of the HOME environment variable if it is set to an existing absolute path name, falling back to the passwd file in the case that it is unset.
> Before version 2.36 this function would ignore the HOME environment variable, taking the value from the passwd database instead.

Loading...