aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* shells: a fix for systems without RLIMIT_NICEGravatar Denys Vlasenko2020-12-171-3/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fixes for Hurd buildGravatar Denys Vlasenko2020-12-172-0/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: do not compile selinux_or_die() if !SELINUXGravatar Denys Vlasenko2020-12-161-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: make -static-libgcc selectable in configGravatar Denys Vlasenko2020-12-162-1/+10
| | | | | | OpenWrt wants this off. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use xsettimeofday()Gravatar Denys Vlasenko2020-12-166-22/+26
| | | | | | | | | | | | | | | function old new delta xsettimeofday - 25 +25 rdate_main 274 260 -14 step_time 348 331 -17 set_kernel_timezone_and_clock 119 102 -17 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 25/-48) Total: -23 bytes text data bss dec hex filename 1020753 559 5052 1026364 fa93c busybox_old 1020708 559 5052 1026319 fa90f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hwclock: improve --help (-l is a compatible shortcut for --localtime)Gravatar Denys Vlasenko2020-12-161-19/+50
| | | | | | | function old new delta packed_usage 33605 33568 -37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hwclock: fix musl breakage of settimeofday(tz)Gravatar Denys Vlasenko2020-12-161-53/+75
| | | | | | | | | | | function old new delta set_kernel_timezone_and_clock - 119 +119 set_kernel_tz - 28 +28 hwclock_main 480 301 -179 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/1 up/down: 147/-179) Total: -32 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: disable completion and fancy prompts if no shells are selectedGravatar Denys Vlasenko2020-12-161-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta get_previous_history 51 56 +5 get_next_history 47 52 +5 null_str 1 - -1 beep 10 - -10 bb_msg_unknown 10 - -10 bb_internal_setpwent 24 - -24 remove_chunk 30 - -30 goto_new_line 33 - -33 bb_internal_endpwent 36 - -36 deinit_S 51 - -51 free_tab_completion_data 54 - -54 read_line_input 3171 3114 -57 rewind 68 - -68 add_match 70 - -70 complete_username 77 - -77 quote_special_chars 78 - -78 build_match_prefix 557 - -557 complete_cmd_dir_file 697 - -697 parse_and_put_prompt 823 53 -770 input_tab 926 - -926 ------------------------------------------------------------------------------ (add/remove: 0/17 grow/shrink: 2/2 up/down: 10/-3549) Total: -3539 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: use strncmp instead of is_prefixed_with (we know the length)Gravatar Denys Vlasenko2020-12-161-22/+25
| | | | | | Also: add comments, rename some variables Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: remove ->path_lookup if ash is not configuredGravatar Denys Vlasenko2020-12-162-5/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: match local directories when searching PATHGravatar Ron Yorston2020-12-161-1/+8
| | | | | | | | | | | | | | | When tab-completing a command we search PATH if the partial text doesn't include a slash. Also match subdirectories of the current directory, in case the user intends to run a binary from one of them. function old new delta complete_cmd_dir_file 894 917 +23 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 23/0) Total: 23 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: omit directories when tab-completing from PATHGravatar Ron Yorston2020-12-161-0/+3
| | | | | | | | | | | | Only files should be matched when using PATH for tab-completion. function old new delta complete_cmd_dir_file 883 894 +11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 11/0) Total: 11 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tweak help textsGravatar Denys Vlasenko2020-12-165-39/+16
| | | | | | | function old new delta packed_usage 33650 33605 -45 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ntpd: allow non-root to run it (e.g. with -w option)Gravatar Denys Vlasenko2020-12-151-3/+0
| | | | | | | | | | | | This is safe: it's not a setuid applet, the attempt to set time will simply fail if attempted by non-root From openwrt 600-allow-ntpd-non-root.patch function old new delta ntp_init 1049 1005 -44 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: make pw_encrypt() die if supplied salt is bad (e.g. emply)Gravatar Denys Vlasenko2020-12-152-17/+19
| | | | | | | | | | | | Fished from 520-loginutils-handle-crypt-failures.patch in openwrt function old new delta pw_encrypt 913 927 +14 des_crypt 1327 1318 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 14/-9) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc6: code shrink - sending functions do not need ifindex parameterGravatar Denys Vlasenko2020-12-153-25/+19
| | | | | | | | | | | | | | | function old new delta d6_send_raw_packet_from_client_data_ifindex - 427 +427 d6_send_kernel_packet_from_client_data_ifindex - 275 +275 send_d6_renew 182 176 -6 perform_d6_release 246 240 -6 d6_mcast_from_client_data_ifindex 45 39 -6 d6_send_kernel_packet 274 - -274 d6_send_raw_packet 429 - -429 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 0/3 up/down: 702/-721) Total: -19 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcp: bind to device even for ucast packetsGravatar Michal Kazior2020-12-154-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases where binding to source IP and destination IP is insufficient to guarantee sane xmit netdev. One case where this can fail is when route-matching netdev carrier is down (cable unplugged, wifi disconnected), or the netdev is admin down. Then all the IP based bindings (bind() + connect()) will seemingly succeed but the actual packet can go out through a default gw path. Depending on the network this happens on it can create issues or false alarms. It can also leak some subnet info across networks that shouldn't be routed. As such better be safe than sorry and bind to a netdev to be sure it's used for xmit. function old new delta udhcp_send_kernel_packet 293 336 +43 send_packet 182 188 +6 bcast_or_ucast 37 43 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 55/0) Total: 55 bytes Signed-off-by: Michal Kazior <michal@plume.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: enable fixed 4k pagesize for 32bit ARMGravatar Denys Vlasenko2020-12-151-0/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tls: code shrink in AES codeGravatar Denys Vlasenko2020-12-151-3/+3
| | | | | | | function old new delta aes_cbc_decrypt 862 847 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: combat gcc zealotry in data alignment, now for x86_64 tooGravatar Denys Vlasenko2020-12-151-0/+11
| | | | | | | function old new delta .rodata 182928 182620 -308 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dd: support for O_DIRECT i/oGravatar Denys Vlasenko2020-12-141-31/+80
| | | | | | | | | | | | | | | | | Based on patch by Akash Hadke <hadkeakash4@gmail.com> function old new delta dd_read - 66 +66 clear_O_DIRECT - 55 +55 write_and_stats 102 135 +33 dd_main 1578 1601 +23 static.oflag_words 19 26 +7 static.iflag_words 22 29 +7 packed_usage 33665 33668 +3 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 5/0 up/down: 194/0) Total: 194 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: add and use infrastructure for fixed page size optimizationGravatar Denys Vlasenko2020-12-147-20/+37
| | | | | | | | | | | | | | | function old new delta procps_scan 1121 1118 -3 getpagesize 6 - -6 rpm_main 1037 1027 -10 rpm2cpio_main 120 110 -10 ptok 38 21 -17 time_main 1282 1261 -21 mkswap_main 317 278 -39 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/6 up/down: 0/-106) Total: -106 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: create and use mmap() helpersGravatar Denys Vlasenko2020-12-146-12/+28
| | | | | | | | | | | | | | function old new delta mmap_anon - 22 +22 mmap_read - 21 +21 xmmap_anon - 16 +16 rpm_gettags 465 447 -18 bb_full_fd_action 498 480 -18 uevent_main 337 310 -27 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 0/3 up/down: 59/-63) Total: -4 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: combat gcc zealotry in data alignmentGravatar Denys Vlasenko2020-12-141-0/+8
| | | | | | | | text data bss dec hex filename 1020934 559 5052 1026545 fa9f1 busybox_old 1020750 559 5052 1026361 fa939 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: code shrinkGravatar Denys Vlasenko2020-12-141-1/+1
| | | | | | | | | | | | | function old new delta run_applet_main - 20 +20 builtin_kill 296 288 -8 builtin_test 19 10 -9 builtin_printf 19 10 -9 builtin_echo 19 10 -9 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/4 up/down: 20/-35) Total: -15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* help text: replace [OPTIONS] with actual options (if not too long)Gravatar Denys Vlasenko2020-12-1314-33/+17
| | | | | | | function old new delta packed_usage 33620 33665 +45 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: if login shell, also source ~/.profileGravatar Denys Vlasenko2020-12-131-8/+16
| | | | | | | function old new delta hush_main 1101 1151 +50 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* examples: remove /sbin/ prefixes, system should be configured with $PATH to ↵Gravatar Denys Vlasenko2020-12-134-10/+10
| | | | | | find utilities Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* more --help text tweaksGravatar Denys Vlasenko2020-12-134-6/+5
| | | | | | | function old new delta packed_usage 33545 33581 +36 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* help text tweaksGravatar Denys Vlasenko2020-12-1310-10/+10
| | | | | | | function old new delta packed_usage 33547 33545 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: NOMMU fix for hush-psubst/tick6.testsGravatar Denys Vlasenko2020-12-131-0/+7
| | | | | | | function old new delta hush_main 1759 1766 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: fix -c SCRIPT handlingGravatar Denys Vlasenko2020-12-131-51/+63
| | | | | | | function old new delta hush_main 1763 1759 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: reset SIGHUP earlier: allows HUP traps in .profile, closes 13371Gravatar Denys Vlasenko2020-12-131-8/+11
| | | | | | | function old new delta ash_main 1188 1203 +15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: code shrinkGravatar Denys Vlasenko2020-12-131-10/+11
| | | | | | | | | | | function old new delta hexdump_if_verbose - 255 +255 common_traceroute_main 1668 1644 -24 hexdump 239 - -239 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/1 up/down: 255/-263) Total: -8 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: even with -v, don't show other ping processes reply'sGravatar Denys Vlasenko2020-12-132-2/+21
| | | | | | | | | | | function old new delta traceroute_init 1135 1151 +16 common_ping_main 1919 1935 +16 common_traceroute_main 1715 1668 -47 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 32/-47) Total: -15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: simpler hexdump()Gravatar Denys Vlasenko2020-12-131-9/+5
| | | | | | | function old new delta hexdump 270 239 -31 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: make "ipv4 or ipv6?" cheaper to find outGravatar Denys Vlasenko2020-12-131-15/+21
| | | | | | | | | | | function old new delta traceroute_init 1131 1135 +4 hexdump 274 270 -4 common_traceroute_main 1730 1715 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 4/-19) Total: -15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: don't set SO_DONTROUTE on recv socket, it only affects sendGravatar Denys Vlasenko2020-12-131-3/+0
| | | | | | | function old new delta traceroute_init 1147 1131 -16 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: untangle main loopGravatar Denys Vlasenko2020-12-121-112/+106
| | | | | | | function old new delta common_traceroute_main 1785 1730 -55 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: commonalize verbose printingGravatar Denys Vlasenko2020-12-121-83/+62
| | | | | | | | | | | | function old new delta hexdump - 274 +274 traceroute_init 1172 1147 -25 pr_type 79 - -79 common_traceroute_main 2091 1785 -306 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/2 up/down: 274/-410) Total: -136 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: set IP_PKTINFO to see correct local IP of received pkt (fixes -v ↵Gravatar Denys Vlasenko2020-12-121-64/+41
| | | | | | | | | | | | | | display) Also, assorted code shrink: function old new delta traceroute_init 1210 1172 -38 common_traceroute_main 2141 2091 -50 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-88) Total: -88 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: code shrinkGravatar Denys Vlasenko2020-12-121-30/+40
| | | | | | | | | | | | Move init code to a separate function. function old new delta traceroute_init - 1203 +1203 common_traceroute_main 3391 2141 -1250 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 1203/-1250) Total: -47 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: code shrinkGravatar Denys Vlasenko2020-12-121-49/+35
| | | | | | | | | Do not pass "from" and "to" addresses as parameters, keep them in globals function old new delta common_traceroute_main 3426 3391 -35 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: code shrinkGravatar Denys Vlasenko2020-12-121-49/+58
| | | | | | | | | Do not byteswap ident (why we were doing it?) function old new delta common_traceroute_main 3544 3426 -118 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* traceroute: fix traceroute6 -I (icmp mode)Gravatar Denys Vlasenko2020-12-121-71/+135
| | | | | | | function old new delta common_traceroute_main 3530 3544 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nsenter: stop option parsing on 1st non-optionGravatar Denys Vlasenko2020-12-122-2/+3
| | | | | | "nsenter ls -l" gives: invalid option -- 'l' Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: make msleep() result in only one syscall instead of loopingGravatar Denys Vlasenko2020-12-113-4/+21
| | | | | | | function old new delta msleep 45 52 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mount: fix incorrect "success" exitcode if loop device setup failsGravatar Denys Vlasenko2020-12-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | When mounting, in parallel, multiple loop devices (squashfs for the submitter's case), the following behavior can be observed: stat64(/path/to/image, {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0 openat(AT_FDCWD, /path/to/image, O_RDWR|O_LARGEFILE) = 3 openat(AT_FDCWD, /dev/loop-control, O_RDWR|O_LARGEFILE|O_CLOEXEC) = 4 ioctl(4, LOOP_CTL_GET_FREE) = 12 close(4) = 0 openat(AT_FDCWD, /dev/loop12, O_RDWR|O_LARGEFILE) = 4 ioctl(4, LOOP_GET_STATUS64, {lo_offset=0, lo_number=12, lo_flags=LO_FLAGS_AUTOCLEAR, lo_file_name=/path/to/image, ...}) = 0 close(4) = 0 close(3) = 0 write(2, "mount: can't setup loop device\n", 31mount: can't setup loop device ) = 31 exit_group(0) = ? +++ exited with 0 +++ The ioctl LOOP_CTL_GET_FREE has resulted in the same result for a competing mount process. The subsequent ioctl LOOP_GET_STATUS64 fails, having succeeded for the competing mount process. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* wget: do not ftruncate if -O- is used, closes 13351Gravatar Denys Vlasenko2020-12-081-3/+10
| | | | | | | | | | function old new delta wget_main 2558 2571 +13 retrieve_file_data 612 621 +9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 22/0) Total: 22 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mkdtemp: proper error detection on mktempGravatar Xabier Oneca2020-12-081-1/+2
| | | | | | | On error, mktemp returns an empty string, not NULL. Signed-off-by: Xabier Oneca <xoneca@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>