From 25b9149535a0ca6b4de19867995f36659567d438 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Fri, 21 Jan 2011 03:03:36 +0000 Subject: [PATCH] [MAPPASM-113] Exit code is not properly returned when using RUN_AS_USER git-svn-id: file:///home/tiste/MOJOHAUS-TO-GIT/SVN-MOJO-WIP/trunk/mojo/appassembler@13432 52ab4f32-60fc-0310-b215-8acea882cd1b --- appassembler-maven-plugin/src/main/patches/sh.script.in | 3 ++- .../appassembler/daemon/jsw/no-generator-configurations-run.sh | 3 ++- .../org/codehaus/mojo/appassembler/daemon/jsw/run-1.sh | 3 ++- .../org/codehaus/mojo/appassembler/daemon/jsw/run-8.sh | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/appassembler-maven-plugin/src/main/patches/sh.script.in b/appassembler-maven-plugin/src/main/patches/sh.script.in index 886957c3..5d7d8c38 100644 --- a/appassembler-maven-plugin/src/main/patches/sh.script.in +++ b/appassembler-maven-plugin/src/main/patches/sh.script.in @@ -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/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/no-generator-configurations-run.sh b/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/no-generator-configurations-run.sh index e1e95530..3437602f 100644 --- a/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/no-generator-configurations-run.sh +++ b/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/no-generator-configurations-run.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/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/run-1.sh b/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/run-1.sh index 6b1adabb..119ff23c 100644 --- a/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/run-1.sh +++ b/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/run-1.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/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/run-8.sh b/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/run-8.sh index a81b4819..9976bdef 100644 --- a/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/run-8.sh +++ b/appassembler-maven-plugin/src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/run-8.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 }