Enhancement: Mount drive but block \WINDOWS ??

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Enhancement: Mount drive but block \WINDOWS ??

Postby emendelson » 2018-1-09 @ 19:47

I've tried to do this by myself, but it's far beyond my skill level:

Is it possible to modify the MOUNT command so that it includes a -nowindir option? That would let you mount the C: (or any other) drive, but make the \WINDOWS directory invisible to DOSBox.

This might be useful - or it might be a waste of time. But I would certainly like to use something like this if it's at all possible.
emendelson
Oldbie
 
Posts: 744
Joined: 2010-2-14 @ 02:00

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby Dominus » 2018-1-09 @ 19:49

not really, I guess. On modern Windows this is not that much of a problem unless the user uses Dosbox with admin rights. It's still better to teach users not to do that, though :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7593
Joined: 2002-10-03 @ 09:54
Location: Vienna or Ludwigsburg

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby dr_st » 2018-1-09 @ 20:16

emendelson wrote:Is it possible to modify the MOUNT command so that it includes a -nowindir option? That would let you mount the C: (or any other) drive, but make the \WINDOWS directory invisible to DOSBox.
You'd also want to make sure to hide Program Files (32 and 64 bit versions), ProgramData, Users and all the symbolic links / junction points, as accidentally screwing them up can screw up the system.

And for what? Just so that you can be lazy and messy and not put all the things that DOSBox should see in a separate directory?

It is a waste of time, and I agree with Dominus - it's better to teach users not to do it.
User avatar
dr_st
Oldbie
 
Posts: 1261
Joined: 2015-4-09 @ 07:18

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby emendelson » 2018-1-09 @ 20:44

OK - I'm convinced! Thanks for thinking this through...
emendelson
Oldbie
 
Posts: 744
Joined: 2010-2-14 @ 02:00

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby Dominus » 2018-1-09 @ 21:25

BUT a good idea that comes from that:
DOSBox detects that it is mounting the root of a drive (which is easy) and injeccts a warning, right?
Instead of printing the warning, don't execute the mount command when this is detected (with a text explaining why).
User avatar
Dominus
DOSBox Moderator
 
Posts: 7593
Joined: 2002-10-03 @ 09:54
Location: Vienna or Ludwigsburg

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby emendelson » 2018-1-09 @ 21:43

Dominus wrote:DOSBox detects that it is mounting the root of a drive (which is easy) and injeccts a warning, right?
Instead of printing the warning, don't execute the mount command when this is detected (with a text explaining why).


Yes - but if that gets into the code, there should be an option to disable it. For example, the project I'm working on has a conf file that automatically mounts all drives other than C: (I think I'm going to change that so it automatically mounts all drives that do NOT have a \WINDOWS directory). I want it to mount drives D:, E:, and my SUBST-style drives K:, L:, and M:...
emendelson
Oldbie
 
Posts: 744
Joined: 2010-2-14 @ 02:00

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby dr_st » 2018-1-10 @ 05:35

Yeah, I agree. It needs to be controllable, or at least detect that it is mounting the root of the system drive (not any drive). I can, in principle, dedicate a whole partition to DOSBox.
User avatar
dr_st
Oldbie
 
Posts: 1261
Joined: 2015-4-09 @ 07:18

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby Serious Callers Only » 2018-1-10 @ 07:56

Well, lets be real: only a very very careless person will do this. Also, if it's done, plz plz don't detect windows in a 'simplistic' way, because people actually mount images and drives with windows, including 3.11 from the native filesystem to boot it. Make sure it's actually mounting the native root windows before you do this - platform specific - clippy attendant. In fact, do both this and make it a warning for the windows version only with ifdefn, because people can keep windows 3.11 in another drive to mount boot it, or dosbox can get support for FAT32-native translation layer tomorrow that works on windows (a man can dream).
Serious Callers Only
Member
 
Posts: 370
Joined: 2003-4-26 @ 21:34

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby Dominus » 2018-1-10 @ 08:10

I‘m not one of the devs and none of them chimed in, so all please relax :)
You could make a simple detection in the lines of when using mount (not imgmount) and if it‘s a windows drive (drive letters), root of the drive and a Windows folder on it.
If you want to skip scanning for the Windows folder, then only restrict mounting c:, but warn on other drive roots.
And a switch for the mount command to skip sanity check.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7593
Joined: 2002-10-03 @ 09:54
Location: Vienna or Ludwigsburg

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby Azarien » 2018-1-10 @ 17:15

I regularly mount C: in DOSBox as C: (and D: as D: etc) and nothing has yet exploded for that reason. I understand the (minor) risk, and I'll be unhappy if this possibility gets blocked. A warning is enough.
Azarien
Oldbie
 
Posts: 521
Joined: 2015-5-14 @ 07:14

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby Dominus » 2018-1-10 @ 17:37

Most people can drive their car without seatbelt and nothing happens, but I think it was great to make it against the law.
Again, no developer of DOSBox is part of this discussion, it's just a brainstorming after the original post.
As I wrote in the post above yours, my idea would involve a way to skip that check.
Again, just a brainstorming, nothing to get your hopes or fears up...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7593
Joined: 2002-10-03 @ 09:54
Location: Vienna or Ludwigsburg

Re: Enhancement: Mount drive but block \WINDOWS ??

Postby dr_st » 2018-1-10 @ 18:39

It's one of these situations where I really agree with both sides.

There is no logical reason to mount the root of the system drive in DOSBox; but I think that it should not be blocked. :)
User avatar
dr_st
Oldbie
 
Posts: 1261
Joined: 2015-4-09 @ 07:18


Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 1 guest