You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.
pkexec changes workdir to /root, so the code fails to preserve CWD as cd is done in an "outer" shell and does not propagate through pkexec
SUDO_PROMPT_TEST_ENV does not come from pkexec'ed environment, it comes from an "outer" shell. So, command env | grep ^SUDO_PROMPT_TEST_ENV= shows nothing
working directory is wrapped with double quotes, so shell variable expansion is applied, e.g. the code fails to run in a directory named /mnt/$udo-prompt" with stderr: "/bin/sh: 1: cd: can't cd to /mnt/-prompt\n"
variable value is wrapped with double quotes, so shell variable expansion is applied there as well
I can provide a PR with fixes, but some of the fixes may break backwards compatibility, and I ask for some guidance from the maintainer before submitting a PR.
may command echo "$PATH" change the behavior and show after-sudo PATH instead of before-sudo PATH? It refers to the difference between the following commands:
$ sudo sh -c "echo $HOME"
/home/node
$ sudo sh -c 'echo $HOME'
/root
may env {name: 'something like $million'} change the behavior and preserve $million as-is instead of doing shell variable expansion?
may the command be skipped if the script fails to change the directory?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Linux has the following command generated while running
node test.js
(newlines added after;
for readability):The command has the following issues:
pkexec
changes workdir to/root
, so the code fails to preserve CWD ascd
is done in an "outer" shell and does not propagate throughpkexec
SUDO_PROMPT_TEST_ENV
does not come from pkexec'ed environment, it comes from an "outer" shell. So, commandenv | grep ^SUDO_PROMPT_TEST_ENV=
shows nothing/mnt/$udo-prompt"
withstderr: "/bin/sh: 1: cd: can't cd to /mnt/-prompt\n"
I can provide a PR with fixes, but some of the fixes may break backwards compatibility, and I ask for some guidance from the maintainer before submitting a PR.
echo "$PATH"
change the behavior and show after-sudo PATH instead of before-sudo PATH? It refers to the difference between the following commands:{name: 'something like $million'}
change the behavior and preserve$million
as-is instead of doing shell variable expansion?The text was updated successfully, but these errors were encountered: