dosemu -s doesn't work
Brought to you by:
bartoldeman
[stas@lin2 /]$ dosemu -s
can't create local /root/.dosemu directory
can't create local /root/.dosemu/run directory
Running privileged (via sudo) in full feature mode
can't open "/root/.dosemu/boot.log" for writing
[stas@lin2 /]$
It shouldn't use /root, should use /home/stas
sudo's behaviour has changed. You can put
Defaults env_keep += HOME
in /etc/sudoers or some file in /etc/sudoers.d to restore the old behaviour.
Either we need to document this or get the dosemu script to workaround this (say, setting DOSEMU_HOME=HOME).
I think script should be changed.
The user may not want to have that setting
for every app, and dosemu can make sure
that the $HOME is accessed only after
the privs are dropped.
I wonder why sudo doesn't save it as an
ORIG_HOME to let an app to decide what
HOME it really needs.
There is another method, namely to get the HOME value from
/proc/getppid()/environ.
That would help me because I often do quick tests of dosemu -s by directly typing dosemu.bin -s.
Using getpwnam()->pw_dir has the disadvantage that the HOME env var may have been manually changed by the invoking user.
You mean /proc/self/environ.
I didn't know it is much different than the
current environment, but if it is...
No, it's the environment of the "sudo" process that has the correct $HOME. You can check with "sudo bash".
Ah, missed double 'p' in getppid(), now
everything is clear.
I guess the feature request about saving
ORIG_HOME would be a good idea.