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 }