Run exit tasks code with default bash flags and options (issues #700 and #1747) #1748
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type: Bug Fix
Impact: Normal
Reference to related issue (URL):
rear restore to smaller disk aborts silently #1747 (comment)
make rear working with "set -ue -o pipefail" #700 (comment)
How was this pull request tested?
In usr/share/rear/layout/prepare/default/420_autoresize_last_partitions.sh
use an unbound variable for testing e.g. as follows
which lets that script abort.
Without the fix it looks during "rear recover"
With the fix it looks during "rear recover"
In the DoExitTasks() function first of all restore the ReaR default bash flags and options
because otherwise in case of a bash error exit when e.g. "set -e -u -o pipefail" was set
all the exit tasks related code would also run with "set -e -u -o pipefail" still set
which may abort exit tasks related code anywhere with a "sudden death" bash error exit
where in particular no longer the EXIT_FAIL_MESSAGE would be shown
so that for the user ReaR would "just somehow silently abort" in this case.