dokan-dev / dokany

User mode file system library for windows with FUSE Wrapper
http://dokan-dev.github.io
5.21k stars 661 forks source link

A mounted drive by administrator's right with "DOKAN_OPTION_CURRENT_SESSION" is not visible to a normal user in explorer. #1071

Closed bluenred9 closed 2 years ago

bluenred9 commented 2 years ago

Feature request can skip this form. Bug report must complete it. Check List must be 100% match or it will be automatically closed without further discussion. Please remove this line.

Environment

Hello.

I mounted a driver by administrator's right - elevated right with DOKAN_OPTION_CURRENT_SESSION option via mirror sample.

But the drive cannot be accessed and be shown by a normal user.

How can I solve this issue? image

Liryna commented 2 years ago

Hi @bluenred9 ,

This is the expected. The admin user is running in a different session that your explorer that is running in your user session. What are you trying to achieve exactly ?

bluenred9 commented 2 years ago

Thank you for reply.

But a sessionId of a normal user is same with a sessionId of a user who has administrator's right(evelvated).

Liryna commented 2 years ago

Your statement is incorrect. You can use your task manager and see your admin command prompt is run as Administrator user and not your normal user. It is two different sessions.

bluenred9 commented 2 years ago

@Liryna

As you can see below, a session id of a evelvated user is 1. A session id of a normal user is 1. They are indentical.

image

Liryna commented 2 years ago

My bad I gave incorrect guidance. The reason is by design. The mount point is created with IoCreateSymbolicLink in the session/context of the user call. This symbolic link is only accessible in the context that it was created. For me this is by design (Microsoft) and probably what people want to achieve when using this option.

If someone wants to limit the access to the user and the elevated process, it can provide an adapted security descriptor for the mount or simply mount as a folder in the user directory.

bluenred9 commented 2 years ago

@Liryna Then... If so, how do I make it accessible to a windows account(both evelvated and normal) without global mount?

Liryna commented 2 years ago

You can mount in a folder and use subst command to assign a letter for example.