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

[FR] Prompt for UAC elevation instead of throwing "Access is denied" error? #95

Open
e-t-l opened this issue Oct 13, 2023 · 4 comments
Open

Comments

@e-t-l
Copy link

e-t-l commented Oct 13, 2023

On Windows, if Ultracopier cannot complete a transfer because it lacks administrator privileges, the current behavior is to cancel the transfer and throw an error message: "Access is denied."

Instead, would it be possible to trigger a relaunch of Ultracopier with elevated privileges (i.e. which will usually require UAC confirmation), and then perform the transfer using the elevated instance?

(Ideally, the elevated Ultracopier instance would execute only that particular transfer, then kill the elevated process and resume the non-elevated instance. This way, elevation would be requested on a case-by-case basis and wouldn't be persistent, which would be vulnerable to abuse.)

@e-t-l e-t-l changed the title Prompt for UAC elevation instead of throwing "Access is denied" error? [FR] Prompt for UAC elevation instead of throwing "Access is denied" error? Oct 13, 2023
@alphaonex86
Copy link
Owner

The unique way to do that's it's restart whole Ultracopier (whole process manager all copy). Include with separated process mean close the current copy in process, it's not a solution.

The root problem is the named pipe, in case of privilege elevation, windows detect privilege change and close the process by security.

@e-t-l
Copy link
Author

e-t-l commented Oct 13, 2023

mean close the current copy in process, it's not a solution.

Yes, but it seems like the simplest solution, doesn't it? Especially if UC can differentiate between non-privileged and privileged transfers, it could finish all non-privileged transfers and then prompt to restart UC with elevation.

Another possible option: Could UC redirect just the privileged transfer back to the default Windows copy/move API, and let Windows handle elevation?

The third option, which I suspect would be the most complicated to implement, but also the most effective: UC could spawn an elevated child-process that can exist alongside the normal UC process. This child-process would handle the privileged transfers in parallel with UC's handling of any non-privileged transfers.

Implementing ANY of these options seems better than the current situation, where the transfer simply fails and provided no option to reattempt it...

@alphaonex86
Copy link
Owner

alphaonex86 commented Oct 13, 2023

For the first option, it's like open UC as admin and do manually the copy, mostly of the users had generated problem because:

  • Don't understand why it need do it manually
  • Generate lot of problem, communication between user space and privileged space is problematic

Another possible option: Could UC redirect just the privileged transfer back to the default Windows copy/move API, and let Windows handle elevation?

No

The third option, which I suspect would be the most complicated to implement, but also the most effective: UC could spawn an elevated child-process that can exist alongside the normal UC process. This child-process would handle the privileged transfers in parallel with UC's handling of any non-privileged transfers.

Windows not allow communication between normal user and privileged process

@e-t-l
Copy link
Author

e-t-l commented Oct 13, 2023

Windows not allow communication between normal user and privileged process

I must trust that you know more about it than I do. I would have guessed that there are plenty of situations where an unelevated process must pass commands to an elevated one. I don't know enough about the code used by UC to know if any of these solutions are relevant.

I could even imagine a solution where the instructions for the transfer that requires elevation is written to a temporary program file, which the privileged child-process reads and executes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants