summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-06-05svlogd: if processor's stdin can not be opened, do not try ad infinitumDenys Vlasenko
function old new delta processorstart 426 423 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-05ls: trim --help textDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-05libbb: correct the name of is_TERM_dumb()Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-04ls: don't output any colors with TERM=dumbSören Tempel
The TERM variable is usually set to "dumb" to indicate that the terminal does not support any ANSI escape sequences. Presently, ls does not honor this variable and outputs colors anyhow which results in unreadable output, unless the user explicitly disables colors using `ls --color=never`. The rational behind this change is that ls should "just work" by default, even on dumb terminals. For this reason, this patch adds a check which additionally consults the TERM variable before printing any colors. This is analogous to the existing check for ensuring that standard output is a tty. As such, colors can still be forced with `--color=force`, even if TERM is set to dumb. function old new delta is_TERM_dumb - 40 +40 ls_main 579 598 +19 .rodata 103246 103251 +5 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 64/0) Total: 64 bytes Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-03udhcpd: don't hardcode treating .0 and .255 speciallySeth David Schoen
Even following current Internet standards, it can be perfectly legitimate to issue IPv4 addresses that end in .0 or .255 via DHCP -- this can happen whenever the network is larger than /8. For example, 10.3.4.0 and 10.3.4.255 are legitimate host addresses in 10/8 or 10.3/16. (We also want to be able to issue .0 addresses in smaller networks following our proposed kernel patch and standards changes.) This behavior is already fully controllable by the user, simply by setting start_ip and end_ip correctly. Users who don't want to issue .0 or .255 should set start_ip greater than .0 or end_ip less than .255 and udhcpd will already respect these bounds. (This is also the case for other DHCP servers -- the recommended example configurations will default to a lower bound starting with .1 or some other value, which is typically appropriate, but the user is still allowed to change this to .0 -- or to a range that overlaps a .0 or .255 address -- if so desired.) Signed-off-by: Seth David Schoen <schoen@loyalty.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-03cpio: fix "cpio -d -p A/B/C"Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-03nslookup: mention QUERY_TYPE SRVPaul Spooren
SRV lookups are supported since "6b4960155 nslookup: implement support for SRV records" and should therefore be mentioned as a possible QUERY_TYPE in the help message. Signed-off-by: Paul Spooren <mail@aparcar.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-03udhcpc[6]: on SIGUSR1, do not go from rebind to renew stateDenys Vlasenko
function old new delta udhcpc6_main 2628 2636 +8 udhcpc_main 2556 2563 +7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 15/0) Total: 15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-03udhcpc: code shrink, rename functions, no logic changesDenys Vlasenko
function old new delta d4_run_script - 739 +739 d4_recv_raw_packet - 484 +484 d4_run_script_deconfig - 12 +12 perform_release 207 200 -7 udhcpc_main 2598 2556 -42 udhcp_recv_raw_packet 484 - -484 udhcp_run_script 739 - -739 ------------------------------------------------------------------------------ (add/remove: 3/2 grow/shrink: 0/2 up/down: 1235/-1272) Total: -37 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-03examples/udhcp/udhcpd.conf: updateDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-03udhcp: shrink arpping()Denys Vlasenko
function old new delta .rodata 103249 103246 -3 arpping 437 420 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-20) Total: -20 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-03udhcp: convert log1s() macro to functionDenys Vlasenko
function old new delta log1s - 15 +15 udhcp_recv_kernel_packet 134 125 -9 d6_recv_kernel_packet 118 109 -9 change_listen_mode 280 271 -9 send_packet 162 141 -21 udhcpc_main 2625 2598 -27 udhcpc6_main 2655 2628 -27 d6_recv_raw_packet 255 216 -39 udhcp_recv_raw_packet 562 484 -78 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/8 up/down: 15/-219) Total: -204 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-03udhcpc[6]: when renewing, send 1 packet (not 3), on failure go back to BOUNDDenys Vlasenko
This restores old behavior where we slept for 1/2 of lease, then tried renewing, thel slept for 1/4 and tried again, etc. But now we will NOT be listening to all packets for 1/2 of lease time, processing (rejecting) everyone else's DHCP traffic. We'll go back to bound state, where we have no listening socket at all. function old new delta udhcpc6_main 2600 2655 +55 udhcpc_main 2608 2625 +17 .rodata 103250 103249 -1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 72/-1) Total: 71 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02udhcpc[6]: remove superfluous "created raw socket" log messageDenys Vlasenko
function old new delta change_listen_mode 299 280 -19 .rodata 103272 103250 -22 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-41) Total: -41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02udhcpc: improve logs - show offer as it is receivedDenys Vlasenko
function old new delta udhcpc_main 2566 2608 +42 .rodata 103248 103272 +24 udhcp_recv_raw_packet 559 562 +3 d6_recv_raw_packet 254 255 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 70/0) Total: 70 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02udhcpc[6]: close listening socket more eagerly (e.g. across script runs)Denys Vlasenko
function old new delta udhcpc6_main 2571 2600 +29 udhcpc_main 2588 2566 -22 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 29/-22) Total: 7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02udhcpc: get rid of client_data.fqdn fieldDenys Vlasenko
function old new delta attach_option 253 276 +23 udhcpc_main 2582 2588 +6 udhcpc6_main 2579 2571 -8 add_client_options 175 158 -17 udhcp_insert_new_option 169 138 -31 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/3 up/down: 29/-56) Total: -27 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02udhcpc: remove deprecated -H/-h HOSTNAME options (9 years), deprecate -V VENDORDenys Vlasenko
function old new delta udhcpc_main 2563 2582 +19 dhcp_option_strings 294 301 +7 dhcp_optflags 80 82 +2 .rodata 103250 103248 -2 udhcpc_longopts 252 241 -11 add_client_options 209 175 -34 alloc_dhcp_option 59 - -59 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 3/3 up/down: 28/-106) Total: -78 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02udhcpc: include client-id option in DECLINEs, even if it's a custom -x ↵Denys Vlasenko
61:HEX option client_data.vendorclass, .hostname and .fqdn probably need the same treatment: just insert them into the list of -x opts, get rid of if (client_data.vendorclass) udhcp_add_binary_option(packet, client_data.vendorclass); if (client_data.hostname) udhcp_add_binary_option(packet, client_data.hostname); if (client_data.fqdn) udhcp_add_binary_option(packet, client_data.fqdn); function old new delta udhcp_insert_new_option - 166 +166 perform_release 171 207 +36 perform_d6_release 227 259 +32 udhcpc6_main 2558 2580 +22 init_d6_packet 103 84 -19 udhcpc_main 2585 2564 -21 attach_option 397 253 -144 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/3 up/down: 256/-184) Total: 72 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02vi: remove autoindent from otherwise empty linesRon Yorston
Lines that have no content apart from automatic indentation should be treated as empty when the user hits return or ESC. The implementation uses the global variable 'indentcol'. Usually this is zero. It can also be -1 to indicate an 'O' (open above) command, replacing the overloading of the tabstop option bit. A value greater than zero indicates that the current line has been autoindented to the given column (or that the autoindent has been adjusted with ctrl-D). Any other change to the line resets 'indentcol' to zero. Replace strspn() with ident_len(). The latter handles the unlikely case that it's called on the last line of a file which doesn't have a terminating newline. function old new delta char_insert 741 912 +171 indent_len - 42 +42 do_cmd 4781 4785 +4 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 217/0) Total: 217 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02vi: make autoindent respect expandtab settingRon Yorston
Autoindent took a copy of the indent from a neighbouring line, which may not have respected the expandtab setting. Determine the target column and construct a suitable indent. This will consist entirely of spaces if expandtab is enabled or an efficient combination of tabs and spaces otherwise. function old new delta char_insert 719 741 +22 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 22/0) Total: 22 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02vi: make cursor positioning more vi compatibleRon Yorston
Commit 24effc7a3 (vi: cursor positioning after whole-line 'y') tried to save a few bytes by treating whole-line deletion the same as whole-line yank. If the deletion removed the last lines of the file the cursor was left beyond the end of the file. Revert the part of the commit related to whole-line deletion. Position the cursor on the first non-whitespace character of the line when whole lines are 'put'. function old new delta do_cmd 4759 4781 +22 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 22/0) Total: 22 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02tail: do not lose the tail of old file if new file (-F) is detectedDenys Vlasenko
function old new delta tail_main 1619 1645 +26 .rodata 103246 103250 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 30/0) Total: 30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02tail: fix typo in variable nameDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-02head,tail: trim --help textDenys Vlasenko
function old new delta packed_usage 33598 33560 -38 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-06-01udhcpc[6]: fix "untangle timeout and remaining lease" falloutDenys Vlasenko
As reported in bug 13776, before this fix the renew never times out. function old new delta udhcpc_main 2541 2585 +44 udhcpc6_main 2567 2558 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 44/-9) Total: 35 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-07login: permit change expired password wit PAMMario Abajo
Signed-off-by: Mario Abajo <marioabajo@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-05httpd: add comment about faster rejection of denied IPsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-05httpd: if no request was given at all, close the socket without generating ↵Denys Vlasenko
error page For one, an attacker can try to overload us by just opening and immediately closing tons of connections - reduce our work to the minimum for this case. function old new delta handle_incoming_and_exit 2172 2200 +28 .rodata 103225 103246 +21 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 49/0) Total: 49 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-05httpd: no need to strcpy() when we only need to copy one byteDenys Vlasenko
function old new delta handle_incoming_and_exit 2161 2172 +11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-04httpd: avoid extra stat() calls for "GET /dirname/" caseDenys Vlasenko
function old new delta parse_conf 1325 1332 +7 handle_incoming_and_exit 2173 2161 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 7/-12) Total: -5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-04httpd: avoid one stat() call for "GET /dirname" caseDenys Vlasenko
function old new delta handle_incoming_and_exit 2172 2173 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-04httpd: support HEAD requests even in !CGI configDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-04httpd: move proxy check before URL duplication and request type checkDenys Vlasenko
This makes proxy work for any type of requests. function old new delta handle_incoming_and_exit 2240 2172 -68 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-04httpd: cgi-bin support for DELETE, PUT, OPTIONS etc methodsAlexander Sack
function old new delta handle_incoming_and_exit 2217 2240 +23 static.request_POST - 5 +5 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 28/0) Total: 28 bytes Signed-off-by: Alexander Sack <asac@pantacor.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-04vi: :wq/:x should warn if there are more files to editRon Yorston
':wq' or ':x' should issue a warning if there are more files to edit, unless they're followed by '!'. function old new delta colon 3911 3960 +49 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 49/0) Total: 49 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-04vi: cursor positioning after whole-line 'y'Ron Yorston
The 'y' command to yank text should leave the cursor at the start of the range. This mostly works correctly in BusyBox vi but not for whole-line yanks with backward motion, e.g. '2yk' to yank two lines backwards. In this case the cursor is left at the end of the range. Fix this by returning the actual range from find_range(). Cursor positioning following whole-line deletion is inconsistent between vim and traditional vi. For BusyBox vi chose the option that uses least code without being exactly compatible with either. Also, find_range() preserved the value of 'dot', the current cursor position. Since this isn't used by either caller of find_range() we can save a few bytes by not bothering. function old new delta do_cmd 4730 4759 +29 find_range 749 686 -63 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 29/-63) Total: -34 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-03decompress_gunzip: simplify ERR_RET bit clearingDenys Vlasenko
My gcc is in fact clever enough to do it itself, but let's be explicit Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-01vi: trivial code shrinkDenys Vlasenko
function old new delta get_input_line 178 176 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-01udhcpc[6]: fold perform_renew() into its only callerDenys Vlasenko
function old new delta udhcpc_main 2550 2541 -9 udhcpc6_main 2576 2567 -9 change_listen_mode 321 299 -22 .rodata 103294 103225 -69 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-109) Total: -109 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-05-01udhcpc[6]: untangle "timeout" and "remaining lease"; reduce min lease to 30 ↵Denys Vlasenko
seconds This allows to fix a problem that we wait for renew replies for up to half the lease (!!!) if they never come. Make it so that lease of 60 seconds is not "rounded up" to 120 seconds - set lower "sanity limit" to 30 seconds. After 3 failed renew attempts, switch to rebind. After this change, we can have more flexible choice of when to do the first renew - does not need to be equal to lease / 2. function old new delta udhcpc6_main 2568 2576 +8 .rodata 103339 103294 -45 udhcpc_main 2609 2550 -59 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 8/-104) Total: -96 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-30wget: allow HTTP 307/308 redirectsJeremy Lin
This resolves failures like wget: server returned error: HTTP/1.1 307 Temporary Redirect Signed-off-by: Jeremy Lin <jeremy.lin@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-30vi: fix empty line range regressionRon Yorston
Commit 7a8ceb4eb (vi: changes to line addresses for colon commands) was supposed to address the issue: When the last address is empty it should refer to the current line. This was intended to allow ranges of the form '1,' with an empty last address. It should have been expressed as: When the last address is empty *and the second last isn't* it should refer to the current line. Otherwise a command like ':w' only writes the current line resulting in serious loss of data. function old new delta colon 3906 3911 +5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 5/0) Total: 5 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-28tls: code shrink in curve 25519Denys Vlasenko
function old new delta curve25519 832 849 +17 curve_x25519_compute_pubkey_and_premaster 74 71 -3 static.basepoint9 32 - -32 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 17/-35) Total: -18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-28vi: expand '%' and '#' in colon commandsRon Yorston
Track the current and alternate filenames. The placeholders '%' and '#' can be used in arguments to colon commands to represent the current and alternate filenames respectively. Backslash can be used to allow literal '%' and '#' characters to be entered. This feature is controlled by the configuration option FEATURE_VI_COLON_EXPAND. function old new delta expand_args - 198 +198 colon 3751 3927 +176 update_filename - 70 +70 init_filename - 48 +48 .rodata 105218 105239 +21 get_one_char 115 124 +9 edit_file 835 838 +3 do_cmd 4724 4727 +3 init_text_buffer 190 172 -18 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 5/1 up/down: 528/-18) Total: 510 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-28vi: fix buffer overrun; code shrinkRon Yorston
It was possible for get_input_line() to store its NUL terminator one character beyond the end of its buffer. Code shrink in colon(): - Certain colon commands can be matched exactly, as any shorter string would be matched earlier, e.g. ':wq' versus ':write'. - Command matching is now case sensitive so there's no need to check for 'N' or 'Q' suffixes. - Rewrite how commands and arguments are split. function old new delta colon 3848 3751 -97 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-97) Total: -97 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-28vi: improvements to ':read' commandRon Yorston
Improvements to ':read': - When a file is read into the current buffer the cursor should be placed on the first line read. - If invoked without supplying a filename the current filename should be used. This is similar to how ':edit' works. - The code for ':edit' included an explicit check that the current filename was non-empty. Both vim and traditional vi accept non-empty filenames, only issuing an error message when an attempt to use such a name fails. - Allow undo of a file read. function old new delta file_insert 367 382 +15 colon 3841 3848 +7 .rodata 105236 105218 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 22/-18) Total: 4 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-28vi: preserve state when switching fileRon Yorston
When a new file is opened from an existing editing session the following details should be preserved: - the last command used; - the last character searched for on a line. function old new delta edit_file 849 835 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-14) Total: -14 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-28vi: 'ZZ' should warn if there are more files to editRon Yorston
When 'ZZ' was used to save the current file and more files were available to edit BusyBox vi immediately moved on to the next file. The correct behaviour is to issue a warning. function old new delta do_cmd 4673 4724 +51 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 51/0) Total: 51 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-04-28vi: saving unnamed file in readonly modeRon Yorston
Suppose vi is started with the command 'vi -R', that is, in readonly mode with no filename. Attempting to save the file with 'ZZ' or ':w' results in the message: '(null)' is read only Skip the code which prints this if no filename was provided, thus falling through to file_write() which gives the more helpful message 'No current filename'. function old new delta colon 3867 3874 +7 do_cmd 4668 4673 +5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 12/0) Total: 12 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>