tokio icon indicating copy to clipboard operation
tokio copied to clipboard

support CreateProcessAsUserA in windows for Command module

Open RickSKy opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. tokio::process::Command may need use another user to run in some cases.

Describe the solution you'd like add an function to set the token for CreateProcessAsUserA like creation_flags() in windows platform

RickSKy avatar Aug 08 '22 03:08 RickSKy

Thoughts? @ipetkov

Darksonn avatar Aug 09 '22 11:08 Darksonn

Looks like there is an extension trait in the standard library which allows for setting arbitrary creation_flags()

We can easily add the same API but I think that won't help since the process needs to be created with CreateProcessAsUserW while the standard library uses CreateProcessW

ipetkov avatar Aug 11 '22 00:08 ipetkov

Could this be added to the standard library? This could be useful for non-async usage as well

notgull avatar Aug 11 '22 04:08 notgull

Tokio currently works by using the implementation in the standard library, so if std doesn't support it, then supporting it in Tokio without first supporting it in std would require a complete rewrite of tokio::process. I don't think that would be worth it.

Darksonn avatar Aug 11 '22 09:08 Darksonn