Skip to content

Commit

Permalink
[MAPPASM-113] Exit code is not properly returned when using RUN_AS_USER
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/tiste/MOJOHAUS-TO-GIT/SVN-MOJO-WIP/trunk/mojo/appassembler@13432 52ab4f32-60fc-0310-b215-8acea882cd1b
  • Loading branch information
Carlos Sanchez committed Jan 21, 2011
1 parent 6a64f2b commit 25b9149
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion appassembler-maven-plugin/src/main/patches/sh.script.in
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand All @@ -350,7 +351,7 @@ checkUser() {
fi
fi

exit 0
exit $RETVAL
fi
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand All @@ -350,7 +351,7 @@ checkUser() {
fi
fi

exit 0
exit $RETVAL
fi
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand All @@ -350,7 +351,7 @@ checkUser() {
fi
fi

exit 0
exit $RETVAL
fi
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand All @@ -350,7 +351,7 @@ checkUser() {
fi
fi

exit 0
exit $RETVAL
fi
}

Expand Down

0 comments on commit 25b9149

Please sign in to comment.