2019-11-06 09:40:50 +00:00
|
|
|
Subject: [PATCH 2/7] set exit code to 1 when cpio fails to store file > 4GB
|
|
|
|
(#183224)
|
|
|
|
|
|
|
|
diff --git a/src/copyout.c b/src/copyout.c
|
2023-05-16 12:46:58 +00:00
|
|
|
index fa999bd..6e82f4c 100644
|
2019-11-06 09:40:50 +00:00
|
|
|
--- a/src/copyout.c
|
|
|
|
+++ b/src/copyout.c
|
2023-05-16 12:46:58 +00:00
|
|
|
@@ -287,7 +287,7 @@ field_width_error (const char *filename, const char *fieldname,
|
2019-11-06 09:40:50 +00:00
|
|
|
{
|
|
|
|
char valbuf[UINTMAX_STRSIZE_BOUND + 1];
|
|
|
|
char maxbuf[UINTMAX_STRSIZE_BOUND + 1];
|
|
|
|
- error (0, 0, _("%s: value %s %s out of allowed range 0..%s"),
|
|
|
|
+ error (1, 0, _("%s: value %s %s out of allowed range 0..%s"),
|
|
|
|
filename, fieldname,
|
|
|
|
STRINGIFY_BIGINT (value, valbuf),
|
|
|
|
STRINGIFY_BIGINT (MAX_VAL_WITH_DIGITS (width - nul, LG_8),
|
|
|
|
diff --git a/tests/CVE-2019-14866.at b/tests/CVE-2019-14866.at
|
2023-05-16 12:46:58 +00:00
|
|
|
index 530365a..5a4e15c 100644
|
2019-11-06 09:40:50 +00:00
|
|
|
--- a/tests/CVE-2019-14866.at
|
|
|
|
+++ b/tests/CVE-2019-14866.at
|
|
|
|
@@ -30,6 +30,5 @@ fi
|
|
|
|
[0],
|
|
|
|
[],
|
|
|
|
[cpio: file: value size 17179869184 out of allowed range 0..8589934591
|
|
|
|
-2 blocks
|
|
|
|
])
|
|
|
|
AT_CLEANUP
|
|
|
|
diff --git a/tests/testsuite b/tests/testsuite
|
2023-05-16 12:46:58 +00:00
|
|
|
index 10531d1..d69dad9 100755
|
2019-11-06 09:40:50 +00:00
|
|
|
--- a/tests/testsuite
|
|
|
|
+++ b/tests/testsuite
|
2023-05-16 12:46:58 +00:00
|
|
|
@@ -2927,7 +2927,6 @@ fi
|
2019-11-06 09:40:50 +00:00
|
|
|
at_status=$? at_failed=false
|
|
|
|
$at_check_filter
|
2023-05-16 12:46:58 +00:00
|
|
|
echo >>"$at_stderr"; printf "%s\n" "cpio: file: value size 17179869184 out of allowed range 0..8589934591
|
2019-11-06 09:40:50 +00:00
|
|
|
-2 blocks
|
|
|
|
" | \
|
|
|
|
$at_diff - "$at_stderr" || at_failed=:
|
|
|
|
at_fn_diff_devnull "$at_stdout" || at_failed=:
|