#436 dosemu -s doesn't work

open
nobody
None
5
2014-03-07
2012-04-21
Stas Sergeev
No

[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

Discussion

  • Bart Oldeman
    Bart Oldeman
    2012-04-21

    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).

     
  • Stas Sergeev
    Stas Sergeev
    2012-04-21

    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.

     
  • Bart Oldeman
    Bart Oldeman
    2012-04-22

    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.

     
  • Stas Sergeev
    Stas Sergeev
    2012-04-22

    You mean /proc/self/environ.
    I didn't know it is much different than the
    current environment, but if it is...

     
  • Bart Oldeman
    Bart Oldeman
    2012-04-22

    No, it's the environment of the "sudo" process that has the correct $HOME. You can check with "sudo bash".

     
  • Stas Sergeev
    Stas Sergeev
    2012-04-22

    Ah, missed double 'p' in getppid(), now
    everything is clear.
    I guess the feature request about saving
    ORIG_HOME would be a good idea.