Hello,

On 2023/11/19 11:34, Vincent Lefevre wrote:
I've reported the following bug on

   https://github.com/termux/termux-packages/issues/18537

Since this is specific to svn, I'm reporting it here too.
In particular, I'm wondering what special thing svn does
to trigger the failure compared to the shell.

With "svn diff", I use the --diff-cmd option with my own diff utility,
which is a script that runs an interpreter using /usr/bin/env. I use
this config on various machines, including on my Android phones in
Termux. After the upgrade to Android 14, this is no longer working.

"svn diff --diff-cmd ..." on Unix platforms uses execvp(3) through
svn_io_run_diff2(), svn_io_run_cmd() (inherit == TRUE),
svn_io_start_cmd3(), and apr_proc_create(), and no special
treatment about environment variables.

So I think there is nothing about svn specific things, and nothing
can be done in Subversion's side.

Note about the use of "/usr/bin/env": with the actual script, this is
actually "#!/usr/bin/env zsh" with the goal of using the same script
on various platforms (where zsh can be at various places).

If all of

* "#!/bin/sh" works fine
* PATH environment variable is not restricted through execvp(3),
  execve wrapper, and true execve(2)
* zsh is in the directoris listed in inherited PATH environment variable
* $0 is properly set to the accessible absolute path of the script
* invoked zsh can access to $0

are satisfied, below may work.

[[[
#!/bin/sh
if [ ! -n ${ZSH_VERSION} ]; then
    exec zsh "$0" "$@"
fi
...
]]]

Cheers,
--
Yasuhito FUTATSUKI <futat...@yf.bsdclub.org>

Reply via email to