• mis/mis2 on Linux not fully dropping from root?

    From Kinetix@21:2/124 to All on Wednesday, May 31, 2017 11:55:33
    Hi g00r00, Avon, et al!

    I've been having fun trying to get a DOS-based door running via dosemu, and
    I believe I've isolated the issue down to an interesting quirk in mis & mis2.

    Here's what's happening: I am starting mis or mis2 (used mis2 briefly for testing this issue out) from an init script that starts mis or mis2 as root, and mis/2 are appearing to drop down to the mystic user appropriately when
    it's running. Mystic is being spawned appropriately as the mystic user, etc, so there's nothing obvious that dropping from the root user isn't working.

    However, in this scenario where mis was initially started as root, when it
    goes to start dosemu, these errors show up (extremely briefly, I had to save console output to really even see them) and the doors menu re-appears nearly instantly. The node logs don't capture these errors, they just say the
    dosemu command was fired up. The errors being very briefly shown to the user are (I have a menu command 'G' spawning the door...):

    ==============

    Command -> G
    mkdir: cannot create directory /root: Permission denied
    can't create local /root/.dosemu directory
    can't create local /root/.dosemu/run directory
    can't open "/root/.dosemu/boot.log" for writing

    ==============

    This made no sense to me as everything in the BBS environment appears to be running as the appropriate mystic user - except that I knew mis was being started as root and dropping down to that user afterwards.

    So, as I'm not running on any privileged ports, I tested running mis from the init script as the mystic user, and lo and behold, the door via dosemu ran properly. I stopped mis and tested using root with mis2 and the same issue exists there, it tries to run dosemu as root.

    So... I guess my question on this is - is this expected behaviour, or is part of this acting funky on linux/64 or unix in general?

    Thanks all, I hope this report is helpful.

    -Adam

    --- Mystic BBS v1.12 A33 (Linux/64)
    * Origin: Family Fun BBS (21:2/124)
  • From Kinetix@21:2/124 to All on Wednesday, May 31, 2017 13:28:52
    So after my last message, I see that this very item was touched on back in 2014. It looks like the problem has to do with environment issues when starting mis as root which then causes issues for dosemu. The reference was from Eric Renfro:

    https://fidonet.ozzmosis.com/echomail.php/mystic/7f807e5f59d2f034.html

    So would it make sense then to make notes in the unix install text doc or add the setcap command to the install process so that mis can take advantage of binding to priveleged ports without having to be root?

    The adjustment I've got in my init file for the start-stop-daemon in the
    start) stanza looks like:

    ... --start --user depnode --chuid depnode --exec $DAEMON ...

    And I think I'll do the setcap on my mis binary, not that I currently have a need for it.

    --- Mystic BBS v1.12 A33 (Linux/64)
    * Origin: Family Fun BBS (21:2/124)