diff options
author | Kees Cook <kees@debian.org> | 2009-02-15 09:56:42 -0800 |
---|---|---|
committer | maximilian attems <maks@debian.org> | 2009-02-15 19:52:10 +0100 |
commit | 8d21dcff7cef34c4f9a854deebdabb02503a3dae (patch) | |
tree | 2d1d625152bc022810479eba1155eae81461f11d /mkinitramfs | |
parent | 7d28901223a8f5fa47ddb0b0d39b34b04d43b8e9 (diff) | |
download | initramfs-tools-8d21dcff7cef34c4f9a854deebdabb02503a3dae.tar.gz initramfs-tools-8d21dcff7cef34c4f9a854deebdabb02503a3dae.zip |
mkinitramfs: Do not pass exit code through on pipe failure
Since "exit 2" has a special meaning, we must "exit 1" when the
find/cpio/gzip pipe fails, otherwise "update-initramfs" will potentially
ignore failures (it ignores return code "2" from mkinitramfs).
Signed-off-by: Kees Cook <kees@debian.org>
Diffstat (limited to 'mkinitramfs')
-rwxr-xr-x | mkinitramfs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mkinitramfs b/mkinitramfs index 2f5112c..d1d46b0 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -268,7 +268,7 @@ fi [ "${verbose}" = y ] && echo "Building cpio ${outfile} initramfs" ( # work around lack of "set -o pipefail" for the following pipe: -# cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}" +# cd "${DESTDIR}" && find . | cpio --quiet --dereference -o -H newc | gzip >"${outfile}" || exit 1 exec 3>&1 eval ` # http://cfaj.freeshell.org/shell/cus-faq-2.html @@ -284,7 +284,7 @@ eval ` if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi if [ "$ec2" -ne 0 ]; then exit "$ec2"; fi if [ "$ec3" -ne 0 ]; then exit "$ec3"; fi -) || exit $? +) || exit 1 if [ -s "${__TMPCPIOGZ}" ]; then cat "${__TMPCPIOGZ}" >>"${outfile}" || exit 1 |