The socket receive buffer turned out to be too small for real world
systems. Use the same size as udevd to be on the safe side. As this is
just a limit and the memory is not allocated by the kernel until really
needed there is actually no memory wasted.
Signed-off-by: Jan Klötzke <jan@kloetzke.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
As soon as the socket is bound it will receive messages. Make sure the
recieve buffer size is increased before the first message is received.
Signed-off-by: Jan Klötzke <jan@kloetzke.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Avoid using same include file naming pattern as available in GLIBC.
Renamed to match grp_.h et al.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Based on patch by Joachim Nilsson <troglobit@gmail.com>
function old new delta
pgetc 570 547 -23
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This patch moves the creation of the PID file until after syslogd has
set up signal handlers and is ready.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
/bin/login updates the preliminary UTMP record created by /bin/getty for
$LOGNAME. However, if the PID of login is not the same as getty, then
it will create a new entry. This causes GLIBC getlogin(3) to return the
string 'LOGIN' (set by getty) instead of $LOGNAME. This affects tools
like /usr/bin/logname but also various 3rd party PAM applications.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This significantly syncronises ash-signals and hush-signals tests.
function old new delta
process_wait_result 449 450 +1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Use decode_base64() from uuencode.c when uudecode/base64 applets are included.
That function is bigger than httpd's decodeBase64(), so we use the old one when
those applets are disabled. Bloat-o-meter when one of those is enabled:
function old new delta
handle_incoming_and_exit 2371 2265 -106
Signed-off-by: Xabier Oneca <xoneca@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This adds support for fwmark/fwmask in ip rule which is needed, for example, in
OpenWrt's mwan3. Masks are supported since Linux 2.6.19.
Fixes: https://bugs.busybox.net/show_bug.cgi?id=11621
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
"error: taking address of packed member of 'struct ip_udp_dhcp_packet'
may result in an unaligned pointer value" here:
udhcp_dump_packet(&packet.data);
and in other places.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Starting with linux kernel v5.4 squashfs has a more strict parameter
checking implemented. Unlike util-linux mount, busybox never supported
the sizelimit option but simply forwards it to the kernel.
Since v5.4 mounting will fail with
squashfs: Unknown parameter 'sizelimit'
Support the sizelimit parameter by setting it in the LOOP_SET_STATUS64
structure before handing it to the kernel.
While at it also add support for the offset option, which currently will
always be set to 0.
function old new delta
cut_out_ull_opt - 167 +167
singlemount 1230 1266 +36
set_loop 834 862 +28
losetup_main 479 483 +4
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/0 up/down: 235/0) Total: 235 bytes
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Upstream commit:
Date: Tue, 2 Jun 2020 23:46:48 +1000
jobs: Fix waitcmd busy loop
We need to clear gotsigchld in waitproc because it is used as
a loop conditional for the waitcmd case. Without it waitcmd
may busy loop after a SIGCHLD.
This patch also changes gotsigchld into a volatile sig_atomic_t
to prevent compilers from optimising its accesses away.
Fixes: 6c691b3e5099 ("jobs: Only clear gotsigchld when waiting...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This change also incorporates other changes to bring us closer to upstream.
function old new delta
dowait 553 636 +83
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Upstream commit:
Date: Fri, 10 Apr 2020 21:03:09 +1000
jobs: Fix infinite loop in waitproc
After we changed the resetting of gotsigchld so that it is only
done if jp is NULL, we can now get an infinite loop in waitproc
if gotsigchld is set but there is no outstanding child because
everything had been waited for previously without gotsigchld being
zeroed.
This patch fixes it by always zeroing gotsigchld as we did before.
The bug that the previous patch was trying to fix is now resolved
by switching the blocking mode to DOWAIT_NORMAL after the specified
job has been completed so that we really do wait for all outstanding
dead children.
Reported-by: Harald van Dijk <harald@gigawatt.nl>
Fixes: 6c691b3e5099 ("jobs: Only clear gotsigchld when waiting...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
function old new delta
dowait 553 631 +78
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Upstream tried it, and then reverted by:
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 26 May 2020 23:19:05 +1000
parser: Fix double-backslash nl in old-style command sub
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
If server responds with ETag then next time client can resend it via If-None-Match header.
Then httpd will check if file wasn't modified and if not return 304 Not Modified status code.
The ETag value is constructed from file's last modification date in unix epoch and it's size:
"hex(last_mod)-hex(file_size)" e.g. "5e132e20-417" (with quotes).
That means that it's not completely reliable as hash functions but fair enough.
The same form of ETag is used by Nginx so load balancing of static content is safe.
function old new delta
handle_incoming_and_exit 2135 2201 +66
http_response 88 96 +8
send_headers 676 683 +7
parse_conf 1362 1365 +3
http_response_type 22 24 +2
send_file_and_exit 847 841 -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 5/1 up/down: 86/-6) Total: 80 bytes
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
The Last-Modified header is used for caching.
The client (browser) will send back the received date to server via If-Modified-Since request header.
But both headers MUST be an RFC 1123 formatted string.
And the formatting consumes resources on request parsing and response generation.
Instead we can use ETag header.
This simplifies logic and the only downside is that in JavaScript the document.lastModified will return null.
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
RFC 2616 sec. 14.18 says that server MUST send Date header.
But in fact the header make sense only for Cache-Control and can be omitted.
In the same time the Date eats power, CPU and network resources which are critical for embedded systems.
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
HTTP v1.1 was released in 1999 year and it's time to update BB HTTPD.
Browsers may behave badly with HTTP/1.0
E.g. Chrome does not send the If-None-Match header with ETag.
Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>