summaryrefslogtreecommitdiff
path: root/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | win32: add a function to convert backslashes to slashesRon Yorston2018-03-181-2/+1
| |
* | win32: tidy up popen implementationRon Yorston2018-03-151-1/+0
| | | | | | | | | | | | | | | | | | Make mingw_popen_fd sufficiently general that it can be used to implement the other two popen routines. mingw_popen now just creates a command line and passes it to mingw_popen_fd. The one call to mingw_popen2 has been replaced by a call to mingw_popen_fd.
* | wget: add support for httpsRon Yorston2018-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow wget to support https URLs. Changes are: - Add mingw_popen2 which uses a named pipe to allow bidirectional communication with a child process; - Modify ssl_client to accept a WIN32 handle instead of a file descriptor as an argument; - Allow tls_get_random to open /dev/urandom; - Using the above changes implement a WIN32 version of spawn_ssl_client in wget. This closes GitHub issue #75. Also, enable authentication in wget.
* | win32: restrict visibility of special devicesRon Yorston2018-03-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling of the special devices /dev/zero and /dev/urandom was inconsistent: - they could be used as arguments to 'cat' but not 'od'; - they could not be used in shell redirection. Restrict the use of these devices to two places: - as input files to 'dd' with the 'if=' argument; - internally within 'shred'. See GitHub issue #98.
* | Merge branch 'busybox' into mergeRon Yorston2018-03-151-1/+1
|\|
| * networking/interface.c: get rid of global "smallint interface_opt_a"Denys Vlasenko2018-03-051-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Minor improvements to buildRon Yorston2018-03-022-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Exclude source files in libbb that aren't used by busybox-w32. This speeds up the build marginally. They can always be reinstated if necessary. Provide fake routines for everything in inode_hash.c so that it can be excluded. inode_hash.c is now unchanged from upstream. Use last_char_is in has_exe_suffix_or_dot. It doesn't save any bytes but it makes the code neater.
* | Merge branch 'busybox' into mergeRon Yorston2018-03-012-12/+17
|\|
| * libbb: compile capability code only if FEATURE_SETPRIV_CAPABILITIES or RUN_INITDenys Vlasenko2018-02-211-3/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar,unzip: postpone creation of symlinks with "suspicious" targetsDenys Vlasenko2018-02-201-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mostly reverts commit bc9bbeb2b81001e8731cd2ae501c8fccc8d87cc7 "libarchive: do not extract unsafe symlinks unless $EXTRACT_UNSAFE_SYMLINKS=1" Users report that it is somewhat too restrictive. See https://bugs.busybox.net/show_bug.cgi?id=8411 In particular, this interferes with unpacking of busybox-based filesystems with links like "sbin/applet" -> "../bin/busybox". The change is made smaller by deleting ARCHIVE_EXTRACT_QUIET flag - it is unused since 2010, and removing conditionals on it allows commonalizing some error message codes. function old new delta create_or_remember_symlink - 94 +94 create_symlinks_from_list - 64 +64 tar_main 1002 1006 +4 unzip_main 2732 2724 -8 data_extract_all 984 891 -93 unsafe_symlink_target 147 - -147 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 1/2 up/down: 162/-248) Total: -86 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * progress meter: add disabled code for a more stable ETADenys Vlasenko2018-02-131-0/+1
| | | | | | | | | | | | Compiles to ~25 bytes if enabled. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Remove fake signal-handling codeRon Yorston2018-03-012-28/+18
| | | | | | | | | | | | | | | | | | Microsoft Windows has only limited support for signals. busybox-w32 initially papered over this fact by adding definitions for unsupported signals and signal-handling functions. Remove this fake code and deal with the consequences by excluding anything that fails to compile as a result.
* | win32: make has_exec_format staticRon Yorston2018-03-011-1/+0
| | | | | | | | The only other caller (in spawnveq) has been removed.
* | win32: don't add extensions to filenames ending with a dotRon Yorston2018-02-281-1/+2
| | | | | | | | | | | | | | A filename ending with a dot is a signal to spawnve not to try adding extensions but to use the name unmodified. The add_win32_extension function should follow the same rule.
* | win32: move detection of file formats to stat(2)Ron Yorston2018-02-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the code to detect shell scripts and binary executables from mingw_access to a separate function, has_exec_format. Call this function in do_lstat to decide whether to set the executable bits in the file mode. This will slow down stat but has a couple of advantages: - shell scripts are highlighted in ls output - the test applet can use stat(2) to detect executable files The new function is used to handle another corner case in spawnveq: binary executables without the usual .exe extension are only run by spawnve if the file name ends with '.'. Two minor changes: - file_is_win32_executable has been renamed add_win32_extension to clarify what it does - a call to file_is_executable has been removed from find_command in ash as it resulted in unhelpful error messages.
* | win32: add support for batch filesRon Yorston2018-02-261-0/+1
| | | | | | | | | | | | | | | | Support batch files with .bat and .cmd extensions, similar to what's done for .exe and .com. Check extensions in the same order as Windows' spawn function: .com, .exe, .bat, .cmd.
* | win32: make /dev/urandom more randomRon Yorston2018-02-231-0/+2
| |
* | win32: handle /dev/zero and /dev/urandom in open and read functionsRon Yorston2018-02-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently /dev/zero is handled as a special case in dd. Add hacks to the open and read functions in mingw.c to handle the zero and urandom devices. - Opening /dev/zero or /dev/urandom actually opens the special Windows file 'nul' which behaves like /dev/null. This allows manipulation of the file descriptor with things like seek and close - When /dev/zero or /dev/urandom is opened the resulting file descriptor is stored and used to override the behaviour of read. - No attempt is made to track duplicated file descriptors, so using these devices for redirections in the shell isn't going to work and won't be permitted. (Could be, but won't.) - Limited control of the special file descriptors is provided by allowing the internal variables to be changed. - The numbers from /dev/urandom aren't very random.
* | win32: import fsync(2) implementation from gnulibRon Yorston2018-02-212-1/+2
| |
* | win32: always use safe API calls to manipulate environmentRon Yorston2018-02-131-6/+0
| | | | | | | | | | | | | | | | | | | | | | It turns out that with the new toolchain safe API calls work on all all platforms. Even the original code from commit fa147bd7e works on Windows XP when built with the new tools. - Remove the unsafe environment manipulation via the environ array - Microsoft's putenv takes a copy of its argument so the string can be freed - Rewrite some routines and add more error checking
* | Merge branch 'busybox' into mergeRon Yorston2018-02-133-11/+36
|\|
| * libbb: introduce and use bb_getsockname()Denys Vlasenko2018-02-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta bb_getsockname - 18 +18 xrtnl_open 88 83 -5 do_iplink 1216 1209 -7 arping_main 1686 1668 -18 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/3 up/down: 18/-30) Total: -12 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: add EPSV supportDenys Vlasenko2018-02-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | function old new delta parse_pasv_epsv - 151 +151 wget_main 2440 2382 -58 xconnect_ftpdata 223 94 -129 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/2 up/down: 151/-187) Total: -36 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * wget: initial support for ftps://Denys Vlasenko2018-02-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta spawn_ssl_client - 185 +185 parse_url 409 461 +52 packed_usage 32259 32278 +19 tls_run_copy_loop 293 306 +13 ssl_client_main 128 138 +10 showmode 330 338 +8 P_FTPS - 5 +5 filter_datapoints 177 179 +2 deflate 907 905 -2 decode_one_format 723 716 -7 wget_main 2591 2440 -151 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 6/3 up/down: 294/-160) Total: 134 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: commonalize a bit of little-endian CRC32 table generation codeDenys Vlasenko2018-02-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta global_crc32_new_table_le - 11 +11 crc32_new_table_le - 9 +9 inflate_unzip_internal 560 556 -4 flash_eraseall_main 823 819 -4 unpack_xz_stream 2403 2394 -9 lzop_main 121 112 -9 gzip_main 187 178 -9 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/5 up/down: 20/-35) Total: -15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * cp: implement -TAaro Koskinen2018-02-011-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement "cp -T". Some Linux kernel Makefiles started using this recently, so allow also building on systems using busybox cp. function old new delta cp_main 360 428 +68 copy_file 1678 1676 -2 packed_usage 32290 32259 -31 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 76/-39) Total: 35 bytes Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libarchive: move bbunpack constants to bb_archive.hDenys Vlasenko2018-02-011-0/+15
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lzop: code shrinkDenys Vlasenko2018-02-011-4/+2
| | | | | | | | | | | | | | | | function old new delta lzo_decompress 526 524 -2 lzo_compress 473 470 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * which: fix TODO with NOFORK+malloc_failure misbehavingDenys Vlasenko2018-01-121-3/+9
| | | | | | | | | | | | | | | | | | | | | | function old new delta find_executable 86 104 +18 which_main 202 194 -8 executable_exists 66 51 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 18/-23) Total: -5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-11-031-0/+11
|\|
| * use %m printf specifier where appropriateDenys Vlasenko2017-09-291-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta out 85 75 -10 udhcpd_main 1472 1461 -11 open_stdio_to_tty 98 85 -13 init_exec 245 232 -13 udhcpc_main 2763 2749 -14 do_cmd 4771 4755 -16 status_line_bold_errno 32 14 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-95) Total: -95 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-09-271-1/+2
|\|
| * less,microcom,lineedit: use common routine to set raw termiosDenys Vlasenko2017-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta get_termios_and_make_raw - 139 +139 xget1 39 8 -31 read_line_input 3912 3867 -45 less_main 2525 2471 -54 set_termios_to_raw 116 36 -80 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/4 up/down: 139/-210) Total: -71 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: GETOPT_RESET() _after_ getopts too.Denys Vlasenko2017-08-291-1/+1
| | | | | | | | | | | | | | | | | | NOEXEC'ed applets which use getopt() need this. function old new delta builtin_getopts 403 413 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ps: add support for CPU and elapsed time columnsRon Yorston2017-09-011-0/+7
| | | | | | | | | | | | | | | | It may be necessary to run ps as administrator to get information about processes belonging to other users. The code to detect GetTickCount64 at run-time was imported from Git for Windows.
* | win32: shrink code to detect .exe filesRon Yorston2017-08-301-0/+1
| | | | | | | | | | | | | | | | Add a function (has_exe_suffix) to replace explicit code to check if a filename ends with '.exe. or '.com'. Also shrink code that checks for '.exe' or '.com' on PATH in shell's find_command function.
* | win32: make vfork fail at compile-timeRon Yorston2017-08-302-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | Nothing in busybox-w32 uses fork. Remove the implementations of fork, vfork and xvfork so that, for example, enabling cpio pass-through causes an error at compile-time, not run-time. MinGW-w64 defines pid_t, so we don't have to. Ensure code containing xvfork in netcat is disabled when NC_EXTRA is disabled. Otherwise removing the implementation of vfork costs 64 bytes.
* | mingw: accommodate for BusyBox' assumptions about isatty()Johannes Schindelin2017-08-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | win32: remove implementation of mempcpyRon Yorston2017-08-231-5/+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.
* | include/mingw.h: remove unnecessary definition of PRIuMAXRon Yorston2017-08-231-1/+0
| |
* | win32/mingw: fix signatures of the *execv*() family of functionsJohannes Schindelin2017-08-231-4/+4
| | | | | | | | | | | | | | | | | | | | 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-231-2/+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-232-0/+3
| |
* | find_mount_point: avoid warning about unused parameterRon Yorston2017-08-231-0/+2
| |
* | Revert "ash: allow long-running nofork applets to be interrupted"Ron Yorston2017-08-221-3/+0
| | | | | | | | | | | | | | 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-221-0/+1
| | | | | | | | | | - Update default configurations. - Changes required for rpm2cpio to compile
* | Merge branch 'busybox' into mergeRon Yorston2017-08-223-21/+58
|\|
| * run-init: new appletDenys Vlasenko2017-08-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-211-0/+6
| | | | | | | | | | | | | | | | | | | | 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>
| * Hopefully fix "will break strict-aliasing rules" warning for get_le32Denys Vlasenko2017-08-101-0/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>