Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peek cannot peek on mapped network drive if PowerToys is running as admin #26181

Closed
The-MAZZTer opened this issue May 24, 2023 · 8 comments
Closed
Assignees
Labels
Hot Fix Items we will product an out-of-band release for Issue-Bug Something isn't working Product-Peek Refers to Peek Powertoys Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@The-MAZZTer
Copy link

Microsoft PowerToys version

0.70.0

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

Peek

Steps to reproduce

  1. Map a network drive to a share in an unelevated process.
  2. Launch an elevated app (such as cmd or pwsh) and check that the drive is indeed not available when elevated.
  3. Open File Explorer unelevated.
  4. Navigate to the network drive letter.
  5. Peek any file or folder on it.

✔️ Expected Behavior

Peek works as expected.

❌ Actual Behavior

Because the drive is only mapped for unelevated processes, Peek fails to read the file and you get an error message.0

Not sure what a good fix for this is. Given there is also an issue with Mouse Without Borders regarding elevation, a long term solution may be to split PowerToys into two processes, one of which runs code that benefits from elevation, the other which runs the bulk of the code.

Another user reported they could not Peek files inside ZIP files (this is because Peek uses normal file system APIs to read files, so it can't Peek shell objects that don't have real files backing them). So it may make sense to use the shell API to read the files, I am not sure if that would help for this case or not.

Other Software

No response

@The-MAZZTer The-MAZZTer added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels May 24, 2023
@htcfreek htcfreek added the Product-Peek Refers to Peek Powertoys label May 24, 2023
@htcfreek
Copy link
Collaborator

@SamChaps
Looks like we have to start the module always non-elevated like we did for PT Run.

@jaimecbernardo
Copy link
Collaborator

I wonder if we should restrict Peek from running as admin. Is running File Explorer Windows as admin a thing?

Also, according to ChatGPT, right now we're hitting all of these with Peek:
image

There might be an interest in keeping Peek available for admin or system windows.

@htcfreek
Copy link
Collaborator

Is running File Explorer Windows as admin a thing?

@jaimecbernardo
This is impossible. The Windows Explorer runs always in the user's context.

@jaimecbernardo
Copy link
Collaborator

I think a solution here might be to have a Setting that makes it so that Peek always runs un-elevated. And set that to true by default. That way people can disable that if they run into trouble.

@jaimecbernardo jaimecbernardo self-assigned this May 25, 2023
@jaimecbernardo jaimecbernardo added Status-In progress This issue or work-item is under development Hot Fix Items we will product an out-of-band release for and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels May 25, 2023
@jaimecbernardo
Copy link
Collaborator

Can replicate this by creating a local network share like this:

net use t: \\localhost\c$\tempshare

When running as admin, Peek won't be able to view these files.

@binarynoise
Copy link

Similar problem occurs if PowerToys is running under a different user after an update (my admin is separate) so accessing files in the personal folder fails as well (though I would have assumed that admins can read everything as they are, well, admins with elevated rights)

@jaimecbernardo
Copy link
Collaborator

@binarynoise , I think the fix I'm proposing should fix you case as well.

@crutkas crutkas added Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed Status-In progress This issue or work-item is under development labels May 26, 2023
@crutkas
Copy link
Member

crutkas commented Jul 14, 2023

Fixed in 0.71 release of PowerToys. aka.ms/installpowertoys

@crutkas crutkas closed this as completed Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hot Fix Items we will product an out-of-band release for Issue-Bug Something isn't working Product-Peek Refers to Peek Powertoys Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

5 participants