Skip to content

execvp does not fall back to /bin/sh #118

@jasonqsong

Description

@jasonqsong

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions