diff options
author | Ron Yorston <rmy@pobox.com> | 2023-03-13 10:25:56 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-03-13 10:25:56 +0000 |
commit | 385decd6bf62c116565ece1e0992ff7a79d48474 (patch) | |
tree | 30065938d54231dcadf54cc3e22206f4985a7180 /win32/process.c | |
parent | 6eeb5240974bb304830319e9fa5afbc4d6194fc0 (diff) | |
download | busybox-w32-385decd6bf62c116565ece1e0992ff7a79d48474.tar.gz busybox-w32-385decd6bf62c116565ece1e0992ff7a79d48474.tar.bz2 busybox-w32-385decd6bf62c116565ece1e0992ff7a79d48474.zip |
runuser: new applet
Add a cut down, Windows-specific implementation of `runuser` from
util-linux.
This allows elevated privileges to be dropped when running in an
SSH session. It also works when using `su` or starting busybox-w32
'as administrator'.
There are complications:
- The method used to drop privileges leaves the access token in the
TokenIsElevated state. Detecting this is likely to be fragile.
- The unprivileged shell is started by CreateProcessAsUserA(). In
older versions of Windows this has to be loaded dynamically.
Adds about 900 bytes.
(GitHub issue #240)
Diffstat (limited to 'win32/process.c')
-rw-r--r-- | win32/process.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/process.c b/win32/process.c index d78041251..0585f66a6 100644 --- a/win32/process.c +++ b/win32/process.c | |||
@@ -113,7 +113,7 @@ parse_interpreter(const char *cmd, interp_t *interp) | |||
113 | * See https://docs.microsoft.com/en-us/cpp/cpp/main-function-command-line-args?view=vs-2019#parsing-c-command-line-arguments | 113 | * See https://docs.microsoft.com/en-us/cpp/cpp/main-function-command-line-args?view=vs-2019#parsing-c-command-line-arguments |
114 | * (Parsing C++ Command-Line Arguments) | 114 | * (Parsing C++ Command-Line Arguments) |
115 | */ | 115 | */ |
116 | static char * | 116 | char * |
117 | quote_arg(const char *arg) | 117 | quote_arg(const char *arg) |
118 | { | 118 | { |
119 | int len = 0, n = 0; | 119 | int len = 0, n = 0; |