aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-01-06 08:25:22 +0200
committerTimo Teräs <timo.teras@iki.fi>2011-01-06 08:27:18 +0200
commit8ee0078586a14008b9915450dbc719051ed7d3d0 (patch)
tree5eb32bb8a6b11b943982d32d4e823030b08b949c /main/busybox
parent1e43dab33007dd7d31c32b63450edd194a23ba45 (diff)
downloadaports-8ee0078586a14008b9915450dbc719051ed7d3d0.tar.bz2
aports-8ee0078586a14008b9915450dbc719051ed7d3d0.tar.xz
main/busybox: fix disappearing crontabs bug
It's uninitialized memory use bug. The relevant parts are rewritten in busybox-1.18.x and later, so this patch applies only to the busybox-1.17.x versions. Fixes #436.
Diffstat (limited to 'main/busybox')
-rw-r--r--main/busybox/APKBUILD4
-rw-r--r--main/busybox/busybox-1.17.4-crond.patch30
2 files changed, 33 insertions, 1 deletions
diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD
index 6b0424bd1f..1b6c2d61cc 100644
--- a/main/busybox/APKBUILD
+++ b/main/busybox/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox
pkgver=1.17.4
-pkgrel=0
+pkgrel=1
pkgdesc="Size optimized toolbox of many common UNIX utilities"
url=http://busybox.net
arch="x86 x86_64"
@@ -13,6 +13,7 @@ triggers="busybox.trigger:/bin /usr/bin /sbin /usr/sbin /lib/modules/*"
source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
ifupdown-ipv6.patch
$pkgname-1.11.1-bb.patch
+ $pkgname-1.17.4-crond.patch
busyboxconfig"
_builddir="$srcdir"/$pkgname-$pkgver
@@ -72,4 +73,5 @@ static() {
md5sums="b3254232e9919007ca803d3a4fe81f3c busybox-1.17.4.tar.bz2
08af7b8b4e41f86a34a16270a8691e31 ifupdown-ipv6.patch
4c0f3b486eaa0674961b7ddcd0c60a9b busybox-1.11.1-bb.patch
+fd451b1e8e6e976c99869dc2d149ccc9 busybox-1.17.4-crond.patch
403e0b9fe99a7a18c5b9ae91283a5f9a busyboxconfig"
diff --git a/main/busybox/busybox-1.17.4-crond.patch b/main/busybox/busybox-1.17.4-crond.patch
new file mode 100644
index 0000000000..79c6b16653
--- /dev/null
+++ b/main/busybox/busybox-1.17.4-crond.patch
@@ -0,0 +1,30 @@
+diff --git a/miscutils/crond.c b/miscutils/crond.c
+index 4a3103c..7ba8bab 100644
+--- a/miscutils/crond.c
++++ b/miscutils/crond.c
+@@ -827,7 +827,7 @@ ForkJob(const char *user, CronLine *line, int mailFd,
+
+ static void RunJob(const char *user, CronLine *line)
+ {
+- char mailFile[128];
++ char mailFile[128], *mail_filename = NULL;
+ int mailFd = -1;
+
+ line->cl_Pid = 0;
+@@ -836,6 +836,7 @@ static void RunJob(const char *user, CronLine *line)
+ if (line->cl_MailTo) {
+ /* open mail file - owner root so nobody can screw with it. */
+ snprintf(mailFile, sizeof(mailFile), "%s/cron.%s.%d", TMPDIR, user, getpid());
++ mail_filename = mailFile;
+ mailFd = open(mailFile, O_CREAT | O_TRUNC | O_WRONLY | O_EXCL | O_APPEND, 0600);
+
+ if (mailFd >= 0) {
+@@ -849,7 +850,7 @@ static void RunJob(const char *user, CronLine *line)
+ }
+ }
+
+- ForkJob(user, line, mailFd, DEFAULT_SHELL, "-c", line->cl_Shell, mailFile);
++ ForkJob(user, line, mailFd, DEFAULT_SHELL, "-c", line->cl_Shell, mail_filename);
+ }
+
+ /*