这是indexloc提供的服务,不要输入任何密码
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: termux/termux-exec-package
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.2.0
Choose a base ref
...
head repository: termux/termux-exec-package
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 18 commits
  • 38 files changed
  • 1 contributor

Commits on Mar 26, 2025

  1. Configuration menu
    Copy the full SHA
    3f3a69f View commit details
    Browse the repository at this point in the history
  2. Changed: Use standardized format for version string output as per the…

    … `<component_name> version=<name> org=<name> project=<name>` format
    agnostic-apollo committed Mar 26, 2025
    Configuration menu
    Copy the full SHA
    f9deee2 View commit details
    Browse the repository at this point in the history
  3. Fixed(ExecIntercept_RuntimeBinaryTests): Do not log failure logs to s…

    …tdout of parent and log them to original stderr of child, otherwise they would get captured in `output` of parent and compared with `output_regex`
    agnostic-apollo committed Mar 26, 2025
    Configuration menu
    Copy the full SHA
    0f0866e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4064813 View commit details
    Browse the repository at this point in the history
  5. Added(ExecIntercept_RuntimeBinaryTests): Allow not running ExecLP, …

    …`ExecVP` and `ExecVPE` tests by setting `file` to `NULL`
    agnostic-apollo committed Mar 26, 2025
    Configuration menu
    Copy the full SHA
    9e0f4b2 View commit details
    Browse the repository at this point in the history
  6. Added(ExecIntercept_RuntimeBinaryTests): Allow not comparing exit cod…

    …e by setting `expectedExitCode` to `-1`
    
    This is needed for running specific commands whose exit code can vary on different Android versions, like when getting help output of system executables.
    agnostic-apollo committed Mar 26, 2025
    Configuration menu
    Copy the full SHA
    4ac33b3 View commit details
    Browse the repository at this point in the history
  7. Added(ExecIntercept_RuntimeBinaryTests): Allow test runner functions …

    …to override init function of child process that runs the test
    agnostic-apollo committed Mar 26, 2025
    Configuration menu
    Copy the full SHA
    5b124c1 View commit details
    Browse the repository at this point in the history
  8. Fixed(ExecIntercept): Return Permission denied (EACCES) if executin…

    …g a non-regular file instead of `Is a directory (EISDIR)` for a directory
    
    Despite `EISDIR` being more appropriate if trying to execute a directory, considering even `bash` and `sh` return the same, `execve` expects `EACCES` as per its  man page.
    
    > EACCES The file or a script interpreter is not a regular file.
    
    - https://man7.org/linux/man-pages/man2/execve.2.html
    
    ```
    ~ $ TERMUX_EXEC__LOG_LEVEL=4 env .
    28077 E termux  : TERMUX_EXEC__VERSION: '1:2.1.0+direct-ld-preload'
    28077 E termux.exec: <----- execve() intercepted ----->
    28077 E termux.exec: executable = '/data/data/com.termux/files/usr/bin/env'
    28077 E termux.exec:    argv[0] = 'env'
    28077 E termux.exec:    argv[1] = '.'
    28077 E termux.exec: Intercepting execve
    28077 E termux.exec: read_file_header: '1'
    28077 E termux.ld-preload: system_linker_exec_mode: '1'
    28077 E termux.ld-preload: android_build_version_sdk: '30'
    28077 E termux.ld-preload: se_process_context_from_file: 'u:r:untrusted_app_27:s0:c212,c256,c512,c768'
    28077 E termux.ld-preload: app_data_file_exec_exempted: '1'
    28077 E termux.ld-preload: system_linker_exec_enabled: '0'
    28077 E termux.exec: unset_ld_vars_from_env: '0'
    28077 E termux.exec: modify_env: '0'
    28077 E termux.exec: modify_args: '0'
    28077 E termux.exec: Calling syscall execve
    28077 E termux.exec: executable = '/data/data/com.termux/files/usr/bin/env'
    28077 E termux.exec:    argv[0] = 'env'
    28077 E termux.exec:    argv[1] = '.'
    28077 E termux  : TERMUX_EXEC__VERSION: '1:2.1.0+direct-ld-preload'
    28077 E termux.exec: <----- execvp() intercepted ----->
    28077 E termux.exec: executable = '/data/data/com.termux/files/usr/bin/.'
    28077 E termux.exec:    argv[0] = '.'
    28077 E termux.exec: Intercepting execve
    28077 E termux.exec: normalized_executable: '/data/data/com.termux/files/usr/bin'
    28077 E termux.exec: read_file_header: '1'
    28077 E termux.exec: Failed to read executable path '/data/data/com.termux/files/usr/bin' for file header: Is a directory
    28077 E termux.exec: <----- execve() failed ----->
    env: ‘.’: Is a directory
    
    ~ $ bash -c './'
    bash: line 1: ./: Is a directory
    
    ~ $ /system/bin/sh -c './'
    /system/bin/sh: ./: can't execute: Is a directory
    ```
    
    Related commit termux/termux-core-package@1779618b
    
    Closes #33
    agnostic-apollo committed Mar 26, 2025
    Configuration menu
    Copy the full SHA
    577ffd9 View commit details
    Browse the repository at this point in the history
  9. Fixed(ExecIntercept): Fix issue on at least on Android <= 7, where …

    …running commands with empty `$LD_PRELOAD` variable, like `LD_PRELOAD= <command>` will fail with `CANNOT LINK EXECUTABLE` errors with a random environment variable `<name=value>` pair or `DT_RUNPATH` directory loaded as a library
    
    ```
    $ LD_DEBUG=3 LD_PRELOAD= bash
    CANNOT LINK EXECUTABLE "bash": can't read file "/data/data/com.termux/files/usr/lib": Is a directory
    [ Android dynamic linker (64-bit) ]
    W  [ LD_PRELOAD set to "" ]
    I  name /data/data/com.termux/files/usr/bin/bash: allocated soinfo @ 0x7f97a24010
    W  [ Linking "/data/data/com.termux/files/usr/bin/bash" ]
    I  [ "" find_loaded_library_by_soname failed (*candidate=n/a@0x0). Trying harder...]
    I  [ opening  ]
    I  name /data/data/com.termux/files/usr/lib: allocated soinfo @ 0x7f97a24240
    D  DEBUG: can't read file "/data/data/com.termux/files/usr/lib": Is a directory
    I  name /data/data/com.termux/files/usr/lib: freeing soinfo @ 0x7f97a24240
    A  CANNOT LINK EXECUTABLE "bash": can't read file "/data/data/com.termux/files/usr/lib": Is a directory
    
    $ LD_PRELOAD="" /system/bin/sh
    CANNOT LINK EXECUTABLE "/system/bin/sh": cant read file "/system/lib64": Is a directory
    ```
    
    ```
    $ LD_DEBUG=3 LD_PRELOAD= bash
    CANNOT LINK EXECUTABLE: library "SHELL=/data/data/com.termux/files/usr/bin/bash" not found
    page record for 0x7f6384688050 was not found (block_size=64)
    W  [ android linker & debugger ]
    I  name bash: allocated soinfo @ 0x7fa61e09b008
    W  [ linking bash ]
    I  [ 'SHELL=/data/data/com.termux/files/usr/bin/bash' find_loaded_library_by_soname returned false (*candidate=n/a@0x0). Trying harder...]
    I  [ opening SHELL=/data/data/com.termux/files/usr/bin/bash ]
    D  DEBUG: library "SHELL=/data/data/com.termux/files/usr/bin/bash" not found
    
     $ LD_PRELOAD= /system/bin/sh
    CANNOT LINK EXECUTABLE: library "_=/system/bin/sh" not found
    
    $ LD_PRELOAD= /system/bin/pm
    CANNOT LINK EXECUTABLE: library "_=/system/bin/pm" not found
    ```
    
    Cause is unknown, but related changes in linker for empty LD_PRELOAD are at:
    - https://cs.android.com/android/_/android/platform/bionic/+/d799b2bb
    - https://cs.android.com/android/_/android/platform/bionic/+/44f6e189
    
    Was found locally before on Android 6 while testing, but ignored. Reported again by @robertkirkman at following:
    - #31 (comment)
    agnostic-apollo committed Mar 26, 2025
    Configuration menu
    Copy the full SHA
    760ff6e View commit details
    Browse the repository at this point in the history
  10. Changed(ExecIntercept): Rename isSystemExecutable() function to `is…

    …ExecutableUnderSystemDir()`
    agnostic-apollo committed Mar 26, 2025
    Configuration menu
    Copy the full SHA
    adf08af View commit details
    Browse the repository at this point in the history
  11. Fixed(ExecIntercept): Fix LD_VARS not being unset for system execut…

    …ables if executed with `fexecve()` or fd path, and their file header being read instead of skipped as per 3300bfb
    
    File descriptor executable paths are in the format `/proc/self/fd/<num>` or `/proc/<pid>/fd/<num>`, normally for `fexecve()`, but can be passed manually by callers. For such paths, checks would fail for if the path is under system directories with `isExecutableUnderSystemDir()` or if `LD_VARS` should be unset with `shouldUnsetLDVarsFromEnv()`, as path would start with `/proc` instead of one of the system directories. Now we find the real path before any checks are done by calling `readlink()` via `getRegularFileFdRealPath()` on the fd path.
    
    Note that `fexecve()` is only supported for Android `>= 9` and `CANNOT LINK EXECUTABLE` errors due to `LD_VARS` being set like `LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib` when calling system binaries only seem to occur on older Android versions. So we simulate `fexecve()` for tests by opening a system executable, generating fd path manually and then executing it.
    
    Following are examples of errors caused by `LD_LIBRARY_PATH` being set. Termux app only exports it for Android `5` and `6` though.
    
    ```
    $ LD_PRELOAD= bash
    
    $ LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib PATH=/system/bin /system/bin/{am,pm}
    CANNOT LINK EXECUTABLE: could not load library "libandroid_runtime.so" needed by "app_process"; caused by could not load library "libhwui.so" needed by "libandroid_runtime.so"; caused by could not load library "libRS.so" needed by "libhwui.so"; caused by could not load library "libbcc.so" needed by "libRS.so"; caused by could not load library "libbcinfo.so" needed by "libbcc.so"; caused by cannot locate symbol "_ZNK4llvm6MDNode10getOperandEj" referenced by "libbcinfo.so"...
    
    $ LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib PATH=/system/bin /system/bin/dalvikvm
    Aborted
    dlopen("libjavacore.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "bn_expand2" referenced by "libjavacore.so"...
    
    LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib PATH=/system/bin /system/bin/{am,pm}
    CANNOT LINK EXECUTABLE: cannot locate symbol "u_charMirror_55" referenced by "/system/lib64/libandroid_runtime.so"...
    
    $ LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib PATH=/system/bin /system/bin/dalvikvm
    Aborted
    art/runtime/runtime.cc:1149] LoadNativeLibrary failed for "libjavacore.so": dlopen failed: cannot locate symbol "_ZTVN6icu_5513UnicodeStringE" referenced by "/system/lib64/libjavacore.so"...
    
    ~ $ LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib PATH=/system/bin /system/bin/{am,pm}
    CANNOT LINK EXECUTABLE "app_process": cannot locate symbol "glTexGenxvOES" referenced by "/system/lib64/libandroid_runtime.so"...
    Aborted
    $ LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib PATH=/system/bin /system/bin/dalvikvm
    Failed to initialize JNI invocation API from (null)
    Failed to dlopen libart.so: dlopen failed: cannot locate symbol "XzUnpacker_Construct" referenced by "/system/lib64/libunwind.so"...
    ```
    agnostic-apollo committed Mar 26, 2025
    Configuration menu
    Copy the full SHA
    4477568 View commit details
    Browse the repository at this point in the history
  12. Release: 2.3.0

    agnostic-apollo committed Mar 26, 2025
    Configuration menu
    Copy the full SHA
    07b0d82 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2025

  1. Added: Add link to 5ea25ee for initial implementation of `system_link…

    …er_exec` in `v2.0.0` release notes
    
    Seems like changes to `src/termux-exec.c` accidentally got removed while rebasing 2fe4775 due to file path changes. So add link to older commit that had the file changes for credits and historical reason.
    
    5ea25ee was modified version of 38a51829 and ecad16fd
    agnostic-apollo committed May 1, 2025
    Configuration menu
    Copy the full SHA
    8885c26 View commit details
    Browse the repository at this point in the history
  2. Fixed: Do not log some debug messages to stderr to keep logging out…

    …put synchronous if `stdout` and `stderr` streams are captured separately as other log entries are being sent to `stdout`
    
    The existence of `stderr` being set can also be considered a failure by clients.
    agnostic-apollo committed May 1, 2025
    Configuration menu
    Copy the full SHA
    8793fc7 View commit details
    Browse the repository at this point in the history
  3. Changed: Move lib/termux-exec_nos_c_tre directory to `lib/termux-ex…

    …ec_nos_c/tre` and `termux/api/termux_exec/ld_preload` sources to `termux/api/termux_exec/service/ld_preload` stage 1
    agnostic-apollo committed May 1, 2025
    Configuration menu
    Copy the full SHA
    f3e7306 View commit details
    Browse the repository at this point in the history
  4. Changed: Move lib/termux-exec_nos_c_tre directory to `lib/termux-ex…

    …ec_nos_c/tre` and `api/termux_exec/ld_preload` sources to `api/termux_exec/service/ld_preload` stage 2
    
    The Termux Runtime Environment `tre` is a variant of the `termux-exec_nos_c` library and so its sources should be under the `tre` sub directory to be consistent with the library naming and directory hierarchy convention. For example, for a `foo_jvm_java` library with the Android App Runtime Environment `aare` and Java Runtime Environment `jre` variants that share common code, the directory hierarchy would be `lib/foo_jvm_java/{share,aare,jre}`, where `share` sub directory contains the common code.
    
    The API service code must exist under the `service` directory like `api/<host>/service/<service_name>` as other directories like `config`/`utils` could exist that are shared between different API services, as they would otherwise conflict with the service name directory.
    agnostic-apollo committed May 1, 2025
    Configuration menu
    Copy the full SHA
    578549c View commit details
    Browse the repository at this point in the history

Commits on May 5, 2025

  1. Release: 2.4.0

    agnostic-apollo committed May 5, 2025
    Configuration menu
    Copy the full SHA
    fc36b43 View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2025

  1. Configuration menu
    Copy the full SHA
    4606100 View commit details
    Browse the repository at this point in the history
Loading