Help save net neutrality! Learn more.
Close

#608 lxterminal through gksu creates config with wrong user/group

None
closed-wont-fix
lxterminal (72)
5
2015-06-21
2013-09-25
ixevix
No

If you run lxterminal for the first time on a new installation of debian wheezy (apt-get install task-ldxe-desktop) through the "Root terminal" option in the lxde menu it creates the config file in the users home folder ~/.config/lxterminal/lxterminal.conf with root as owner and group.
The quick fix was to chown the folder and the file to the user but I thought I'd report it since a quick google turned the same issue up for other distros as well and I didn't find the issue here in the bug tracker.
I am not sure this is the right place to report this bug so please point me in the right direction if that is the case. Also since debian uses possibly quite old packages you can disregard this if it has already been fixed.
The about dialog reports version 0.1.11 for lxterminal.

Discussion

  • Peter Nowee

    Peter Nowee - 2015-04-01

    Seems this bug still exists with LXTerminal 0.2.0 on a fresh install of Debian 8 Jessie RC2.

    I found the directory ~/.config/lxterminal/ (in the home directory of a normal user) was owned by root:root. Not sure what caused it, but it could very well be that the first time I ran lxterminal was as a Root terminal.

     
  • FinboySlick

    FinboySlick - 2015-05-10
    • assigned_to: FinboySlick
    • Group: -->
     
  • FinboySlick

    FinboySlick - 2015-05-10

    I'm not sure lxterminal itself would be able to fix this. My initial thought is that the 'root terminal' menu entry should run a script that checks if the config file is missing in the user's home and then run something like 'lxterminal -e true' as the user to create it if it doesn't.

    As far as I'm aware the "Root Terminal" menu entry appears to be a Debian creation.

     
  • Peter Nowee

    Peter Nowee - 2015-05-22

    The problem seems to be caused by the use of gksu by the 'Root Terminal' menu entry. gksu uses (in this case) su as a backend. su, when used without further options, keeps many environment variables intact. That includes XDG_CONFIG_HOME, which lxterminal uses to determine where to store its settings.

    If the first time a user (e.g. bob) ever runs lxterminal, is through the menu entry 'Root Terminal', lxterminal will be running as root in an environment containing XDG_CONFIG_HOME=/home/bob/.config. It then sees that /home/bob/.config/lxterminal/ does not exist yet and creates it. But since lxterminal is running as root, the directory will be owned by root. When lxterminal is later run as the normal user again, it cannot save its settings there anymore.

    As XDG_CONFIG_HOME is part of the XDG Base Directory Specification, I asked about this situation on the XDG mailing list (XDG environment variables with substitute user). I got one reply indicating that the problem is indeed with gksu letting too many environment variables through. Based on further reading of the specification, I concluded that the person or program using gksu (i.e. whoever is responsible for the 'Root Terminal' menu entry) bears the responsibility of complying with the XDG Base Directory Specification.

    Text editor/IDE Geany had a similar problem with gksu and XDG_CONFIG_HOME and closed it as wont-fix:

    Geany should use the environment as given, its not up to Geany to try to second guess what environment the user intended..

    So, I guess you could close this as wontfix for lxterminal as well.

    A bug could be filed with Debian and/or gksu (same developers it seems), though I see that they are working on a new version of gksu that uses PolicyKit instead of su/sudo.

     
    Last edit: Peter Nowee 2015-05-22
  • FinboySlick

    FinboySlick - 2015-06-21
    • status: open --> closed-wont-fix
     

Log in to post a comment.