Comment 5 for bug 1373495

Revision history for this message
ๆž—ๅšไป(Buo-ren, Lin) (buo-ren-lin) wrote :

@seth-arnold
Sorry for the very~ late reply, my aplogies.

> If HOME is removed, then e.g. vim, bash, etc., will use /root/.vimrc, /root/.bashrc,
> etc rather than the user's ~/.vimrc, ~/.bashrc, etc.
You shouldn't expect finding your config files when using other user's account(including root).
If you need the same configuration simply create a symbolic link then.

> there's a chance that X11 clients may not even be able to connect to the X11
> server if they are aimed at the wrong .Xauthority file.
In fact X11 clients doesn't require SUDO_USER's .Xauthority file to run, all you have to to is to run `xhost +SI:localuser:root` to allow X server be accessed by root user then you can run `sudo whatever-x11-application` without setting SUDO_USER's HOME directory (unless the application itself does not allow running as root, such as recent release of Kate and Dolphin).

In summary,

1. Setting SUDO_USER's home directory as HOME of root is not the proper method to "let my stuff in my home directory to be accessed by root" and will cause numerous disasters(such as https://www.ptt.cc/bbs/Linux/M.1498509926.A.AC9.html which forces me to review this bug)
2. "Running X11 applications as root" isn't a reason to keep this patch as well, as it can **still** runnable as root without setting SUDO_USER's home directory.