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

feat: Add a flag to the uv_spawn to trigger UAC on Windows #4296

Open
wants to merge 23 commits into
base: v1.x
Choose a base branch
from

Conversation

CGQAQ
Copy link

@CGQAQ CGQAQ commented Feb 1, 2024

This PR handles

  • UV_PROCESS_WINDOWS_HIDE_CONSOLE and UV_PROCESS_WINDOWS_HIDE
  • UV_PROCESS_WINDOWS_HIDE_GUI and UV_PROCESS_WINDOWS_HIDE

other flags ARE ignored silently due to ShellExecuteExW limitations

REFS

closes: #4295

@CGQAQ CGQAQ marked this pull request as ready for review February 1, 2024 05:10
@CGQAQ CGQAQ changed the title WIP uac feat: Add a flag to the uv_spawn to trigger UAC on Windows Feb 1, 2024
@CGQAQ
Copy link
Author

CGQAQ commented Feb 1, 2024

@vtjnash done! PTAL

@vtjnash
Copy link
Member

vtjnash commented Feb 4, 2024

Seems good to me, what do other libuv devs think? It is platform specific, but so are a lot of the existing flags here. It will need a test and addition to the docs. And some of the options should probably error if passed in combination with it, if the combination is not feasible.

@santigimeno
Copy link
Member

what do other libuv devs think?

SGTM

@CGQAQ
Copy link
Author

CGQAQ commented Feb 4, 2024

It will need a test

@vtjnash any ideas on how to test this? once you trigger the UAC on subprocess, you need user's interaction to either click allow or disallow

src/win/process.c Outdated Show resolved Hide resolved
src/win/process.c Outdated Show resolved Hide resolved
docs/src/process.rst Outdated Show resolved Hide resolved
src/win/process.c Outdated Show resolved Hide resolved
src/win/process.c Outdated Show resolved Hide resolved
src/win/process.c Outdated Show resolved Hide resolved
src/win/process.c Outdated Show resolved Hide resolved
src/win/process.c Outdated Show resolved Hide resolved
src/win/process.c Outdated Show resolved Hide resolved
bnoordhuis
bnoordhuis previously approved these changes Feb 14, 2024
Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM at a quick glance. @vtjnash want to look this over one more time?

src/win/process.c Outdated Show resolved Hide resolved
Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm taking back my LGTM for the moment because it silently ignores stdio redirection and other options, doesn't it? Incompatible options should be errors instead.

@bnoordhuis bnoordhuis dismissed their stale review February 15, 2024 03:16

unresolved issues

@CGQAQ
Copy link
Author

CGQAQ commented Feb 18, 2024

@bnoordhuis resolved, PTAL

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some suggestions but it'd be good if @vtjnash takes another look as well.

docs/src/process.rst Outdated Show resolved Hide resolved
src/win/process.c Outdated Show resolved Hide resolved
src/win/process.c Outdated Show resolved Hide resolved
src/win/process.c Outdated Show resolved Hide resolved
CGQAQ and others added 4 commits February 20, 2024 08:26
@CGQAQ CGQAQ requested a review from vtjnash February 20, 2024 00:38
@CGQAQ
Copy link
Author

CGQAQ commented Mar 18, 2024

Hello, @vtjnash , could you please take a look?

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

Successfully merging this pull request may close these issues.

windows: support launching executables with runas permissions
4 participants