aboutsummaryrefslogtreecommitdiff
path: root/libbb (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * libbb: use _exit, not exit, in bb_daemonize_or_rexec()Denys Vlasenko2017-08-041-2/+8
| | | | | | | | | | | | | | | | | | By the time we reach exit in parent, child already exited or execed. We should not re-run libc cleanup code. While at it, introduce bb_daemon_helper() and add a few comments. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * getopt32: move support for "always treat first arg as option" to users (tar/ar)Denys Vlasenko2017-08-041-33/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Now getopt() never leaks (and never performs) any xmalloc's. function old new delta ar_main 522 556 +34 tar_main 986 1014 +28 getopt32 1458 1350 -108 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 62/-108) Total: -46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * getopt32: factor out code to treat all args as optionsDenys Vlasenko2017-08-043-26/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | Working towards making getopt32() xmalloc-free function old new delta make_all_argv_opts - 58 +58 top_main 914 912 -2 getopt32 1517 1458 -59 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/2 up/down: 58/-61) Total: -3 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * nofork: fix a bug uncovered by hush testsuite (forgotten fflush)Denys Vlasenko2017-08-031-0/+2
| | | | | | | | | | | | | | function old new delta run_nofork_applet 280 287 +7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * new NOFORKs: pwdx,kill[all5],ttysize,realpath,readlink NOEXECs: date,resizeDenys Vlasenko2017-08-032-3/+6
| | | | | | | | | | | | | | | | | | | | function old new delta run_nofork_applet 258 280 +22 readlink_main 112 123 +11 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 33/0) Total: 33 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * line editing: make read_line_input() not take timeout paramDenys Vlasenko2017-08-021-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's almost always -1. function old new delta read_line_input 3902 3912 +10 new_line_input_t 24 31 +7 pgetc 583 585 +2 save_command_ps_at_cur_history 80 78 -2 read_line 76 74 -2 fgetc_interactive 246 244 -2 addLines 84 82 -2 doCommands 2226 2222 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/5 up/down: 19/-12) Total: 7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * do not use `a' quoting style in commentsDenys Vlasenko2017-08-027-7/+7
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-08-022-22/+0
|\|
| * libbb: remove vdprintfRon Yorston2017-07-292-22/+0
| | | | | | | | | | | | | | | | | | | | | | Two reasons: * it's only built for GNU C Library versions < 2 (released 1997) * it isn't used anywhere in BusyBox Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ash: allow long-running nofork applets to be interruptedRon Yorston2017-08-011-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Nofork applets can't be interrupted with ctrl-c. This isn't an issue for most such applets because they do very little and won't run for very long. However 'yes' and 'seq 10000000' can't be interrupted in a interactive shell, which is awkward. As a special case ignore the nofork-ness of these applets if they're run from an interactive shell. This isn't foolproof as there are still ways to run them such that they can't be interrupted, but it helps.
* | libbb: avoid annoying blank line in help messageRon Yorston2017-07-291-2/+2
| | | | | | | | | | | | The abbreviated commit in the version string recently increased to 9 digits thus causing the first line of the help message to exceed 80 characters.
* | lineedit: fix incorrect conflict resolution in bb8d79ead mergeRon Yorston2017-07-291-38/+0
| |
* | ash: remove old code to tab-complete 'busybox' in standalone shellRon Yorston2017-07-291-10/+2
| |
* | Merge branch 'busybox' into mergeRon Yorston2017-07-294-10/+42
|\|
| * standalone shell / prefer_applets: fix "exe" in comm fieldsDenys Vlasenko2017-07-291-0/+18
| | | | | | | | | | | | | | function old new delta main 92 106 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * shell: make standalone shell tab-complete "busybox"Denys Vlasenko2017-07-292-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta busybox_main - 624 +624 packed_usage 31758 31777 +19 applet_names 2638 2646 +8 applet_main 1528 1532 +4 applet_install_loc 191 192 +1 run_applet_and_exit 681 78 -603 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/1 up/down: 656/-603) Total: 53 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * config: trim/improve item names and help texts.Denys Vlasenko2017-07-271-3/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: allow "trap NUM [SIG]..." syntaxDenys Vlasenko2017-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | While at it, make get_signum() return -1 for numeric strings >= NSIG. function old new delta trapcmd 292 306 +14 get_signum 295 300 +5 builtin_trap 413 412 -1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 19/-1) Total: 18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-245-182/+190
|\|
| * libbb: avoid malloc/free in bb_unsetenv()Denys Vlasenko2017-07-221-13/+21
| | | | | | | | | | | | | | function old new delta bb_unsetenv 55 83 +28 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * config: deindent all help textsDenys Vlasenko2017-07-214-169/+169
| | | | | | | | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: simplify spawning appletsRon Yorston2017-07-211-6/+1
| | | | | | | | | | | | | | The original WIN32 code used the BUSYBOX_APPLET_NAME environment variable to pass the applet name to the spawned process. This was based on the (apparently) mistaken idea that WIN32 would replace argv[0] with the path to the executable.
* | Merge branch 'busybox' into mergeRon Yorston2017-07-1812-82/+156
|\|
| * config: merge "Busybox Settings" and "Busybox Library Tuning" into one menuDenys Vlasenko2017-07-152-6/+8
| | | | | | | | | | | | Tweak a few help texts while at it Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * copyfd: guard use of munmap() with #if (windows builds need this)Johannes Schindelin2017-07-151-0/+3
| | | | | | | | | | 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-141-27/+19
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xxd: allow "-" as file name meaning stdinDenys Vlasenko2017-07-141-4/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/dump: allow skipping over stdin tooDenys Vlasenko2017-07-141-20/+13
| | | | | | | | | | | | | | function old new delta next 294 265 -29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/dump: fix a few broken commits and shrink codeDenys Vlasenko2017-07-141-10/+10
| | | | | | | | | | | | | | function old new delta next 310 294 -16 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: safe_write should not return EINTRDenys Vlasenko2017-07-141-2/+10
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * cat: fix "cat -An" ignoring -n; make numbering go througn all filesDenys Vlasenko2017-07-141-0/+1
| | | | | | | | | | | | | | function old new delta cat_main 418 428 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: do not die if setgid/setuid(real_id) on startup failsDenys Vlasenko2017-07-101-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on a patch from Steven McDonald <steven@steven-mcdonald.id.au>: This makes 'unshare --user' work correctly in the case where the user's shell is provided by busybox itself. 'unshare --user' creates a new user namespace without any uid mappings. As a result, /bin/busybox is setuid nobody:nogroup within the namespace, as that is the only user. However, since no uids are mapped, attempting to call setgid/setuid fails, even though this would do nothing: $ unshare --user ./busybox.broken ash ash: setgid: Invalid argument 'unshare --map-root-user' still works, but because Linux only allows uid/gid mappings to be set up once, creating a root mapping makes such a namespace useless for creating multi-user containers. With this patch, setgid and setuid will not be called in the case where they would do nothing, which is always the case inside a new user namespace because all uids are effectively mapped to nobody: $ id -u 1000 $ ls -lh busybox.fixed -rwsr-xr-x 1 root root 826.2K May 21 00:33 busybox.fixed $ unshare --user ./busybox.fixed ash $ id -u 65534 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * main: fix the case where user has "halt" as login shell. Closes 9986Denys Vlasenko2017-07-072-4/+8
| | | | | | | | | | | | | | | | | | | | 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>
| * libbb: new function bb_getgroups() - allocating wrapper around getgroups()Denys Vlasenko2017-07-041-0/+47
| | | | | | | | | | | | | | | | | | | | function old new delta bb_getgroups - 111 +111 nexpr 843 757 -86 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/1 up/down: 111/-86) Total: 25 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Change BB_EXTRA_VERSION: now it needs to contain any spaces/parenthesisDenys Vlasenko2017-07-041-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, BB_EXTRA_VERSION of "" resulted in: "BusyBox v1.28.0.git () multi-call binary" message, after the fix it is: "BusyBox v1.28.0.git multi-call binary" While at it, eliminate BB_BT and BANNER single-use macros. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fixes for bugs found by make_single_applets.shDenys Vlasenko2017-07-033-8/+19
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Use %I64* formats with MinGW instead of %ll* formatsJohannes Schindelin2017-07-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The MSVC runtime uses the format specified %I64 for 64-bit data types; It does not understand e.g. %llu for unsigned long longs. However, mingw-w64 provides a compatibility mode in its runtime wrapper which can be activated by defining the constant __USE_MINGW_ANSI_STDIO=1 in which case we must refrain from overriding the %ll* formats. This fixes quite a couple of compile warnings when building with the mingw-w64 compiler. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* | Merge branch 'busybox' into mergeRon Yorston2017-05-2910-71/+219
|\|
| * Spelling fixes in comments, documentation, tests and examplesDenys Vlasenko2017-04-171-1/+1
| | | | | | | | | | | | By klemens <ka7@github.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: fix "error: redefinition of 'is_tty_secure'"Denys Vlasenko2017-04-131-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: make check_password() also return CHECKPASS_PW_HAS_EMPTY_PASSWORDDenys Vlasenko2017-04-132-4/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * su: FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTYDenys Vlasenko2017-04-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | When this feature is enabled, blank passwords are not accepted by su unless the user is on a secure TTY defined in /etc/securetty. This resembles the default PAM configuration of some Linux distros which specify the nullok_secure option for pam_unix.so. Based on patch by Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * login: move check_securetty to libbbKaarle Ritvanen2017-04-132-0/+23
| | | | | | | | | | Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: GETOPT_RESET macroKaarle Ritvanen2017-04-122-33/+3
| | | | | | | | | | Signed-off-by: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fix errors found with make_single_applets.shDenys Vlasenko2017-04-122-0/+62
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: move isqrt from factor, use it in diff tooDenys Vlasenko2017-04-111-0/+60
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * modprobe: do not descend into /etc/modprobe.d/DIR/. Closes 8686Denys Vlasenko2017-04-061-17/+29
| | | | | | | | | | | | Also expanded comments in recursive_action.c Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * mount: create loop devices with LO_FLAGS_AUTOCLEAR flagDenys Vlasenko2017-03-161-16/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "autolooped" mount (mount [-oloop] IMAGE /DIR/DIR) always creates AUTOCLEARed loopdevs, so that umounting drops them (and this does not require any code in the umount userspace). This happens since circa linux-2.6.25: commit 96c5865559cee0f9cbc5173f3c949f6ce3525581 Date: Wed Feb 6 01:36:27 2008 -0800 Subject: Allow auto-destruction of loop devices IOW: in this case, umount does not have to use -d to drop the loopdev. The explicit loop mount (mount /dev/loopN /DIR/DIR) does not do this. In this case, umount without -d should not drop loopdev. Unfortunately, bbox umount currently always implies -d, this probably needs fixing. function old new delta set_loop 537 597 +60 singlemount 1101 1138 +37 losetup_main 419 432 +13 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 110/0) Total: 110 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-02-0814-212/+259
|\|
| * Replace int -> uint to avoid signed integer overflowRostislav Skudnov2017-02-043-4/+4
| | | | | | | | | | | | | | | | | | | | An example of such an error (should be compiled with DEBUG_SANITIZE): runtime error: left shift of 1 by 31 places cannot be represented in type 'int' Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>