[tor-commits] [ooni-probe/master] Preserve evnironment in su and sudo commands

art at torproject.org art at torproject.org
Fri Nov 20 14:41:58 UTC 2015


commit 235416252df23e0030a6cfa279cb37a5c0b60718
Author: anadahz <kojgelo at inbox.com>
Date:   Sun Jul 12 20:55:25 2015 +0200

    Preserve evnironment in su and sudo commands
---
 scripts/install.sh |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/install.sh b/scripts/install.sh
index 6efd19f..6dbe7c3 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -81,9 +81,9 @@ user="$(id -un 2>/dev/null || true)"
 sh_c='sh -c'
 if [ "$user" != 'root' ]; then
 	if command_exists sudo; then
-		sh_c='sudo sh -c'
+		sh_c='sudo sh -c -E'
 	elif command_exists su; then
-		sh_c='su -c'
+		sh_c='su -c --preserve-environment'
 	else
 		echo >&2 'Error: this installer needs the ability to run commands as root.'
 		echo >&2 'We are unable to find either "sudo" or "su" available to make this happen.'





More information about the tor-commits mailing list