aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-09-27 12:16:34 -0700
committerSimon Brandhof <simon.brandhof@gmail.com>2011-09-27 12:16:34 -0700
commit2015a54459a346e1a852a562336811a328c9db8a (patch)
tree85502b5ae5c649009fd7a3cd9bb3339f9cab0f8e
parentbc668fb7f2cc9e9f9d10125f64e740dc7af499c6 (diff)
parenta3e7c015f7a001db50d960202ee11ec838ca5113 (diff)
downloadsonarqube-2015a54459a346e1a852a562336811a328c9db8a.tar.gz
sonarqube-2015a54459a346e1a852a562336811a328c9db8a.zip
Merge pull request #15 from maestrodev/master
Exit code is not properly returned when using RUN_AS_USER
-rwxr-xr-xsonar-application/src/main/assembly/bin/linux-ppc-64/sonar.sh3
-rwxr-xr-xsonar-application/src/main/assembly/bin/linux-x86-32/sonar.sh3
-rwxr-xr-xsonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh3
-rwxr-xr-xsonar-application/src/main/assembly/bin/macosx-universal-32/sonar.sh3
-rwxr-xr-xsonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh3
-rwxr-xr-xsonar-application/src/main/assembly/bin/solaris-sparc-32/sonar.sh3
-rwxr-xr-xsonar-application/src/main/assembly/bin/solaris-sparc-64/sonar.sh3
-rwxr-xr-xsonar-application/src/main/assembly/bin/solaris-x86-32/sonar.sh3
8 files changed, 16 insertions, 8 deletions
diff --git a/sonar-application/src/main/assembly/bin/linux-ppc-64/sonar.sh b/sonar-application/src/main/assembly/bin/linux-ppc-64/sonar.sh
index c080399c62c..aa02bd87032 100755
--- a/sonar-application/src/main/assembly/bin/linux-ppc-64/sonar.sh
+++ b/sonar-application/src/main/assembly/bin/linux-ppc-64/sonar.sh
@@ -334,6 +334,7 @@ checkUser() {
# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
su -m $RUN_AS_USER -c "\"$REALPATH\" $2"
+ RETVAL=$?
# Now that we are the original user again, we may need to clean up the lock file.
if [ "X$LOCKPROP" != "X" ]
@@ -349,7 +350,7 @@ checkUser() {
fi
fi
- exit 0
+ exit $RETVAL
fi
}
diff --git a/sonar-application/src/main/assembly/bin/linux-x86-32/sonar.sh b/sonar-application/src/main/assembly/bin/linux-x86-32/sonar.sh
index c080399c62c..aa02bd87032 100755
--- a/sonar-application/src/main/assembly/bin/linux-x86-32/sonar.sh
+++ b/sonar-application/src/main/assembly/bin/linux-x86-32/sonar.sh
@@ -334,6 +334,7 @@ checkUser() {
# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
su -m $RUN_AS_USER -c "\"$REALPATH\" $2"
+ RETVAL=$?
# Now that we are the original user again, we may need to clean up the lock file.
if [ "X$LOCKPROP" != "X" ]
@@ -349,7 +350,7 @@ checkUser() {
fi
fi
- exit 0
+ exit $RETVAL
fi
}
diff --git a/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh b/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh
index c080399c62c..aa02bd87032 100755
--- a/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh
+++ b/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh
@@ -334,6 +334,7 @@ checkUser() {
# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
su -m $RUN_AS_USER -c "\"$REALPATH\" $2"
+ RETVAL=$?
# Now that we are the original user again, we may need to clean up the lock file.
if [ "X$LOCKPROP" != "X" ]
@@ -349,7 +350,7 @@ checkUser() {
fi
fi
- exit 0
+ exit $RETVAL
fi
}
diff --git a/sonar-application/src/main/assembly/bin/macosx-universal-32/sonar.sh b/sonar-application/src/main/assembly/bin/macosx-universal-32/sonar.sh
index 6ad48536cc5..525cf6053ee 100755
--- a/sonar-application/src/main/assembly/bin/macosx-universal-32/sonar.sh
+++ b/sonar-application/src/main/assembly/bin/macosx-universal-32/sonar.sh
@@ -334,6 +334,7 @@ checkUser() {
# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
su -m $RUN_AS_USER -c "\"$REALPATH\" $2"
+ RETVAL=$?
# Now that we are the original user again, we may need to clean up the lock file.
if [ "X$LOCKPROP" != "X" ]
@@ -349,7 +350,7 @@ checkUser() {
fi
fi
- exit 0
+ exit $RETVAL
fi
}
diff --git a/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh b/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh
index 6ad48536cc5..525cf6053ee 100755
--- a/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh
+++ b/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh
@@ -334,6 +334,7 @@ checkUser() {
# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
su -m $RUN_AS_USER -c "\"$REALPATH\" $2"
+ RETVAL=$?
# Now that we are the original user again, we may need to clean up the lock file.
if [ "X$LOCKPROP" != "X" ]
@@ -349,7 +350,7 @@ checkUser() {
fi
fi
- exit 0
+ exit $RETVAL
fi
}
diff --git a/sonar-application/src/main/assembly/bin/solaris-sparc-32/sonar.sh b/sonar-application/src/main/assembly/bin/solaris-sparc-32/sonar.sh
index 154e3289218..b7ea5df58b6 100755
--- a/sonar-application/src/main/assembly/bin/solaris-sparc-32/sonar.sh
+++ b/sonar-application/src/main/assembly/bin/solaris-sparc-32/sonar.sh
@@ -335,6 +335,7 @@ checkUser() {
# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
su -m $RUN_AS_USER -c "\"$REALPATH\" $2"
+ RETVAL=$?
# Now that we are the original user again, we may need to clean up the lock file.
if [ "X$LOCKPROP" != "X" ]
@@ -350,7 +351,7 @@ checkUser() {
fi
fi
- exit 0
+ exit $RETVAL
fi
}
diff --git a/sonar-application/src/main/assembly/bin/solaris-sparc-64/sonar.sh b/sonar-application/src/main/assembly/bin/solaris-sparc-64/sonar.sh
index 154e3289218..b7ea5df58b6 100755
--- a/sonar-application/src/main/assembly/bin/solaris-sparc-64/sonar.sh
+++ b/sonar-application/src/main/assembly/bin/solaris-sparc-64/sonar.sh
@@ -335,6 +335,7 @@ checkUser() {
# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
su -m $RUN_AS_USER -c "\"$REALPATH\" $2"
+ RETVAL=$?
# Now that we are the original user again, we may need to clean up the lock file.
if [ "X$LOCKPROP" != "X" ]
@@ -350,7 +351,7 @@ checkUser() {
fi
fi
- exit 0
+ exit $RETVAL
fi
}
diff --git a/sonar-application/src/main/assembly/bin/solaris-x86-32/sonar.sh b/sonar-application/src/main/assembly/bin/solaris-x86-32/sonar.sh
index 98ba3efd301..8848cfa9ba5 100755
--- a/sonar-application/src/main/assembly/bin/solaris-x86-32/sonar.sh
+++ b/sonar-application/src/main/assembly/bin/solaris-x86-32/sonar.sh
@@ -334,6 +334,7 @@ checkUser() {
# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
sudo -u $RUN_AS_USER "$REALPATH" "$2"
+ RETVAL=$?
# Now that we are the original user again, we may need to clean up the lock file.
if [ "X$LOCKPROP" != "X" ]
@@ -349,7 +350,7 @@ checkUser() {
fi
fi
- exit 0
+ exit $RETVAL
fi
}