On Mon, 6 Aug 2001, Jeff Beardsley wrote:

> I am attempting to setup DOSEMU (v1.0.2) on a RedHat 7.0 system.  The
> problem simply put: I cannot access the serial ports from within the DOS
> session.  As I understand it, this should be a simple thing to set up.  I
> have tried two different paths to reach the modem on COM1, with varying
> results:
>
> PATH 1:
> The docs imply that I should be able to access the modem without direct
> hardware access (virtual mode), which is what I would prefer.  I have set
> _com1="/dev/ttyS0", and have set _secure="0", but I cannot seem to access
> the ports at all. (Is there something I need to run INSIDE of the dos
> session to enable them)?

This is a problem with the serial code. Basically none of the current
DOSEMU developers is very familiar with it, but right now the serial code
refuses to initialize even if you as a normal user can lock /dev/ttyS0 and
read/write from/to it and /var/lock is setup like

drwxrwxrwt    2 root     root         1024 Aug  6 18:30 lock/

i.e. with the sticky bit, just like /tmp

quick fix: edit src/base/serial/ser_init.c, and recompile

--- ser_init.c~ Sat Jun 16 16:48:31 2001
+++ ser_init.c  Mon Aug  6 18:28:14 2001
@@ -117,19 +117,21 @@
   char dev_nam[20];
   struct passwd *pw;
   pid_t ime;
   int cwrote;

   /* Check that lockfiles can be created! */
+#if 0
   if((mode == 1 || mode == 2) && get_orig_euid() != (uid_t)0) {
     s_printf("DOSEMU: Need to be suid root to create Lock Files!\n"
             "        Serial port on %s not configured!\n", path);
     error("\nDOSEMU: Need to be suid root to create Lock Files!\n"
          "        Serial port on %s not configured!\n", path);
     return(-1);
   }
+#endif

   bzero(dev_nam, sizeof(dev_nam));
   sprintf(saved_path, "%s/%s%s", config.tty_lockdir, config.tty_lockfile,
          (strrchr(path, '/')+1));
   strcpy(dev_nam, path);


> PATH 2:
> The other route I've tried is setuid root.  The machine is not
> net-connected, so there's no security problem.  I've setup the dosemu binary
> for suid root, but I get the following message:
>
>      You (or your distributor) made the dosemu binary suid-root.
>      The local configuration within this DOSEMU installation is
>      not intended for secure operation.  You need to run this
>      non-suid-root as normal unprivileged user.
>
> What changes might I make to my installation to allow it to run as suid
> root?  I've found nothing obvious in the docs, only mention about running
> that way: "when running as suid root ...".
>
> This is (almost) certainly a configuration issue on my part, but could be
> considered too, a documentation bug--this is probably a pretty common use
> for dosemu; it could be easier to locate.

It's a bug basically, even though we are not encouraging suid-root -
though I'd rather run dosemu suid-root than as root since it reduces some
risks, a suid-root dosemu runs mostly as a normal user but can always
become root again; it drops privileges completely when for the "unix"
and "system" commands -  but Hans Lermen disagrees. I've experimented with
an intermediate approach where DOSEMU drops privileges after gaining some
I/O privileges. This works for ports < 0x400 and video memory.

But we might use some client-server approach in the future.

See

"
So, in src/plugin/coopthreads/coopthreads.h change

-#if 1
+#if 0
 #include <unistd.h>
 #define COM_CHECK_PERMISSIONS { \
"

http://marc.theaimsgroup.com/?l=linux-msdos&m=99263649830327&w=2

for the fix that removes the above message.

> Any help you can supply will be greatly appreciated.  Help me out here, I
> might be interested in helping clean up the documentation.

This is always extremely welcome.

Bart

-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to