12 Oct
2016
12 Oct
'16
10 a.m.
Pipelines run in subshells, so we need to set errexit for privilege escalation failing to exit the script properly. Fixes FS#44850. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> --- src/paccache.sh.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/paccache.sh.in b/src/paccache.sh.in index a7f9d62..e34f684 100644 --- a/src/paccache.sh.in +++ b/src/paccache.sh.in @@ -353,6 +353,9 @@ unset candtemp # do this before we destroy anything totalsaved=$(@SIZECMD@ "${candidates[@]}" | awk '{ sum += $1 } END { print sum }') +# Exit immediately if a pipeline returns non-zero. +set -o errexit + # crush. kill. destroy. (( verbose )) && cmdopts+=(-v) if (( delete )); then -- 2.10.0