Support using `use_sudo_password` without `sudo`.
This makes it possible to execute a command as a user that will
subsequently trigger a sudo command as part of that. As long as
the sudo call is triggered correctly, the sudo password will work
correctly (homebrew on MacOS does this).
@@ -231,7 +231,6 @@ def make_unix_command(
command_bits = []
# Use sudo (w/user?)
- if sudo:
if use_sudo_password:
askpass_filename, sudo_password = use_sudo_password
command_bits.extend([
@@ -240,6 +239,7 @@ def make_unix_command(
MaskString('{0}={1}'.format(SUDO_ASKPASS_ENV_VAR, sudo_password)),
])
+ if sudo:
command_bits.extend(['sudo', '-H'])
if use_sudo_password:
