aboutsummaryrefslogtreecommitdiff
path: root/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge branch 'busybox' into mergeRon Yorston2018-04-092-6/+9
|\|
| * bzip2: fix two crashes on corrupted archivesDenys Vlasenko2018-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it turns out, longjmp'ing into freed stack is not healthy... function old new delta unpack_usage_messages - 97 +97 unpack_bz2_stream 369 409 +40 get_next_block 1667 1677 +10 get_bits 156 155 -1 start_bunzip 212 183 -29 bb_show_usage 181 120 -61 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/3 up/down: 147/-91) Total: 56 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb.h: always include sys/resource.hDenys Vlasenko2018-04-081-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: switch bb_ask_noecho() to "mallocing" string return APIDenys Vlasenko2018-04-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | function old new delta bb_ask_noecho 313 330 +17 get_cred_or_die 125 115 -10 passwd_main 995 958 -37 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 17/-47) Total: -30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * xargs: use bb_ask_y_confirmation_FILE() instead of homegrown copyDenys Vlasenko2018-04-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta bb_ask_y_confirmation_FILE - 83 +83 inetd_main 2033 2043 +10 udhcp_send_kernel_packet 295 301 +6 rmescapes 306 310 +4 send_tree 353 355 +2 i2cdetect_main 674 672 -2 confirm_or_abort 43 38 -5 get_terminal_width_height 242 234 -8 bb_ask_y_confirmation 76 10 -66 xargs_main 823 755 -68 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/5 up/down: 105/-149) Total: -44 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: rename bb_ask -> bb_ask_noecho, bb_ask_confirmation -> ↵Denys Vlasenko2018-04-071-4/+4
| | | | | | | | | | | | bb_ask_y_confirmation Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | libarchive: failure to extract symlink isn't fatalRon Yorston2018-04-091-0/+4
| | | | | | | | | | | | | | | | Recent upstream changes made the failure of symlink(2) when extracting from an archive a fatal error. The busybox-w32 implementation of symlink(2) always fails. Just issue a warning and move on.
* | ps: obtain applet names from other BusyBox processesRon Yorston2018-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the code which passed applet names to child processes using environment variables. This only allowed ps to display names for its ancestors. Instead attempt to read applet names from the memory of unrelated processes. The Microsoft documentation alone wasn't enough to figure out how to do this. Additional hints from: https://stackoverflow.com/questions/4298331/exe-or-dll-image-base-address https://stackoverflow.com/questions/14467229/get-base-address-of-process
* | fsync: avoid a gratuitous difference from upstreamRon Yorston2018-04-031-0/+1
| | | | | | | | | | Move the definition of O_NOCTTY to mingw.h so that fsync.c is the same as upstream.
* | win32: improvements to get_terminal_width_heightRon Yorston2018-04-031-2/+0
| | | | | | | | | | | | | | | | - move winansi_get_terminal_width_height from winansi.c to ioctl.c, the only caller; - check both stdout and stderr for a connection to a console; - omit unnecessary code in get_terminal_width_height (because the WIN32 implementation ignores the file descriptor).
* | ash: reinstate applet name variable after forkshellRon Yorston2018-04-031-0/+1
| | | | | | | | | | | | When 'sh --forkshell' is invoked the BB_APPLET_<pid> environment variable is set, but then it's cleared when the environment of the child process is restored. Reinstate it in reinitvar.
* | Merge branch 'busybox' into mergeRon Yorston2018-04-021-15/+16
|\|
| * libbb: new function bb_die_memory_exhaustedDenys Vlasenko2018-04-011-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta bb_die_memory_exhausted - 10 +10 xstrdup 28 23 -5 xsetenv 27 22 -5 xrealloc 32 27 -5 xputenv 22 17 -5 xmalloc 30 25 -5 xfdopen_helper 40 35 -5 xasprintf 44 39 -5 wget_main 2387 2382 -5 open_socket 54 49 -5 glob_brace 419 414 -5 bb_get_chunk_from_file 146 141 -5 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/11 up/down: 10/-55) Total: -45 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: prevent overflow of length from bb_get_chunk_from_fileQuentin Rameau2018-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fragment did not work right: temp = bb_get_chunk_from_file(fp, &len); if (temp) { /* len > 0 here, it's ok to do temp[len-1] */ char c = temp[len-1]; With "int len" _sign-extending_, temp[len-1] can refer to a wrong location if len > 0x7fffffff. Signed-off-by: Quentin Rameau <quinq@fifth.space> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ps: clear status for each processRon Yorston2018-03-281-3/+4
| | | | | | | | | | | | | | | | | | The original procps_scan function takes care to clear the status information before handling each process. Do the same for the WIN32 version. This requires moving the snapshot handle to the part of the structure that isn't cleared on each iteration.
* | win32: changes to kill(2)Ron Yorston2018-03-271-0/+2
| | | | | | | | | | | | | | | | | | The names of the callbacks to kill processes with a given signal were confusing because they referred to the implementation rather than the intent. Create the new function kill_SIGTERM_by_handle which is more efficient when a handle to the process to be killed is already available.
* | win32: save a few bytes in device file supportRon Yorston2018-03-231-2/+4
| |
* | 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>