aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Bump version to 1.27.21_27_2Denys Vlasenko2017-08-171-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* svc: fix a case where with more than option, getopt() state is not resetDenys Vlasenko2017-08-051-5/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* unzip: fix regression on big-endian machinesNatanael Copa2017-08-041-0/+1
| | | | | | | | | | | This fixes a regression which was introduced with commit 2a0867a5 ("unzip: optional support for bzip2 and lzma") and causes unzip to exit with error when extracting archives: unzip: unsupported method 2048 Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: FEDORA_COMPAT option (so far only tweaks uname)Denys Vlasenko2017-08-042-1/+14
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* NOFORK fixesDenys Vlasenko2017-08-046-6/+48
| | | | | | | | | | | | | | | | | | "rm -i FILE" and "yes" can now be interrupted by ^C in hush. This also now works: $ usleep 19999999 ^C $ echo $? 130 function old new delta run_pipe 1668 1711 +43 pseudo_exec_argv 312 321 +9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 52/0) Total: 52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tls: fix pstm asm constraint problemDenys Vlasenko2017-08-043-6/+7
| | | | | | | function old new delta pstm_sqr_comba 551 475 -76 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tls: fix build problem on non-static i386Denys Vlasenko2017-08-041-1/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: safe_write should not return EINTRDenys Vlasenko2017-08-041-2/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: fix random line selection. Closes 9971Denys Vlasenko2017-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | """ For example, given input file: foo bar baz after shuffling the input file, foo will never end up back on the first line. This came to light when I ran into a use-case where someone was selecting a random line from a file using shuf | head -n 1, and the results on busybox were showing a statistical anomaly (as in, the first line would never ever be picked) vs the same process running on environments that had gnu coreutils installed. On line https://git.busybox.net/busybox/tree/coreutils/shuf.c#n56 it uses r %= i, which will result in 0 <= r < i, while the algorithm specifies 0 <= r <= i. """ Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Bump version to 1.27.11_27_1Denys Vlasenko2017-07-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix more instances of ": $((a++))" in shell scriptsDenys Vlasenko2017-07-183-8/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* make_single_applets: fix ": $((fail++))" expansion errorKang-Che Sung2017-07-181-3/+3
| | | | | | | | | | | | $((fail++)) is not a required expression in POSIX, and in "dash" it could produce an error like this: ./make_single_applets.sh: 61: arithmetic expression: expecting primary: "fail++" Replace this with something portable: fail=$((fail+1)) would work. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* copyfd: guard use of munmap() with #if (windows builds need this)Johannes Schindelin2017-07-181-0/+3
| | | | | Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: protect WIFSTOPPED use with #if JOBSJohannes Schindelin2017-07-181-3/+9
| | | | | | | | | | | | This change fixes the build in setups where there are no headers defining WIFSTOPPED and WSTOPSIG (where JOBS has to be set to 0). This partially reverts 4700fb5be (ash: make dowait() a bit more readable. Logic is unchanged, 2015-10-09). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: hide getnetbyaddr() inside "#if ENABLE_FEATURE_ETC_NETWORKS" blockDenys Vlasenko2017-07-181-27/+19
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* uuencode: allow space instead of "`" as padding char. Closes 10046Denys Vlasenko2017-07-181-3/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dd: fix status=none. Closes 10066Denys Vlasenko2017-07-181-4/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* inetd,mount: do not die if uclibc without RPC is detectedDenys Vlasenko2017-07-182-2/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* beep: disallow FEATURE_BEEP_FREQ = 0 in configurationDenys Vlasenko2017-07-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* main: fix the case where user has "halt" as login shell. Closes 9986Denys Vlasenko2017-07-185-7/+11
| | | | | | | | | | halt::0:0::/:/sbin/halt function old new delta run_applet_and_exit 748 751 +3 run_applet_no_and_exit 467 459 -8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dpkg: fix CONFIG_FEATURE_CLEAN_UP handlingPeter Korsgaard2017-07-181-4/+0
| | | | | | | | | | | | | dpkg moved to away from dynamically allocating the hashtables in commit c87339d584 (dpkg: trivial code shrinkage, and redo G trick correctly) almost ten years ago, but the cleanup code was never adjusted to match. Glibc loudly complains about this: *** Error in `dpkg': free(): invalid pointer: 0x0000007fac3478c0 *** Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* setpriv: do not process remaining argsPatrick Steinhardt2017-07-181-1/+2
| | | | | | | | | | | | | | | By default, the 'getopt32' call will continue parsing the command line even after hitting a non-option string. But in setpriv, this should be avoided, as all parameters following the initial non-option argument are in fact arguments to the binary that is to be executed by setpriv. Otherwise, calling e.g. 'busybox setpriv ls -l' would result in an error due to the unknown parameter "-l". Fix the issue by passing "+" as the first character in the options string. This will cause 'getopt32' to stop processing after hitting the first non-option. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tls: use capped SNI len everywhereDenys Vlasenko2017-07-181-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bzcat: compile bunzip2_main() if BZCAT.Denys Vlasenko2017-07-181-1/+1
| | | | | | | | Currently, BZCAT (and BUNZIP2) selects FEATURE_BZIP2_DECOMPRESS, thus, "#if ENABLE_FEATURE_BZIP2_DECOMPRESS" around bunzip2_main() is sufficient. But let's robustify it. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fixes for bugs found by make_single_applets.shDenys Vlasenko2017-07-1810-41/+75
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Bump version to 1.27.01_27_0Denys Vlasenko2017-07-031-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* scripts/randomtest: update things which can't be tested on uclibcDenys Vlasenko2017-07-031-0/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* randomconfig fixesDenys Vlasenko2017-07-033-3/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix $HOME/.profile reading if !ASH_EXPAND_PRMT, take 2Denys Vlasenko2017-07-011-8/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix 'trap - 65'Denys Vlasenko2017-07-011-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc6: make -O OPT workDenys Vlasenko2017-06-286-58/+149
| | | | | | Patch is based on work by tiggerswelt.net. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* modutils: delete unused replace_underscores()Denys Vlasenko2017-06-282-7/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc6: add comments about option 39, no code changesDenys Vlasenko2017-06-272-2/+42
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix $HOME/.profile reading if !ASH_EXPAND_PRMTDenys Vlasenko2017-06-271-6/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* pgrep: implement -aDenys Vlasenko2017-06-261-6/+16
| | | | | | | function old new delta pgrep_main 640 726 +86 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* udhcpc6: add support for timezonesDenys Vlasenko2017-06-262-48/+59
| | | | | | | | | Basedon patch by Bernd Holzmüller <bernd.holzmueller@tiggerswelt.net> function old new delta option_to_env 504 580 +76 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* pgrep: fix pgrep -flx "sleep 11" - saw "sleep 11" processes as "sleep 11 "Denys Vlasenko2017-06-261-5/+11
| | | | | | | function old new delta pgrep_main 584 597 +13 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* archival: add option -k "keep" to gzip/bzip2/lzop, add -U "nokeep" to lzopDenys Vlasenko2017-06-154-43/+81
| | | | | | | | | | | | function old new delta bbunpack 745 779 +34 lzop_main 93 121 +28 do_lzo_compress 320 328 +8 packed_usage 31685 31653 -32 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 70/-32) Total: 38 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix "ifdef ENABLE_foo": should always be "#if ENABLE_foo"Denys Vlasenko2017-06-152-5/+5
| | | | | | | | | | | | function old new delta pack_gzip 1729 1789 +60 fill_window 220 216 -4 static.gzip_level_config 24 - -24 gzip_main 275 192 -83 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/2 up/down: 60/-111) Total: -51 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* unshare: fix help text; select LONG_OPTS instead depending on themDenys Vlasenko2017-06-141-3/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* setpriv: new appletAssaf Gordon2017-06-141-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | Add a minimal 'setpriv' implementation supporting the NO_NEW_PRIVS bit. Typical usage: $ busybox setpriv sudo uname Linux $ busybox setpriv --nnp sudo uname sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges? function old new delta packed_usage 31580 31685 +105 setpriv_main - 87 +87 prctl - 53 +53 static.setpriv_longopts - 22 +22 applet_names 2620 2628 +8 applet_main 1516 1520 +4 ------------------------------------------------------------------------------ (add/remove: 5/0 grow/shrink: 3/0 up/down: 279/0) Total: 279 bytes Signed-off-by: Assaf Gordon <assafgordon@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* iproute: support for filtering by and printing of scopeAndré Draszik2017-06-131-4/+22
| | | | | | | | | | | | | | | | | | | | | This patch adds filtering by and printing of 'scope' to the ip route command, taken from the upstream ip command. x86_64: function old new delta iproute_list_or_flush 1548 1674 +126 print_route 2394 2469 +75 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 201/0) Total: 201 bytes mipsel: iproute_list_or_flush 1952 2096 +144 print_route 2580 2696 +116 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 2/0 up/down: 260/0) Total: 260 bytes Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: add IF_FEATURE_* checksMing Liu2017-06-131-10/+15
| | | | | | | | | | | | | | | | | | | A following linking error was observed: | ========== | archival/lib.a(tar.o): In function `tar_main': | archival/tar.c:1168: undefined reference to `unpack_Z_stream' | archival/tar.c:1168: undefined reference to `unpack_Z_stream' | ld: busybox_unstripped: hidden symbol `unpack_Z_stream' isn't defined | ld: final link failed: Bad value this happened with clang compiler, with the following configs: | CONFIG_TAR=y | # CONFIG_FEATURE_SEAMLESS_Z is not set which can be fixed by adding IF_FEATURE_* checks in. Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ip rule: add suppress_{prefixlength,ifgroup} optionsStefan Tomanek2017-06-131-27/+46
| | | | | | | | | | | function old new delta iprule_modify 816 887 +71 print_rule 610 680 +70 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 141/0) Total: 141 bytes Signed-off-by: Stefan Tomanek <stefan.tomanek@wertarbyte.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix incorrect path in describe_commandYoufu Zhang2017-05-261-13/+3
| | | | | | | | | | | | | | | | | | | | | | | $ PATH=/extra/path:/usr/sbin:/usr/bin:/sbin:/bin \ > busybox sh -xc 'command -V ls; command -V ls; command -Vp ls; command -vp ls' + command -V ls ls is /bin/ls + command -V ls ls is a tracked alias for /bin/ls + command -Vp ls ls is a tracked alias for (null) + command -vp ls Segmentation fault describe_command should respect `path' argument. Looking up in the hash table may gives incorrect index in entry.u.index and finally causes incorrect output or SIGSEGV. function old new delta describe_command 386 313 -73 Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ls: fix support for long options when FEATURE_LS_COLOR is deselectedLaurent Bercot2017-05-261-6/+8
| | | | | | | | | | | Declaration of ls_longopts and initialization of applet_long_options were incorrectly guarded with ENABLE_FEATURE_LS_COLOR; that yielded a "ls: NO_OPT: \xff" error message when long options were selected and color support was not. This patch ensures long options are initialized separately from color support. Signed-off-by: Laurent Bercot <ska-dietlibc@skarnet.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* add/remove-shell: copy /etc/shells mode to new fileDenys Vlasenko2017-05-261-11/+9
| | | | | | | function old new delta add_remove_shell_main 259 300 +41 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash,hush: fix SIGCHLD interrupting read builtinDenys Vlasenko2017-05-227-10/+34
| | | | | | | | | | | | function old new delta readcmd 169 217 +48 shell_builtin_read 1087 1097 +10 localcmd 366 364 -2 builtin_read 197 193 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 58/-6) Total: 52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sv: update to match version 2.1.2 of runitJames Byrne2017-05-151-65/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport from upstream versions: 2.1.2 Sun, 10 Aug 2014 18:01:54 +0000 * sv.c: properly format status command's output on failure cases. * sv.c: support optional LSB init script actions reload and try-restart. * sv.c: fix typo that may lead to wrong output from sv when reporting status of multiple service directories. 2.1.1 Sun, 04 Oct 2009 20:28:38 +0000 * sv.c: on 'down', send runsv the 'down' command properly if not yet done (e.g. when taken up with 'once'). [Remove previous workaround added to BusyBox version]. 1.9.0 Mon, 05 May 2008 22:00:13 +0000 * sv.c: service name is also relative to the current directory if it ends with a slash. 1.8.0 Fri, 21 Sep 2007 00:33:56 +0000 * sv.c: fix race on check for down if pid is 0 and state is run or finish. 1.7.1 Sat, 04 Nov 2006 19:23:29 +0000 * sv.c: properly wait for a service to be restarted on 'restart'; support checks through -v for pause, cont, kill. function old new delta sv 1184 1280 +96 control 132 180 +48 status 118 139 +21 out 64 85 +21 svstatus_print 334 344 +10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/0 up/down: 196/0) Total: 196 bytes Signed-off-by: James Byrne <james.byrne at origamienergy.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* runsv: update to match version 2.1.2 of runitDenys Vlasenko2017-05-151-37/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport from upstream versions: 2.1.0 Thu, 24 Sep 2009 22:49:33 +0000 * runsv.c: exit with error if [log/]supervise/control exists, but is not a fifo. [Code abstracted into a separate function to make it more compact for BusyBox.] 1.9.0 Mon, 05 May 2008 22:00:13 +0000 * runsv.c: create temporary new status files for log/supervise/ actually in log/supervise/. 1.7.2 Tue, 21 Nov 2006 15:13:47 +0000 * runsv.c: really don't act on commands in state finish; minor. function old new delta open_control - 135 +135 update_status 553 612 +59 custom 223 242 +19 ctrl 426 422 -4 warn_cannot 21 10 -11 runsv_main 1786 1662 -124 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/3 up/down: 213/-139) Total: 74 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>