Commit fbc33831 authored by Natanael Copa's avatar Natanael Copa

main/busybox: add patches from upstream

fixes #539
parent 85f87dc7
# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox pkgname=busybox
pkgver=1.18.3 pkgver=1.18.3
pkgrel=3 pkgrel=4
pkgdesc="Size optimized toolbox of many common UNIX utilities" pkgdesc="Size optimized toolbox of many common UNIX utilities"
url=http://busybox.net url=http://busybox.net
arch="all" arch="all"
...@@ -13,6 +13,8 @@ triggers="busybox.trigger:/bin /usr/bin /sbin /usr/sbin /lib/modules/*" ...@@ -13,6 +13,8 @@ triggers="busybox.trigger:/bin /usr/bin /sbin /usr/sbin /lib/modules/*"
source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2 source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
$pkgname-1.11.1-bb.patch $pkgname-1.11.1-bb.patch
busybox-uname-is-not-gnu.patch busybox-uname-is-not-gnu.patch
busybox-1.18.3-buildsys.patch
busybox-1.18.3-klogd.patch
busybox-1.18.3-wget.patch busybox-1.18.3-wget.patch
loginutils-sha512.patch loginutils-sha512.patch
busyboxconfig" busyboxconfig"
...@@ -75,6 +77,8 @@ static() { ...@@ -75,6 +77,8 @@ static() {
md5sums="660af4d44661d32b22025a66f4f78df2 busybox-1.18.3.tar.bz2 md5sums="660af4d44661d32b22025a66f4f78df2 busybox-1.18.3.tar.bz2
4c0f3b486eaa0674961b7ddcd0c60a9b busybox-1.11.1-bb.patch 4c0f3b486eaa0674961b7ddcd0c60a9b busybox-1.11.1-bb.patch
b5375210f13fd6e1ca61a565e8fabd35 busybox-uname-is-not-gnu.patch b5375210f13fd6e1ca61a565e8fabd35 busybox-uname-is-not-gnu.patch
1270a714d2ed9940f04379c97bb83cba busybox-1.18.3-buildsys.patch
f2277e7a31d04295bd9d56a98ff1535b busybox-1.18.3-klogd.patch
abe065069fed8458eedbdad48c115e1f busybox-1.18.3-wget.patch abe065069fed8458eedbdad48c115e1f busybox-1.18.3-wget.patch
d21d70d590e9e04bfc65ecb23b9d1617 loginutils-sha512.patch d21d70d590e9e04bfc65ecb23b9d1617 loginutils-sha512.patch
181310149cad8fce22aba96220cbbd38 busyboxconfig" 181310149cad8fce22aba96220cbbd38 busyboxconfig"
--- busybox-1.18.3/Config.in
+++ busybox-1.18.3-buildsys/Config.in
@@ -126,7 +126,6 @@ config FEATURE_INSTALLER
config INSTALL_NO_USR
bool "Don't use /usr"
default n
- depends on FEATURE_INSTALLER
help
Disable use of /usr. busybox --install and "make install"
will install applets only to /bin and /sbin,
--- busybox-1.18.3/sysklogd/klogd.c
+++ busybox-1.18.3-klogd/sysklogd/klogd.c
@@ -150,12 +150,41 @@ int klogd_main(int argc UNUSED_PARAM, ch
*/
klogd_open();
openlog("kernel", 0, LOG_KERN);
+ /*
+ * glibc problem: for some reason, glibc changes LOG_KERN to LOG_USER
+ * above. The logic behind this is that standard
+ * http://pubs.opengroup.org/onlinepubs/9699919799/functions/syslog.html
+ * says the following about openlog and syslog:
+ * "LOG_USER
+ * Messages generated by arbitrary processes.
+ * This is the default facility identifier if none is specified."
+ *
+ * I believe glibc misinterpreted this text as "if openlog's
+ * third parameter is 0 (=LOG_KERN), treat it as LOG_USER".
+ * Whereas it was meant to say "if *syslog* is called with facility
+ * 0 in its 1st parameter without prior call to openlog, then perform
+ * implicit openlog(LOG_USER)".
+ *
+ * As a result of this, eh, feature, standard klogd was forced
+ * to open-code its own openlog and syslog implementation (!).
+ *
+ * Note that prohibiting openlog(LOG_KERN) on libc level does not
+ * add any security: any process can open a socket to "/dev/log"
+ * and write a string "<0>Voila, a LOG_KERN + LOG_EMERG message"
+ *
+ * Google code search tells me there is no widespread use of
+ * openlog("foo", 0, 0), thus fixing glibc won't break userspace.
+ *
+ * The bug against glibc was filed:
+ * bugzilla.redhat.com/show_bug.cgi?id=547000
+ */
if (i)
klogd_setloglevel(i);
- bb_signals(BB_FATAL_SIGS, record_signo);
signal(SIGHUP, SIG_IGN);
+ /* We want klogd_read to not be restarted, thus _norestart: */
+ bb_signals_recursive_norestart(BB_FATAL_SIGS, record_signo);
syslog(LOG_NOTICE, "klogd started: %s", bb_banner);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment