Comment 8 for bug 769948

Revision history for this message
Maciej MaƂecki (maciej-malecki) wrote :

For ls it's true, because ~ is expanded by bash. Python works in a bit different way:
    $ sudo python
    >>> import os
    >>> os.getenv("HOME")
    '/root'
    >>> import os.path
    >>> os.path.expanduser("~")
    '/root'

Yes, there are few environment variables preserved (like USERNAME), but sudo changes your working environment (you can easily check: compare `env` output with `sudo env` output).

So, for zeitgeist-daemon running as root it's home directory is /root and we should decide what to do in this kind of a situation. Should I report this directly to Zeitgeist and see if daemon guys can figure something out?