]> git.ipfire.org Git - thirdparty/systemd.git/commit
test-execute: Clarify interaction of PassEnvironment= and MANAGER_USER 1852/head
authorFilipe Brandenburger <filbranden@google.com>
Wed, 11 Nov 2015 17:24:34 +0000 (09:24 -0800)
committerFilipe Brandenburger <filbranden@google.com>
Wed, 11 Nov 2015 17:24:34 +0000 (09:24 -0800)
commite1abca2ee42e5938ee1f2542c3eba9e70edb0be2
treec0e4c0d255fe99cf7d79e1cde128915de986db3d
parent4c80d201ace0377312c27143afab04e9c9f1ee64
test-execute: Clarify interaction of PassEnvironment= and MANAGER_USER

@evverx brought up that test-execute runs under MANAGER_USER which
forwards all its environment variables to the services. It turns out it
only forwards those that were in the environment at the time of manager
creation, so this test was still working.

It was still possible to attack it by running something like:
  $ sudo VAR1=a VAR2=b VAR3=c ./test-execute

Prevent that attack by unsetting the three variables explicitly before
creating the manager for the test case.

Also add comments explaining the interactions with MANAGER_USER and,
while it has some caveats, this tests are still valid in that context.

Tested by checking that the test running with the variables set from the
external environment will still pass.
src/test/test-execute.c