aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libbb: exclude more Linux-specific functions from being compiledJohannes Schindelin2017-08-301-0/+2
| | | | | | | | | | | | | | | | | In 7a4491e1f (libbb: don't compile various Linux-specific functions, 2017-08-24), we started excluding a number of Linux-specific functions that handle things like SELinux, ioctls, devices and forking. But we forgot a couple functions that depend on the ones we now excluded. This leads to compile failures with -Werror unless cross-compiling on Linux, due to undefined symbols. To fix this, exclude those functions which depend on the ones that were excluded (they do not have any callers on Windows anyway, so all is good). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* libbb: don't compile various Linux-specific functionsRon Yorston2017-08-241-0/+2
| | | | | | | xfuncs_printf.c includes a number of Linux-specific functions. They handle things like SELinux, ioctls, devices and forking. Nothing in busybox-w32 uses them, so don't compile them.
* cpio: disable pass-through mode (-p) in default configurationRon Yorston2017-08-242-2/+2
| | | | Pass-through mode never worked: it uses fork().
* mode_string: S_IFBLK differs between Windows and UnixJohannes Schindelin2017-08-241-1/+1
| | | | | | | | | | | It is a bit wrong to make that much of a hard-coded assumption, anyway. Maybe a better way would be to test whether the S_IF* constants are in a specific range. But then, it is probably not worth the time to investigate that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* xconnect: avoid using getsockname/getpeername on WindowsJohannes Schindelin2017-08-241-0/+2
| | | | | | | | | | | | | | | The semantics of said functions is a bit different on Windows than on Linux: it takes a `SOCKET` parameter instead of an `int` parameter, as Windows does not use file descriptors for sockets. The callers of these functions are only used in the daemons anyway, though, and those are not compiled in busybox-w32. Therefore, let's simply skip compiling those functions on Windows (as well as `get_lsa()`, which would now be unused otherwise). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* mingw: accommodate for BusyBox' assumptions about isatty()Johannes Schindelin2017-08-242-0/+29
| | | | | | | | | | | | | | | On Windows, isatty(fd) determines whether the file descriptor refers to a character device. The thing is: even NUL or a printer is a character device. BusyBox thinks, however, that isatty() only returns non-zero for an interactive terminal. So let's shadow isatty() by a version that answers the question BusyBox wants to have answered. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* bb_basename: handle mixed slashes correctlyJohannes Schindelin2017-08-241-4/+6
| | | | | | | | | | | A path like C:/WINDOWS\system32 was handled incorrectly: it found the forward slash, and then never bothered to look whether there was another (back-)slash later on. This fixes e.g. running BusyBox as C:/test\sh.exe Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* win32: remove implementation of mempcpyRon Yorston2017-08-233-33/+0
| | | | | mingw-w64 has its own mempcpy. And even if it didn't upstream BusyBox has one too. So we definitely don't need our own.
* Merge branch 'busybox' into mergeRon Yorston2017-08-232-6/+7
|\
| * tar: fix handling of first argument without '-'Ron Yorston2017-08-231-3/+3
| | | | | | | | | | | | | | | | | | | | The following no longer works as expected: $ ./busybox tar xfz test.tgz tar: can't open 'z': No such file or directory Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sendmail: fix segfault if "To: email1,email2" is usedDenys Vlasenko2017-08-221-3/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | sed: support the -b/--binary optionJohannes Schindelin2017-08-231-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option was introduced in Cygwin's and MSYS2's sed, to allow for keeping Carriage Returns (otherwise, they would be stripped and the output would always be LF-only). Git for Windows' test suite relies on the presence of this option. It was easy enough to implement, too. Conditional compilation added by rmy. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32/strptime: fix for negative timezonesJohannes Schindelin2017-08-231-0/+2
| | | | | | | | | | | | | | I bet this has been fixed in gnulib, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | include/mingw.h: remove unnecessary definition of PRIuMAXRon Yorston2017-08-231-1/+0
| |
* | win32/select: ensure that the implementation matches the prototypeJohannes Schindelin2017-08-231-0/+1
| | | | | | | | | | | | | | | | The libbb.h header implicitly includes mingw.h, which has the declaration of that function. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32/fnmatch: fix old-style function declarationJohannes Schindelin2017-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It would be more straight-forward to simply #include "libbb.h" which includes a #define getenv mingw_getenv, but that header also defines isprint() to a function that is nowhere to be found, leading to link problems. So let's go the easy route. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32/fnmatch: avoid old-style function definitionsJohannes Schindelin2017-08-231-12/+4
| | | | | | | | | | Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32/strptime: avoid old-style declarationsJohannes Schindelin2017-08-231-19/+5
| | | | | | | | | | | | | | | | This was inherited from gnulib. While at it, get rid of the ugly (and unneeded) LOCALE constants. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32/strptime: ensure that strptime()/localtime_r() are declaredJohannes Schindelin2017-08-231-0/+1
| | | | | | | | | | | | | | | | | | | | When `#include`ing libbb.h, it implicitly includes mingw.h (with a prototype for strptime()) and it also defines _POSIX_THREAD_SAFE_FUNCTIONS so that the time.h header declares localtime_r(). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32/select: work around a compiler warningJohannes Schindelin2017-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | The `tend` variable is only ever initialized and used if the timeout is *not* infinite. However, GCC is not smart enough to figure that out. So just initialize the variable to 0 and be done with it already. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32/mingw: fix signatures of the *execv*() family of functionsJohannes Schindelin2017-08-234-26/+24
| | | | | | | | | | | | | | | | | | | | The function signatures were inherited from Git's source code, but are inconsistent with the declarations in the POSIX standard. This requires quite a few changes in quite a few callers, unfortunately. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | win32: remove unused functionsRon Yorston2017-08-232-23/+0
| | | | | | | | | | The functions copy_environ and free_environ became unused following commit ac181bf54 "win32: simplify spawning applets".
* | inode_hash: avoid warnings about unused parametersRon Yorston2017-08-233-2/+5
| |
* | find_mount_point: avoid warnings about casts to non-constJohannes Schindelin2017-08-231-2/+7
| | | | | | | | | | | | | | | | These changes were forgotten in 878295063 (df: limited implementation for WIN32, 2013-04-03). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | find_mount_point: avoid warning about unused parameterRon Yorston2017-08-231-0/+2
| |
* | find_pid_by_name: avoid unused variablesJohannes Schindelin2017-08-231-0/+2
| | | | | | | | | | | | | | | | This change was forgotten in 28c65da05 (win32: find_pid_by_name: skip argv checks as we do not have that info, 2010-09-15). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | find_mount_point: avoid unused variablesJohannes Schindelin2017-08-231-2/+3
| | | | | | | | | | | | | | | | | | | | These variables are not used when compiling for MINGW. This change was forgotten in 878295063 (df: limited implementation for WIN32, 2013-04-03). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | man: save path separator so it can be restoredRon Yorston2017-08-231-1/+9
| |
* | man: fix compiler warning about a const -> non-const castJohannes Schindelin2017-08-231-1/+1
| | | | | | | | | | | | | | | | | | In b25a7c28a (mingw32: add man, 2012-06-26), the next_path_sep() call was introduced. As we pass in a non-const parameter, it is safe to cast the result back to a non-const pointer, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | less: avoid defining unused functionJohannes Schindelin2017-08-231-0/+2
| | | | | | | | | | | | | | | | This was forgotten in f4c43d4a2 (less: hide unsupported signal handling in include file, 2016-05-19). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | xargs: avoid unused variableJohannes Schindelin2017-08-231-0/+2
| | | | | | | | | | | | | | | | This was forgotten in 124bbf029 (xargs: read characters directly from console so -p flag works, 2014-09-10). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | rpm: enable rpm in default configurationsRon Yorston2017-08-222-2/+2
| |
* | Revert "ash: allow long-running nofork applets to be interrupted"Ron Yorston2017-08-223-28/+1
| | | | | | | | | | | | | | This reverts commit f5051d07f196a8ff7aeaae762333d5aa2b824088. Upstream made 'yes' and 'seq' NOEXEC rather than NOFORK which also solves the problem, though NOEXEC doesn't provide any gain in busybox-w32.
* | Post-merge fixesRon Yorston2017-08-224-46/+56
| | | | | | | | | | - Update default configurations. - Changes required for rpm2cpio to compile
* | Merge branch 'busybox' into mergeRon Yorston2017-08-22342-2519/+4878
|\|
| * libarchive: fix build failure on NOMMU systemsRon Yorston2017-08-221-1/+1
| | | | | | | | | | | | | | | | In the old code fd was an argument, now we need to get the file descriptor from the xstate structure. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ps: fix build failure if FEATURE_PS_TIME is disabledRon Yorston2017-08-221-1/+3
| | | | | | | | | | | | | | | | The global seconds_since_boot is only defined if FEATURE_PS_TIME is enabled. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * rpm,rpm2cpio: do not compile not-configurred parts of rpm.cDenys Vlasenko2017-08-221-40/+48
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * run-init: if doing dry run, do not require pid==1Denys Vlasenko2017-08-221-2/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ps: allow ps config options if minips is enabledKang-Che Sung2017-08-221-8/+8
| | | | | | | | | | | | | | | | | | | | | | Follow-up of commit ab77e81a8527fa11a4f9392d97c2da037d6f4f98 "klibc-utils: new applets: resume, nuke, minips" Also put FEATURE_PS_UNUSUAL_SYSTEMS to under FEATURE_PS_TIME in the menu. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * run-init: implement -n "dry run"Denys Vlasenko2017-08-222-35/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta switch_root_main 637 706 +69 packed_usage 31743 31757 +14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 83/0) Total: 83 bytes text data bss dec hex filename 915247 563 5844 921654 e1036 busybox_old 915303 563 5844 921710 e106e busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * run-init: new appletDenys Vlasenko2017-08-215-52/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta switch_root_main 354 637 +283 drop_usermodehelper - 157 +157 cap_name_to_number - 77 +77 packed_usage 31707 31743 +36 applet_names 2665 2674 +9 applet_main 1544 1548 +4 applet_install_loc 193 194 +1 setpriv_main 933 928 -5 getcaps 131 122 -9 parse_cap 117 29 -88 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 5/3 up/down: 567/-102) Total: 465 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: move capability names code to libbbDenys Vlasenko2017-08-213-77/+90
| | | | | | | | | | | | | | | | | | | | function old new delta cap_name_to_number - 77 +77 parse_cap 117 29 -88 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/1 up/down: 77/-88) Total: -11 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * setpriv: code shrinkDenys Vlasenko2017-08-201-9/+7
| | | | | | | | | | | | | | | | | | | | function old new delta parse_cap 125 117 -8 setpriv_main 949 933 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-24) Total: -24 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * nuke: shorten help textDenys Vlasenko2017-08-182-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * klibc-utils: new applets: resume, nuke, minipsDenys Vlasenko2017-08-189-1/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | minips is a pure alias to ps, just in case someone needs 100% klibc-utils compat. nuke is a primitive version of "rm -rf" without options and error checks. ~30 bytes. resume is a tool for initramfs which resumes from a given block device. function old new delta resume_main - 582 +582 packed_usage 31640 31712 +72 nuke_main - 28 +28 xstrtoull - 24 +24 applet_names 2646 2665 +19 applet_main 1532 1544 +12 applet_suid 96 97 +1 applet_install_loc 192 193 +1 applet_flags 96 97 +1 ------------------------------------------------------------------------------ (add/remove: 5/0 grow/shrink: 6/0 up/down: 740/0) Total: 740 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * setpriv: accept any case in capability namesDenys Vlasenko2017-08-181-1/+1
| | | | | | | | | | | | This should work: setpriv --inh-caps -SyS_ReSOuRCE sh Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: stage backported LINENO support as a separate patchDenys Vlasenko2017-08-171-0/+498
| | | | | | | | | | | | | | | | Looks biggish and not particularly useful, but may be easier to just eat the impact if future backports from dash would be otherwise increasingly difficult. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * telnet: "-a" + "-l USER" should respect USERDenys Vlasenko2017-08-171-2/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: trivial code shrink in builtin_getoptsDenys Vlasenko2017-08-171-4/+5
| | | | | | | | | | | | | | function old new delta builtin_getopts 368 363 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>