From 62c3db5f34164923fd632c9122dd91365114156f Mon Sep 17 00:00:00 2001 From: bjh7242 Date: Sat, 28 Apr 2018 16:56:15 -0400 Subject: [PATCH 1/4] updating error when running powershell installer as root --- tools/installpsh-debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/installpsh-debian.sh b/tools/installpsh-debian.sh index a525f3ceea9..24f00b8684b 100755 --- a/tools/installpsh-debian.sh +++ b/tools/installpsh-debian.sh @@ -94,7 +94,7 @@ if (( $EUID != 0 )); then fi #Check that sudo is available -if [[ "$SUDO" -eq "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then +if [[ $EUID != 0 && "$SUDO" -eq "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then $SUDO -v if [ $? -ne 0 ]; then From bc7d67c809be45e60b5b655708fc7230e6d71064 Mon Sep 17 00:00:00 2001 From: bjh7242 Date: Mon, 30 Apr 2018 15:50:40 -0400 Subject: [PATCH 2/4] updating logic in conditional statement to set the SUDO variable --- tools/installpsh-debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/installpsh-debian.sh b/tools/installpsh-debian.sh index 24f00b8684b..857bb9f64d9 100755 --- a/tools/installpsh-debian.sh +++ b/tools/installpsh-debian.sh @@ -94,7 +94,7 @@ if (( $EUID != 0 )); then fi #Check that sudo is available -if [[ $EUID != 0 && "$SUDO" -eq "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then +if [[ "$SUDO" == "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then $SUDO -v if [ $? -ne 0 ]; then From d975d43f2537cce4bc992c0ef044c7db5d9b944d Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Mon, 30 Apr 2018 12:50:17 -0700 Subject: [PATCH 3/4] make comparison the same in other installers --- tools/installpsh-redhat.sh | 2 +- tools/installpsh-suse.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/installpsh-redhat.sh b/tools/installpsh-redhat.sh index 6ef52f2c52f..e5f90315a45 100755 --- a/tools/installpsh-redhat.sh +++ b/tools/installpsh-redhat.sh @@ -96,7 +96,7 @@ if (( $EUID != 0 )); then fi #Check that sudo is available -if [[ "$SUDO" -ne "" ]]; then +if [[ "$SUDO" == "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then $SUDO -v if [ $? -ne 0 ]; then diff --git a/tools/installpsh-suse.sh b/tools/installpsh-suse.sh index d4b2b2fad4a..8111d4f154f 100755 --- a/tools/installpsh-suse.sh +++ b/tools/installpsh-suse.sh @@ -94,7 +94,7 @@ if (( $EUID != 0 )); then fi #Check that sudo is available -if [[ "$SUDO" -eq "sudo" ]]; then +if [[ "$SUDO" == "sudo" ]]; then $SUDO -v if [ $? -ne 0 ]; then From ddede604bdfbc95db17d9f6e0d01526121e3a65a Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Mon, 30 Apr 2018 12:50:56 -0700 Subject: [PATCH 4/4] add -skip-sudo-check for consistency --- tools/installpsh-redhat.sh | 1 + tools/installpsh-suse.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/installpsh-redhat.sh b/tools/installpsh-redhat.sh index e5f90315a45..e581593a2c3 100755 --- a/tools/installpsh-redhat.sh +++ b/tools/installpsh-redhat.sh @@ -14,6 +14,7 @@ #Switches # -includeide - the script is being run headless, do not perform actions that require response from the console # -interactivetests - requires a human user in front of the machine - loads a script into the ide to test with F5 to ensure the IDE can run scripts +# -skip-sudo-check - skips the check that the user has permission to use sudo. This is required to run in the VSTS Hosted Linux Preview. #gitrepo paths are overrideable to run from your own fork or branch for testing or private distribution diff --git a/tools/installpsh-suse.sh b/tools/installpsh-suse.sh index 8111d4f154f..b5bf82c9d33 100755 --- a/tools/installpsh-suse.sh +++ b/tools/installpsh-suse.sh @@ -14,6 +14,7 @@ #Switches # -includeide - the script is being run headless, do not perform actions that require response from the console # -interactivetests - requires a human user in front of the machine - loads a script into the ide to test with F5 to ensure the IDE can run scripts +# -skip-sudo-check - skips the check that the user has permission to use sudo. This is required to run in the VSTS Hosted Linux Preview. #gitrepo paths are overrideable to run from your own fork or branch for testing or private distribution @@ -94,7 +95,7 @@ if (( $EUID != 0 )); then fi #Check that sudo is available -if [[ "$SUDO" == "sudo" ]]; then +if [[ "$SUDO" == "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then $SUDO -v if [ $? -ne 0 ]; then