memfs doesn't work for both admin and non-admin users

27 views
Skip to first unread message

Bob Flavin

unread,
Dec 20, 2024, 4:47:08 PM12/20/24
to WinFsp
This is probably a windows security issue I don't understand, but...  When I run:

java -jar /git/jnr-winfsp/target/jnr-winfsp-0.21.0-memfs.jar z:

from cmd.exe for a userid (windows 11), I can access z: from other cmd.exe prompts from that userid.  However, 

    C:\bin>ls z:
    ls: _getdcwd: error 13

from a cmd.exe started as administrator I get this error 13,  where the admin cmd.exe cannot see the z:.   And vice versa, if java memfs is started in an admin cmd.exe, the normal user cmd.exe cannot see/access the z:  (I don't have other non-admin userids to see if they could access the z: when started by the original non-admin userid.

Bill Zissimopoulos

unread,
Dec 23, 2024, 3:42:15 AM12/23/24
to WinFsp

Hello:

 

WinFsp creates drives in a number of different ways. The default way is to use DefineDosDeviceW, which creates drives in a per-user namespace. This means that a drive created by user Bob is only accessible by user Bob.

 

The drive namespace for an elevated user (e.g. in an Administrator prompt) is different from the drive namespace for the same user but non-elevated. This means that if you create a drive as Administrator you will not be able to access it when non-elevated (and vice versa). This is by Windows design and not specific to WinFsp.

 

I hope this explains the behavior your are seeing.

 

WinFsp also allows the creation of drives accessible by all users:

 

  • Create the drive as the SYSTEM account (i.e. the account that runs Windows services). In that case the DefineDosDeviceW API creates a drive that is globally accessible.
  • Create the drive as an elevated user, but using the syntax \\.\X:. This special syntax instructs WinFsp to use the “Mount Manager” rather than DefineDosDeviceW, which also creates drives that are globally accessible.

 

Thanks.

 

Bill

--
You received this message because you are subscribed to the Google Groups "WinFsp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to winfsp+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/winfsp/002bb920-b8a0-4ea9-be09-2c7ffb7df0c8n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages