Updates for running dosemu as user

This commit is contained in:
Michiel Broek 2004-08-10 20:44:16 +00:00
parent 832c92fdf8
commit dedb313970
2 changed files with 113 additions and 11 deletions

View File

@ -17,7 +17,77 @@
<div align='right'><h5>Last update 09-Aug-2004</h5></div>
<div align='center'><H1>MBSE BBS - Running DOS doors.</H1></div>
<h3>Introduction</h3>
<p>
Running DOS doors is possible on systems that can run
<a href="http://www.dosemu.org">dosemu</a>. The latest versions of dosemu don't
need to be started suid root or started using sudo, it can run as the user that
is logged in the bbs. Since that is possible, a new location for the virtual C:
drive is now being used withing the $MBSE_ROOT file structure. This virtual C:
drive is owned by the group bbs. The basic ideas how doors should be run written
by Redy Rodriguez are still valid, but some scripts are changed and some dosemu
files must be copied into the mbse directory tree.
<p>&nbsp;<p>
<h3>Installing dosemu</h3>
<p>
Some distributions have good dosemu packages, others don't. You need a dosemu
that can be used in a systemwide multiuser setup. The bad packages want to have
the dos drive in each users home directory, this is not what we want for doors.
If you don't have a good dosemu you have to compile your own. This is not too
complicated. First download the source from <a
href="http://www.dosemu.org">dosemu</a>. You don't need the freedos-bin source
if you are going to use ms-dos or pc-dos.
Unpack the source in some directory of your choice and compile the sources:<br>
<pre>
mbse@seaport$ tar xfvz dosemu-1.2.2.tgz
mbse@seaport$ cd dosemu-1.2.2
mbse@seaport:~/dosemu-1.2.2$ ./configure --prefix=/usr --sysconfdir=/etc/dosemu --with-x
mbse@seaport:~/dosemu-1.2.2$ make
</pre>
Note that the <code>--with-x</code> is not needed for running doors, but it
might be handy that you can use dosemu as user mbse in X to do maintenance on
your doors.<br>
Then as root do:<br>
<pre>
root@seaport:~/dosemu-1.2.2# make install
</pre>
<p>&nbsp;<p>
<h3>Setup dosemu in mbse</h3>
<p>
First copy <code>/etc/dosemu/dosemu.conf</code> into <code>~/etc/dosmeu</code>.
Then edit <code>~/etc/dosemu/dosemu.conf</code> so that we have a version for
mbse users. Set the following settings in that file:<br>
<pre>
$_hdimage = "/opt/mbse/var/dosemu/c"
$_floppy_a = ""
$_xms = (1024)
$_ems = (2048)
$_dpmi = (0x1000)
$_layout = "us"
</pre>
Next we need to setup the C: drive. Do this as user mbse. First type <code>umask
007</code>, this sets the create mode for directories to 0770 and files to 0660
so that we create all files and directories read/write for all bbs users. This
is very important! Type the following commands:
<pre>
mbse@seaport:~$ umask 007
mbse@seaport:~$ cd var/dosemu/c
mbse@seaport:~/var/dosemu/c$ mkdir dos dosemu temp util
</pre>
To be continued....
<p>&nbsp;</P>
<h3>What if I don't upgrade</h3>
<p>
That's your choice, but for a while the old method starting dosemu via sudo is
still supported. The file <code>~/bin/bbsdoor.sh</code> is still there, but the
file <code>~/bin/rundoor.sh</code> is renamed to
<code>~/bin/runvirtual.sh</code>. So you should change all symlinks of your door
names in <code>~/bin</code> (or copies) to <code>~/bin/runvirtual.sh</code>. You
should not need to change anything else.
<p>
<A HREF="index.htm"><IMG SRC="images/b_arrow.png" ALT="Back" Border="0">Go Back</A>
</BLOCKQUOTE>

View File

@ -2,23 +2,55 @@
#
# $Id$
#
# rundoor.sh - Never call this script directly, create a symlink
# to this file with the name of the door. For example
# to run the door ilord do:
# Never call this script directly, create a symlink to this file with the
# name of the door. For example to run the door ilord do:
# cd /opt/mbse/bin
# ln -s rundoor.sh ilord
# In the menu use the following line for Optional Data:
# /opt/mbse/bin/ilord /N
#
# This version DOES NOT have virtual COMport support, see runvirtual.sh
# In the bbs menu use the following line for Opt. Data:
# /opt/mbse/bin/ilord /N [novirtual]
#
# The optional "novirtual" second paramter disables the use of the virtual
# comport in dosemu, this is for dos programs that are not doors.
#
# This is for dosemu 1.2.0 and later and runs the door as user.
#
# by Redy Rodriguez and Michiel Broek.
#
DOOR=`basename $0`
COMMANDO="\"doors $DOOR $*\r\""
DOSDRIVE=${MBSE_ROOT}/var/dosemu/c
/opt/mbse/bin/bbsdoor.sh $DOOR $1
/usr/bin/sudo /usr/bin/dosemu.bin -f /opt/mbse/etc/dosemu/dosemu.conf -I "`echo -e keystroke $COMMANDO`"
# Prepare users home directory and node directory
if [ "$1" != "" ]; then
mkdir -p $DOSDRIVE/doors/node$1 >/dev/null 2>&1
# Copy door*.sys to dos partition
cat ~/door.sys >$DOSDRIVE/doors/node$1/door.sys
cat ~/door32.sys >$DOSDRIVE/doors/node$1/door32.sys
# Create .dosemu directory for the user.
if [ ! -d $HOME/.dosemu ]; then
mkdir $HOME/.dosemu
fi
# Looks cheap, see above, but this does an upgrade too
if [ ! -d $HOME/.dosemu/drives ]; then
mkdir $HOME/.dosemu/drives
fi
# Create .dosemu/disclaimer in user home to avoid warning
if [ ! -f $HOME/.dosemu/disclaimer ]; then
touch $HOME/.dosemu/disclaimer
fi
else
exit 1
fi
# run the dos emulator with the door.
if [ "$2" == "novirtual" ]; then
/usr/bin/dosemu.bin -f ${MBSE_ROOT}/etc/dosemu/dosemu.conf -I "`echo -e keystroke $COMMANDO`"
else
/usr/bin/dosemu.bin -f ${MBSE_ROOT}/etc/dosemu/dosemu.conf -I "`echo -e serial { com 1 virtual }"\n" keystroke $COMMANDO`"
fi
# reset the users terminal, just in case.
reset
tput reset
stty sane