aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | make: comments in macro expansions and command linesRon Yorston2022-11-012-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The POSIX specification says: There are three kinds of comments: blank lines, empty lines, and a <number-sign> ('#') and all following characters up to the first unescaped <newline> character. Most implementations don't treat '#' in a macro expansion or a command line as the start of a comment. POSIX doesn't mention either of these exceptions. Permit the exceptions as a non-POSIX extension.
* | make: fix test for .WAIT so bmake passesRon Yorston2022-11-011-1/+1
| | | | | | | | | | Use $? instead of $^ in the test for .WAIT. bmake supports .WAIT but not $^.
* | win32: remove declaration of vfork(2)Ron Yorston2022-10-311-1/+0
| | | | | | | | | | | | | | Since vfork(2) is never used in busybox-w32 there's no need to declare it. Doing so provokes clang to issue a warning. (GitHub issue #239)
* | make: different treatment for escaped NL in macro in commandRon Yorston2022-10-302-6/+37
| | | | | | | | | | | | | | Austin Group defect report 1549 has been accepted. It requires that an escaped newline inside a macro expansion in a command is replaced by a space. Other escaped newlines in commands are left in place, as before.
* | build system: fix breakage affecting MSYS2 buildRon Yorston2022-10-302-4/+4
| | | | | | | | | | | | | | | | | | | | Upstream changes to the embedded_scripts and mkconfigs scripts resulted in busybox-w32 failing to build with MSYS2. bzip2 in MSYS2 detects stdout redirected to /dev/null as a terminal and returns a non-zero exit status. Since the test is only for the existence of bzip2, not its functionality, even an exit status of 1 is OK. Only fail if the exit status is 127.
* | build system: allow building with w64devkitRon Yorston2022-10-306-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make some adjustments to the build system to allow busybox-w32 to be built with w64devkit: - Strip drive prefix from CURDIR in Makefile to avoid confusing make with colons. - Limit file redirection to a subshell in the usage_compressed and embedded_scripts scripts. Otherwise it isn't possible to move the open generated file on Windows. - Change the option tests in Kbuild.include to allow for /dev/null not existing on Windows. - Create host binaries without a '.exe' extension. Otherwise they're rebuilt more often than necessary. - Modify split-include.c to allow for Windows' popen() not expanding wildcards. (GitHub issue #239)
* | win32: revert special treatment of Unix-style absolute pathsRon Yorston2022-10-267-49/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 605972390 (win32: handle Unix-style absolute paths for executables) added special treatment of paths for executables starting with a slash. Such paths are absolute on Unix but are relative to the current drive on Windows. On reflection this commit did more than necessary. Later commits provided special treatment only for paths starting with locations traditionally used to contain binaries on Unix. This is probably sufficient. Problems introduced by commit 605972390 include: - If the current drive isn't the system drive tab completion of a command starting with a slash confusingly references the system drive. - Building busybox-w32 with w64devkit fails on drives other than the system drive. Revert the changes introduced by commit 605972390. This saves 192 bytes. (GitHub issue #239)
* | win32: fix warning in timegm(3)Ron Yorston2022-10-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | Building on Windows using w64devkit resulted in a new warning in timegm(3). The compiler didn't like a reference to the unnamed temporary in: if (!is_leap) is_leap = &(int){0}; is_leap is always non-NULL in the limited version of the code used here so the offending line can simply be removed.
* | win32: revise creation of resourcesRon Yorston2022-10-252-3/+5
| | | | | | | | | | | | | | | | | | | | | | As reported in https://github.com/skeeto/w64devkit/issues/35 there's a problem creating Windows resources using the native version of `windres`. Avoid passing arguments to `windres` that it can't handle by stringizing the version string locally in resource.rc. (GitHub issue #239)
* | make: add a comment, no functional changeRon Yorston2022-10-211-3/+8
| |
* | make: $+ should support D/F modifiersRon Yorston2022-10-201-0/+1
| | | | | | | | | | The code to handle the modifiers for 'directory part' and 'filename part' has been updated to support the $+ internal macro.
* | make: .NOTPARALLEL and .WAIT are special targetsRon Yorston2022-10-192-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group defect report 1437 has been accepted. It describes the special targets .NOTPARALLEL and .WAIT which are used to influence the behaviour of parallel builds. Since parallel builds aren't implemented in here they actually don't 't have much effect. - For completeness they're flagged as special targets. - .WAIT should be allowed as a prerequisite.
* | make: shell assignment is a POSIX 202X featureRon Yorston2022-10-182-16/+16
| | | | | | | | | | | | | | | | Austin Group defect report 337 has been accepted, thus making macro assignment from the output of a shell command (!=) a POSIX 202X feature. This was previously implemented as a non-POSIX extension.
* | make: support $+ and $^ as POSIX 202X featuresRon Yorston2022-10-182-14/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Austin Group defect reports 514 and 1520 have both been accepted. Together these introduce the internal macros $+ and $^: - $+ lists all prerequisites, with duplicates retained; - $^ lists all prerequisites, with duplicates removed. $^ had already been implemented as a non-POSIX extension, it now becomes a POSIX 202X extension. $+ has been added as a POSIX 202X extension. Neither of the above defect reports mentions how $? should handle duplicate prerequisites. In POSIX mode duplicates are retained. Removal of duplicates is implemented as a non-POSIX extension to match existing practice in other versions of make.
* | make: clarify output of testsRon Yorston2022-10-161-31/+31
| |
* | ash: disable the 'sleep' builtin in the default configurationRon Yorston2022-10-132-2/+2
| | | | | | | | | | | | The sleep applet can call xfunc_die() in a variety of circumstances. This makes the code unsuitable for use as a shell builtin. Disable it in the default configuration.
* | ash: enable 'read -t N.NNN'Ron Yorston2022-10-132-2/+2
| | | | | | | | | | | | | | | | | | Upstream BusyBox has supported fractional arguments to 'read -t' since 2017. For some reason it was never enabled in busybox-w32. Costs 48-80 bytes. (GitHub issue #269)
* | xxd: avoid use of uninitialised variableRon Yorston2022-10-121-0/+4
| | | | | | | | | | | | | | If xxd is run with '-r' but no '-s' the value of opt_s passed to reverse() is uninitialised. This patch has been submitted upstream but hasn't been applied yet.
* | Update default configurationRon Yorston2022-10-122-2/+6
| | | | | | | | The new 'tree' applet uses scandir(3) and has been disabled by default.
* | Merge branch 'busybox' into mergeRon Yorston2022-10-1246-186/+678
|\|
| * tls: move definitions around, no code changesDenys Vlasenko2022-09-081-22/+12
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tls: include signature_algorithms extension in client hello messageDenys Vlasenko2022-09-081-18/+73
| | | | | | | | | | | | | | | | | | | | function old new delta tls_xread_record 629 645 +16 .rodata 105167 105179 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 28/0) Total: 28 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: mark stack in assembly files read-onlyLudwig Nussel2022-08-306-0/+18
| | | | | | | | | | Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fix [ --help ] and [[ --help ]]Denys Vlasenko2022-08-301-0/+3
| | | | | | | | | | | | | | function old new delta show_usage_if_dash_dash_help 72 79 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: style fixDenys Vlasenko2022-08-3013-52/+52
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: optional sleep builtinShawn Landden2022-08-274-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta sleepcmd - 10 +10 builtintab 352 360 +8 .rodata 105264 105271 +7 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 25/0) Total: 25 bytes Signed-off-by: Shawn Landden <shawnlandden@tutanota.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * devmem: add 128-bit widthAaro Koskinen2022-08-261-24/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 128-bit width if the compiler provides the needed type. function old new delta devmem_main 405 464 +59 .rodata 109025 109043 +18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 77/0) Total: 77 bytes Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tree: unicode tweak (use normal space char, 0x20)Denys Vlasenko2022-08-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tree: make it unicode-awareDenys Vlasenko2022-08-261-3/+16
| | | | | | | | | | | | | | | | | | | | | | function old new delta tree_print 396 420 +24 .rodata 105251 105266 +15 tree_main 86 91 +5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 44/0) Total: 44 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd -r: handle offsetsDenys Vlasenko2022-08-221-8/+50
| | | | | | | | | | | | | | | | | | | | function old new delta xxd_main 1076 1439 +363 .rodata 105239 105251 +12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 375/0) Total: 375 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd: add two more testcasesDenys Vlasenko2022-08-221-2/+16
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd -r: without -p, stop at more than one whitespace, closes 14786Denys Vlasenko2022-08-222-17/+48
| | | | | | | | | | | | | | function old new delta xxd_main 888 1076 +188 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: make '--help' handling more consistentRon Yorston2022-08-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running an applet with '--help' as its only argument is treated as a special case. If additional arguments follow '--help' the behaviour is inconsistent: - applets which call single_argv() print help and do nothing else; - applets which call getopt() report "unrecognized option '--help'" and print help anyway; - expr says "expr: syntax error" and doesn't print help; - printenv silently ignores '--help', prints any other variables and doesn't print help; - realpath says "--help: No such file or directory", prints the path of any other files and doesn't print help. If the first argument is '--help' ignore any other arguments and print help. This is more consistent and most likely what the user wanted. See also commit 6bdfbc4cb (libbb: fix '--help' handling in FEATURE_SH_NOFORK=y). function old new delta show_usage_if_dash_dash_help 75 69 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-6) Total: -6 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * bc: hopefully fix bug 14956 (use-after-free)Denys Vlasenko2022-08-181-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: fix use-after-free in bash pattern substitutionSören Tempel2022-08-021-0/+7
| | | | | | | | | | | | | | | | function old new delta subevalvar 1566 1564 -2 Signed-off-by: Sören Tempel <soeren@soeren-tempel.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: downgrade "opening listen socket" log level to 2Denys Vlasenko2022-08-022-2/+2
| | | | | | | | | | | | This matches udhcpc for IPv4. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: fix sending of renew messagesDenys Vlasenko2022-08-021-2/+3
| | | | | | | | | | | | | | function old new delta d6_listen_socket - 150 +150 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: add 'ZQ' quitting commandGrob Grobmann2022-08-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | Busybox vi provides the 'ZZ' command to save and close the similar 'ZQ' command just exits without saving. function old new delta do_cmd 4222 4244 +22 Signed-off-by: Grob Grobmann <grobgrobmann@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ping: fix typo in --help textHenrique Rodrigues2022-08-021-2/+2
| | | | | | | | | | Signed-off-by: Henrique Rodrigues <henrique.rodrigues@ist.utl.pt> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: fix use-after-free in pattern substituon codeDenys Vlasenko2022-08-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by soeren@soeren-tempel.net The idx variable points to a value in the stack string (as managed by STPUTC). STPUTC may resize this stack string via realloc(3). If this happens, the idx pointer needs to be updated. Otherwise, dereferencing idx may result in a use-after free. function old new delta subevalvar 1562 1566 +4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: fix ifs cleanup on error pathsDenys Vlasenko2022-08-025-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Alex Gorinson <algore3698@gmail.com> function old new delta evalvar 477 495 +18 varvalue 603 618 +15 subevalvar 1557 1572 +15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 48/0) Total: 48 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sort: fix sort -s -u, closes 14871Denys Vlasenko2022-07-292-4/+15
| | | | | | | | | | | | | | function old new delta sort_main 851 856 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sort: fix -k2M (wasn't skipping leading whitespace)Denys Vlasenko2022-07-292-2/+13
| | | | | | | | | | | | | | function old new delta compare_keys 848 862 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc6: add missed big-endian conversionsDenys Vlasenko2022-07-131-0/+2
| | | | | | | | | | | | | | function old new delta option_to_env 686 694 +8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tls: P256: remove NOP macro sp_256_norm_8()Denys Vlasenko2022-07-131-30/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix use after free (CVE-2022-30065)Natanael Copa2022-07-112-0/+9
| | | | | | | | | | | | | | | | | | | | fixes https://bugs.busybox.net/show_bug.cgi?id=14781 function old new delta evaluate 3343 3357 +14 Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * shaNNNsum: accept one-space "HASH FILENAME" format for -c, closes 14866Denys Vlasenko2022-07-112-5/+18
| | | | | | | | | | | | | | function old new delta md5_sha1_sum_main 496 501 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: get PWD from ashRon Yorston2022-07-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The line editing code and ash disagree when the current directory is changed to a symbolic link: ~ $ mkdir real ~ $ ln -s real link ~ $ cd link ~/real $ pwd /home/rmyf36/link Note the prompt says we're in ~/real. Bash does: [rmy@random ~]$ cd link [rmy@random link]$ pwd /home/rmyf36/link Ash uses the name supplied by the user while the line editing code calls getcwd(3). The discrepancy can be avoided by fetching the value of PWD from ash. Hush calls getcwd(3) when the directory is changed so there's no disagreement with the line editing code. There is no standard how shells should handle cd'ing into symlinks. function old new delta parse_and_put_prompt 838 869 +31 Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tree: new appletRoger Knecht2022-06-303-0/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the tree program to list directories and files in a tree structure. function old new delta tree_print - 343 +343 scandir64 - 330 +330 scandir - 330 +330 tree_main - 86 +86 .rodata 105150 105228 +78 packed_usage 34511 34557 +46 alphasort64 - 31 +31 alphasort - 31 +31 strcoll - 5 +5 applet_names 2801 2806 +5 applet_main 1616 1620 +4 applet_suid 101 102 +1 applet_install_loc 202 203 +1 ------------------------------------------------------------------------------ (add/remove: 11/0 grow/shrink: 6/0 up/down: 1291/0) Total: 1291 bytes Signed-off-by: Roger Knecht <rknecht@pm.me> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | libarchive: alter handling of failure to create symlinksRon Yorston2022-09-271-19/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike GNU tar upstream BusyBox tar treats all errors as fatal. Failure to create a symlink on Windows is very likely due to a lack of the required privilege. busybox-w32 therefore treats this case as a non-fatal error and, as far as possible, continues extracting files. However: - The inconsistency of this behaviour caused some confusion. - busybox-w32 tar didn't return an error status when a non-fatal error was encountered, unlike GNU tar. Change the implementation so extraction continues when symlink creation fails but the error report is deferred until all of the archive has been processed. Only one error is reported and it's treated as fatal. Saves 48-64 bytes. (GitHub issue #265)