Brian May <[email protected]> writes:
> On 26 September 2014 12:08, Russ Allbery <[email protected]> wrote:
>>
>> I think you have that backwards, don't you? Shouldn't that be:
>>
>> echo='() { /bin/echo bar; }' sudo bash
> I think sudo treats both as the same/similar thing.
That would surprise me. In one case, you're setting an environment
variable and then running sudo. In the other case, you're telling sudo to
run the command "echo='() { /bin/echo bar; }' echo foo" via a shell. In
other words, with your original command, the actual command that you're
running with sudo is probably something like:
/bin/bash -e "echo='() { /bin/echo bar; }' echo foo"
and sudo itself never sees your environment setting.
sudo controls whether it's willing to pass arbitrary environment variables
to the command it runs with the env_reset, env_keep, and env_check
options.
--
Russ Allbery ([email protected]) <http://www.eyrie.org/~eagle/>
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: https://lists.debian.org/[email protected]