From: Kevin Cummings (cummings@hammer.Prime.COM)
Date: 08/04/92


From: cummings@hammer.Prime.COM (Kevin Cummings)
Subject: Re: Mtools under 96c
Date: Tue, 4 Aug 1992 19:56:19 GMT

In article <712909438.F00192@remote.halcyon.com>, Dane.Beko@p1.f21.n300.z1.fidonet.org (Dane Beko) writes:
> I'm experiencing some problems using mtools under Linux .96c. I have
> the /etc/mtools file configured, and the symbolic links to the mtools
> binary. If I'm logged on as 'root', I can mdir, mcopy, etc. If I'm
> logged as a normal user (50:50), I get the following error message.
>
> $ mcopy /usr/spool/treasure.rep 'c:\robotmp\treasure.rep'
> init: open: EPERM
>
> Here are the listings for /usr/bin
>
> /usr/bin
> -rwxrwxrwx 1 bin bin 70656 Mar 30 15:32 mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mwrite -> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mdir -> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mdel -> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mcopy -> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mcd -> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mattrib ->
> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mformat ->
> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mlabel -> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mtype -> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mren -> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mread -> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mrd -> mtools
> lrwxrwxrwx 1 bin bin 6 Jul 31 21:33 mmd -> mtools
> drwxr-xr-x 2 bin bin 1504 Jul 31 22:48 .
> drwxr-xr-x 12 root root 256 Jul 31 23:55 ..
>
> The /etc/mtools file belongs to root:root but everyone has read/write
> permission on it. I've also tried using 'chown bin:disk' on the mtools
> binary as someone here suggested but it still doesn't work.

After doing the chown bin.disk, did you do a chmod 2755 mtools ?????
(Users don't need to be able to write over the mtools binary!)
This will do a setgid so that when mtools runs, it runs as if it were
a member of the disk group, and members of the disk group have rw access
to dev/hd*! do an ls -l /dev/hd* I'll bet they are -rwxrwx--- root disk.

Second point to note. mcopy copies a MSDOS file to another MSDOS file.
mread reads an MSDOS into a LINUX file, and mwrite writes a LINUX to an MSDOS
file. Don't you want to do an:

        "mwrite /usr/spool/treasure.rep c:\robotmp\treasure.rep"

instead? I also have used "/" as the MSDOS pathname seperator without any
problems under mtools, so:

        "mwrite /usr/spool/treasure.rep c:/robotmp/treasure.rep"

will probably work as well. You can also do an:

        "mcd c:/robotmap"
        "mwrite /usr/spool/treasure.rep treasure.rep"

if you care to. I suspect that if you succeeded in getting access to the disk
devices, that your mcopy command would have tried to copy the MSDOS file
\usr\spool\treasure.rep on whatever disk was your "current" one (type "mcd"
to find out what your current DOS working directory is).

=================================================================
Kevin J. Cummings PrimeService
20 Briarwood Road A Computervision Company
Framingham, Mass. 500 Old Connecticut Path
                                        Framingham, Mass.
Work: cummings@primerd.Prime.COM
Home: cummings@kjc386.framingham.ma.us

Std. Disclaimer: "Mr. McKittrick, after careful consideration,
                  I've come to the conclusion that your new
                  defense system SUCKS..." -- War Games
=================================================================