aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-10-01tydy up a few uses of recursive_action(), no logic changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-10-01gcc-9.x warning fixesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-10-01libbb: do not open-code __errno_location() callDenys Vlasenko
Thanks dalias! Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-10-01shell: remove FAST_FUNC from a static functionDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-10-01libbb: extend "errno pointer" trick to other than __GLIBC__Denys Vlasenko
Savings on musl: function old new delta resume_main 582 614 +32 lbb_prepare - 20 +20 seq_main 432 449 +17 fgetsetversion 74 88 +14 ... script_main 1207 1180 -27 close_silently 28 - -28 shell_builtin_ulimit 655 626 -29 lineedit_read_key 280 247 -33 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 25/123 up/down: 182/-882) Total: -700 bytes text data bss dec hex filename 1005858 551 5676 1012085 f7175 busybox_old 1005136 551 5680 1011367 f6ea7 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-10-01mount: support the sizelimit and offset option for loop devicesSteffen Trumtrar
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>
2020-09-30libbb: fold common64_hash() into its only userDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-09-30xargs: fix -I SUBSTR behaviourDenys Vlasenko
function old new delta process_stdin_with_replace 165 204 +39 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-09-29shell: add testsuite for "wait $pid" waiting for other tasksDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-09-29ash: jobs: Fix waitcmd busy loopDenys Vlasenko
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>
2020-09-29ash: jobs: Fix infinite loop in waitprocDenys Vlasenko
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>
2020-09-29ash: remove a tentative TODO, it's a wrong ideaDenys Vlasenko
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>
2020-09-29ntpd: fix the case where two replies received at once and first one causes a ↵Denys Vlasenko
step function old new delta recv_and_process_peer_pkt 2476 2486 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-08-16httpd: Make Deny/Allow by IP config support optionalSergey Ponomarev
When disabled: function old new delta if_ip_denied_send_HTTP_FORBIDDEN_and_exit 52 - -52 handle_incoming_and_exit 2201 2097 -104 scan_ip 170 - -170 parse_conf 1365 1065 -300 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/2 up/down: 0/-626) Total: -626 bytes Signed-off-by: Sergey Ponomarev <stokito@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-08-15httpd: Support caching via ETag headerSergey Ponomarev
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>
2020-08-15httpd: Don't add Last-Modified header to responseSergey Ponomarev
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>
2020-08-15httpd: Don't add Date header to responseSergey Ponomarev
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>
2020-08-15httpd: Update to HTTP/1.1Sergey Ponomarev
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>
2020-08-15hwclock: Fix settimeofday for glibc v2.31+Eddie James
The glibc implementation changed for settimeofday, resulting in "invalid argument" error when attempting to set both timezone and time with a single call. Fix this by calling settimeofday twice Signed-off-by: Eddie James <eajames@linux.ibm.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-08-15grep: for -L, exitcode 0 means files *without* matches were found, closes 13151Denys Vlasenko
This is a recent change in GNU grep as well (after 3.1) function old new delta grep_file 1215 1228 +13 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-08-13build system: drop PLATFORM_LINUXRon Yorston
PLATFORM_LINUX is a hidden configuration option which is disabled by default and enabled at over a hundred locations for features that are deemed to be Linux specific. The only effect of PLATFORM_LINUX is to control compilation of libbb/match_fstype.c. This file is only needed by mount and umount. Remove all references to PLATFORM_LINUX and compile match_fstype.c if mount or umount is enabled. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-08-13udhcpc: add support for long optionsMartin Lewis
Duplicate options are currently overridden (only the last option is kept). This leads to unexpected behavior when using long options. The patch adds support for long options in compliance with RFC 3396. Fixes #13136. function old new delta udhcp_run_script 601 725 +124 optitem_unset_env_and_free - 38 +38 putenvp 46 59 +13 static.xmalloc_optname_optval 718 717 -1 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/1 up/down: 175/-1) Total: 174 bytes Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-31ip address: Add support for "valid_lft" and "preferred_lft" optionsChristian Eggers
Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-31ip: Add support for "noprefixroute" optionChristian Eggers
The "noprefixroute" option suppresses automatic generation of a routing table entry based on the interface's ip address. The ifa_flags field has only 8 bit. If higher bits are set, rta_tb[IFA_FLAGS] has to be used instead. Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-31shell: Fix "read -d ''" behaviorChristian Eggers
With bash's read builtin it is possible to read from a file (e.g. device-tree) until the first '\0' character: IFS= read -r -d '' VARIABLE < file In busybox ash the -d extension is also implemented, but checking the read character for '\0' has to be performed after comparing with the delimiter. Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-31httpd_indexcgi.c: use CSS for odd/even rowsSergey Ponomarev
Signed-off-by: Sergey Ponomarev <stokito@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-31httpd_indexcgi.c: minimize style CSSSergey Ponomarev
Remove new lines \n and some semicolons ;. This minimize page style size from 655 to 604 Signed-off-by: Sergey Ponomarev <stokito@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-20lsscsi: code shrinkDenys Vlasenko
function old new delta lsscsi_main 298 302 +4 get_line 56 45 -11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 4/-11) Total: -7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-20ntpd: fix refid reported in server mode, closes 13056Denys Vlasenko
function old new delta resolve_peer_hostname 129 196 +67 recv_and_process_peer_pkt 2475 2476 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 68/0) Total: 68 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-19networking: support ftp PASV responses not ending with ')'Denys Vlasenko
Patch by Baruch Burstein <bmburstein@gmail.com> function old new delta parse_pasv_epsv 153 181 +28 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-19libbb: shrink last_char_is(), no longer allow NULL string argumentDenys Vlasenko
function old new delta last_char_is 40 28 -12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-12domain_codec: optimize dname_dec and convert_dnameMartin Lewis
dname_dec: now iterates over the packet only once. convert_dname: remove redundant checks and code shrink. While testing I've noticed that some of the tests didn't compile properly, so I fixed them. function old new delta dname_dec 286 267 -19 dname_enc 166 143 -23 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-42) Total: -42 bytes Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-07-11crontab: Fix -e with editors saving using renaming strategyGray Wolf
Some editors (like vim) use renaming strategy to save file. That means they save a file to some random name and then rename it to final location. The advantage is that such save is atomic. However, crontab -e holds open fd to the temporary file, meaning it never sees the changes. The temporary file needs to be re-opened after the editor terminates for the changes to properly save. Fixes #12491 Signed-off-by: Gray Wolf <wolf@wolfsden.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-30libbb: code shrink in last_char_is()Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29compare_string_array: code shrinkMartin Lewis
Code shrink and prevention of possible out of bounds access. function old new delta nth_string 36 26 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-10) Total: -10 bytes text data bss dec hex filename 981342 16915 1872 1000129 f42c1 busybox_old 981332 16915 1872 1000119 f42b7 busybox_unstripped Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29procps: code shrinkMartin Lewis
function old new delta skip_whitespace_if_prefixed_with - 17 +17 procps_read_smaps 911 854 -57 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 17/-57) Total: -40 bytes Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29udhcpc: fix a TODO in fill_envp using option scannerMartin Lewis
fill_envp now iterates over the packet only once instead of a few hundred times using the new option scanner. function old new delta udhcp_scan_options - 189 +189 putenvp - 46 +46 init_scan_state - 22 +22 udhcp_get_option 227 104 -123 udhcp_run_script 835 601 -234 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 0/2 up/down: 257/-357) Total: -100 bytes Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29udhcp: add option scannerMartin Lewis
Added an option scanner to udhcp to enable iteration over packet options. Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29wget: fix openssl options for cert verificationScott Court
function old new delta is_ip_address - 54 +54 spawn_https_helper_openssl 461 486 +25 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 79/0) Total: 79 bytes Signed-off-by: Scott Court <z5t1@z5t1.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29acpid: only display -p if supported in usageNorbert Lange
Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29dhcpd: remove hardcoded pidfile pathNorbert Lange
Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29dpkg: prevent important directories from being removedNorbert Lange
busybox will remove directory symlinks, which is at odds with common layouts that have some of bin/lib/lib32/lib64 symlinked. this adds a exludelist for critcal and often symlinked directories. Fixes: Bug 12551 function old new delta remove_file_array 139 231 +92 Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-29nc_bloaty: support udp broadcast portsNorbert Lange
Add a -b option, identical to debians "traditional" netcat. This allows sending (subnet) UDP Broadcasts. function old new delta packed_usage 33420 33441 +21 nc_main 1041 1057 +16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 37/0) Total: 37 bytes Signed-off-by: Norbert Lange <nolange79@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-26Start 1.33.0 development cycleDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-26Bump version to 1.32.0Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-25gzip -d with zcat enabled but gunzip disabled was misbehavingDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-24make_single_applets.sh: switch off nologin deps optionDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-24bc: placate a "defined but not used" warningDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-24nologin: make it possible to build it as single appletDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2020-06-24suppress a few compile warningsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>