Mail archive
alpine-aports

[alpine-aports] [PATCH 3.4-stable] main/busybox: fix for xargs segfault

From: Daniel Sabogal <dsabogalcc_at_gmail.com>
Date: Sun, 23 Oct 2016 02:08:28 -0400

fixes #6374
---
Patch from upstream busybox 1.25
 main/busybox/0001-xargs-make-I-imply-r.patch | 35 ++++++++++++++++++++++++++++
 main/busybox/APKBUILD                        |  6 ++++-
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 main/busybox/0001-xargs-make-I-imply-r.patch
diff --git a/main/busybox/0001-xargs-make-I-imply-r.patch b/main/busybox/0001-xargs-make-I-imply-r.patch
new file mode 100644
index 0000000..3ae1ee0
--- /dev/null
+++ b/main/busybox/0001-xargs-make-I-imply-r.patch
_at_@ -0,0 +1,35 @@
+From 6d777b75ed322ea5ef0d1674ddfee1b5713cb04f Mon Sep 17 00:00:00 2001
+From: Aaro Koskinen <aaro.koskinen_at_iki.fi>
+Date: Sat, 24 Oct 2015 22:01:29 +0200
+Subject: [PATCH] xargs: make -I imply -r
+
+Make -I imply -r (GNU findutils seems to do the same).
+
+Fixes the following bug:
+
+        $ echo -n | xargs -I% echo %
+        Segmentation fault
+
+Signed-off-by: Aaro Koskinen <aaro.koskinen_at_iki.fi>
+Signed-off-by: Denys Vlasenko <vda.linux_at_googlemail.com>
+---
+ findutils/xargs.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/findutils/xargs.c b/findutils/xargs.c
+index 5870b8a..69f83b1 100644
+--- a/findutils/xargs.c
++++ b/findutils/xargs.c
+_at_@ -577,6 +577,9 @@ int xargs_main(int argc, char **argv)
+ 		G.argv = argv;
+ 		argc = 0;
+ 		read_args = process_stdin_with_replace;
++		/* Make -I imply -r. GNU findutils seems to do the same: */
++		/* (otherwise "echo -n | xargs -I% echo %" would SEGV) */
++		opt |= OPT_NO_EMPTY;
+ 	} else
+ #endif
+ 	{
+-- 
+2.10.1
+
diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD
index 65171d0..50e97fa 100644
--- a/main/busybox/APKBUILD
+++ b/main/busybox/APKBUILD
_at_@ -2,7 +2,7 @@
 # Maintainer: Natanael Copa <ncopa_at_alpinelinux.org>
 pkgname=busybox
 pkgver=1.24.2
-pkgrel=11
+pkgrel=12
 pkgdesc="Size optimized toolbox of many common UNIX utilities"
 url=http://busybox.net
 arch="all"
_at_@ -57,6 +57,7 @@ source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
 	0001-df-use-f_frsize-instead-of-f_bsize-for-correct-sizes.patch
 
 	0001-gzip-fix-compression-level-bug.-Closes-9131.patch
+	0001-xargs-make-I-imply-r.patch
 	0016-whois-make-it-actually-work.patch
 
 	acpid.logrotate
_at_@ -209,6 +210,7 @@ a4d1cf64fd1835a284ccc6dbc78e3ce0  0001-ash-fix-error-during-recursive-processing
 ab539a54dcd1c23eb0963e17e768fef7  0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch
 d77da40a3c1291ab82513fb59c517e38  0001-df-use-f_frsize-instead-of-f_bsize-for-correct-sizes.patch
 e8dea4f51fb8cf606e3c6a33e40fa644  0001-gzip-fix-compression-level-bug.-Closes-9131.patch
+c682706fa98b63497ce0d1bc2ea3e688  0001-xargs-make-I-imply-r.patch
 6234d8817d3c0ee9f4c01e83bf6a96c4  0016-whois-make-it-actually-work.patch
 4046b78ee6a25259954797d73b94f4bd  acpid.logrotate
 ab4a2e1385566b01002e526614dd38c2  busyboxconfig
_at_@ -247,6 +249,7 @@ f712ce190ce86084d56977e125d1561615394f3d9b840e926537868260e19d79  0001-ash-backp
 97dfec94c94f00b628a702ad81b235414af611e011bfc26c29be46c67063c101  0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch
 8dba75a5de5c808760e9439ad38b35f643a2442e9e5aca4b40b918cfc66ac255  0001-df-use-f_frsize-instead-of-f_bsize-for-correct-sizes.patch
 9ab63b013ad9edca66005c10ea58702e54b170155562baf7cb1d4a13f16196c6  0001-gzip-fix-compression-level-bug.-Closes-9131.patch
+bf1d97532af24f5a658dd41b94336c3b1fe67d842e83636c25693e65d1995790  0001-xargs-make-I-imply-r.patch
 1be53b0d1aa3c3f44bff31e092bc786259c7475de4b24dfaa71e70c50672f421  0016-whois-make-it-actually-work.patch
 f7cbeb5a5a47395ad30454ce8262abcd3e91c33ef803c2ae31a9258d7142dd48  acpid.logrotate
 a129ededc4c5ec3d0385e4da50a87e81f348ecc7541a2105dd98f0c8543a3a2f  busyboxconfig
_at_@ -285,6 +288,7 @@ c14a632f9477c13ea99b24a73c81c9c44ead8b536970acd758e739b43a6260860039674341192ce7
 6fc77e0edcbb61a64c179b0259e0634a82362ac0ca9a77f305eb75f6a89a10395e8a37cbcef925821b428c00237a0a3575af2c3ef194933f52ad55b0eb0dd6f2  0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch
 a42d4b992b3ba3b33a605d7f919c574783034b99cd046fd394c040948360daef7f9fb5717994c5326187a185ee9f357b36f405e960ab632c2f59f5b9fba402f7  0001-df-use-f_frsize-instead-of-f_bsize-for-correct-sizes.patch
 afa0aa2fee08b28b6f4a32bd761d9fd7ab6989a13651ffa9dc8a3a3c4de3c646ce0881c2abd1be96768ddb326451f2e06125e2959c42de6f339e90994461a803  0001-gzip-fix-compression-level-bug.-Closes-9131.patch
+9ab252ba22bd8be054ab7f17b458eded94e773435d451b3e53aa09416998aab46f31949079dcb53ebb386e304ebd4157f27c62d53dddefdefa428f49b8ce1f83  0001-xargs-make-I-imply-r.patch
 09cb1bf25c9442986e7d9816277e75591a2af8ba78117869c5cba35d2e189db351455137e9511cf61788864812056133fc9ec5e204f9eb18ae86c34dd8493ae8  0016-whois-make-it-actually-work.patch
 dadb4c953ebc755b88ee95c1489feb0c2d352f6e44abc716166024e6eea11ab9d10c84fad62c081775834d205cb04aa1be3c994676c88f4284495c54b9188e8b  acpid.logrotate
 580a6e15d6517641951bb1648c406cee2a82fab353552a60d37f29e5f58da664437d99d5bd313d88e260a92735c32886ffc1cad98f901bb27d1f5027fdce37d7  busyboxconfig
-- 
2.10.1
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sun Oct 23 2016 - 02:08:28 GMT