fakechroot icon indicating copy to clipboard operation
fakechroot copied to clipboard

execvp does not fall back to /bin/sh

Open jasonqsong opened this issue 1 year ago • 1 comments

based on man execvp in ubuntu linux

If the header of a file isn't recognized (the attempted execve(2) failed with the error ENOEXEC), these functions will execute the shell (/bin/sh) with the path of the file as its first argument. (If this attempt fails, no further searching is done.)

The fakechroot version of execvp does not fall back to /bin/sh, it directly throws the error to the caller.

This is critical because it breaks apt install -> dpkg-preconfigure -> purl exec ("/tmp/package.tmp.XXXXXX", "configure", "version") chain for packages config script without shebang line. (e.g. libssl1.1)

jasonqsong avatar Feb 01 '24 20:02 jasonqsong

Can you provide a more minimal and reproducible test-case for this issue?

josch avatar Apr 14 '24 16:04 josch