aboutsummaryrefslogtreecommitdiff
path: root/configs
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-07 14:54:41 +0000
committerRon Yorston <rmy@pobox.com>2019-03-07 15:34:24 +0000
commit0533794afd81b37684669ee0c5afc7a5e1ff159d (patch)
treea6afcd3e6c5e6430093b5e01111d799ed1a30622 /configs
parent585d17d262efabce4a9a87f33f531ef9ab7c0e36 (diff)
downloadbusybox-w32-0533794afd81b37684669ee0c5afc7a5e1ff159d.tar.gz
busybox-w32-0533794afd81b37684669ee0c5afc7a5e1ff159d.tar.bz2
busybox-w32-0533794afd81b37684669ee0c5afc7a5e1ff159d.zip
su: add a basic implementation for WIN32
Use the undocumented 'runas' verb in a call to ShellExecuteEx() to run a shell with elevated privileges. Because of the way ShellExecuteEx() works this: - requires that you acknowledge a User Account Control prompt (if you're an Administrator); - requires that you enter an Administrator's password (if you aren't an Administrator); - creates a separate console window for the privileged shell. Variables from the parent shell aren't passed to its privileged child, only variables from the environment. It's possible to specify a command to run when the shell starts. This can be used to pass shell variables: su -c "HELLO='hello world'; GOODBYE=$GOODBYE" Or do fancy things like: su -c "ls -l; read -p 'Hit return to exit: '; exit" It's probably best to put double quotes around the command and use single quotes inside it. Apparently ShellExecuteEx() requires double quotes to be entered in triplicate: su -c 'HELLO="""hello world"""'
Diffstat (limited to 'configs')
-rw-r--r--configs/mingw32_defconfig3
-rw-r--r--configs/mingw64_defconfig3
2 files changed, 4 insertions, 2 deletions
diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig
index a29cc164a..571aa112c 100644
--- a/configs/mingw32_defconfig
+++ b/configs/mingw32_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Busybox version: 1.31.0.git 3# Busybox version: 1.31.0.git
4# Wed Mar 6 09:32:59 2019 4# Thu Mar 7 14:31:51 2019
5# 5#
6CONFIG_HAVE_DOT_CONFIG=y 6CONFIG_HAVE_DOT_CONFIG=y
7# CONFIG_PLATFORM_POSIX is not set 7# CONFIG_PLATFORM_POSIX is not set
@@ -550,6 +550,7 @@ CONFIG_FEATURE_DEFAULT_PASSWD_ALGO=""
550# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set 550# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
551# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set 551# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set
552# CONFIG_SULOGIN is not set 552# CONFIG_SULOGIN is not set
553CONFIG_SUW32=y
553# CONFIG_VLOCK is not set 554# CONFIG_VLOCK is not set
554 555
555# 556#
diff --git a/configs/mingw64_defconfig b/configs/mingw64_defconfig
index 3d6102f0a..47bfc994a 100644
--- a/configs/mingw64_defconfig
+++ b/configs/mingw64_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Busybox version: 1.31.0.git 3# Busybox version: 1.31.0.git
4# Wed Mar 6 09:32:59 2019 4# Thu Mar 7 14:31:51 2019
5# 5#
6CONFIG_HAVE_DOT_CONFIG=y 6CONFIG_HAVE_DOT_CONFIG=y
7# CONFIG_PLATFORM_POSIX is not set 7# CONFIG_PLATFORM_POSIX is not set
@@ -550,6 +550,7 @@ CONFIG_FEATURE_DEFAULT_PASSWD_ALGO=""
550# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set 550# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
551# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set 551# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set
552# CONFIG_SULOGIN is not set 552# CONFIG_SULOGIN is not set
553CONFIG_SUW32=y
553# CONFIG_VLOCK is not set 554# CONFIG_VLOCK is not set
554 555
555# 556#