aboutsummaryrefslogtreecommitdiffstats
path: root/community/cpio/cast-arguments-to-printf.patch
diff options
context:
space:
mode:
authoralpine-mips-patches <info@mobile-stream.com>2018-12-20 14:06:58 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2018-12-27 10:21:48 +0000
commit880aa1b5c01e1e14f9295a953dbf37cbd08d24a9 (patch)
tree9c3af87d58ef9b116a8457aebe5536ff410e8415 /community/cpio/cast-arguments-to-printf.patch
parenta1b83606c3f4cedbb42cf7cb1fbae75b933dbbdd (diff)
downloadaports-880aa1b5c01e1e14f9295a953dbf37cbd08d24a9.tar.bz2
aports-880aa1b5c01e1e14f9295a953dbf37cbd08d24a9.tar.xz
community/cpio: add minor security fixes, fix tests
- add fixes for CVE-2016-2037, integer overflow and inconsistent argument passing to printf-like functions, all from upstream. - add autoconf to checkdepends as autom4te is required to create built-in tests from templates; - remove bash from checkdepends (as it is useless without passing CONFIG_SHELL=/bin/bash to ./configure anyway) and replace the bash-style sequence expression at tests/symlink-long.at:30 to resolve test failure; - disable NLS and make explicit other default ./configure options.
Diffstat (limited to 'community/cpio/cast-arguments-to-printf.patch')
-rw-r--r--community/cpio/cast-arguments-to-printf.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/community/cpio/cast-arguments-to-printf.patch b/community/cpio/cast-arguments-to-printf.patch
new file mode 100644
index 0000000000..f1eeabd757
--- /dev/null
+++ b/community/cpio/cast-arguments-to-printf.patch
@@ -0,0 +1,81 @@
+commit 3be097c12ec14a69b3f3df3e2138fa235a3154d7
+Author: Sergey Poznyakoff <gray@gnu.org>
+Date: Sat Dec 1 12:01:21 2018 +0200
+
+ Minor fixes
+
+ * src/copyin.c: Remove unused variable.
+ * src/util.c: Cast arguments to printf.
+
+diff --git a/src/copyin.c b/src/copyin.c
+index ba887ae..a01873d 100644
+--- a/src/copyin.c
++++ b/src/copyin.c
+@@ -844,14 +844,14 @@ from_ascii (char const *where, size_t digs, unsigned logbase)
+ char *p = strchr (codetab, toupper (*buf));
+ if (!p)
+ {
+- error (0, 0, _("Malformed number %.*s"), digs, where);
++ error (0, 0, _("Malformed number %.*s"), (int) digs, where);
+ break;
+ }
+
+ d = p - codetab;
+ if ((d >> logbase) > 1)
+ {
+- error (0, 0, _("Malformed number %.*s"), digs, where);
++ error (0, 0, _("Malformed number %.*s"), (int) digs, where);
+ break;
+ }
+ value += d;
+@@ -862,7 +862,7 @@ from_ascii (char const *where, size_t digs, unsigned logbase)
+ }
+ if (overflow)
+ error (0, 0, _("Archive value %.*s is out of range"),
+- digs, where);
++ (int) digs, where);
+ return value;
+ }
+
+diff --git a/src/util.c b/src/util.c
+index 4e49124..7303240 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -498,8 +498,9 @@ copy_files_disk_to_tape (int in_des, int out_des, off_t num_bytes,
+ filename, STRINGIFY_BIGINT (num_bytes, buf));
+ }
+ else
+- error (0, 0, _("Read error at byte %lld in file %s, padding with zeros"),
+- original_num_bytes - num_bytes, filename);
++ error (0, 0,
++ _("Read error at byte %lld in file %s, padding with zeros"),
++ (long long) (original_num_bytes - num_bytes), filename);
+ write_nuls_to_file (num_bytes, out_des, tape_buffered_write);
+ break;
+ }
+@@ -548,8 +549,9 @@ copy_files_disk_to_disk (int in_des, int out_des, off_t num_bytes,
+ filename, STRINGIFY_BIGINT (num_bytes, buf));
+ }
+ else
+- error (0, 0, _("Read error at byte %lld in file %s, padding with zeros"),
+- original_num_bytes - num_bytes, filename);
++ error (0, 0,
++ _("Read error at byte %lld in file %s, padding with zeros"),
++ (long long) (original_num_bytes - num_bytes), filename);
+ write_nuls_to_file (num_bytes, out_des, disk_buffered_write);
+ break;
+ }
+@@ -599,13 +601,11 @@ void
+ create_all_directories (char *name)
+ {
+ char *dir;
+- int mode;
+ #ifdef HPUX_CDF
+ int cdf;
+ #endif
+
+ dir = dir_name (name);
+- mode = 0700;
+ #ifdef HPUX_CDF
+ cdf = islastparentcdf (name);
+ if (cdf)