On 11/6/24 18:13, Noah Goldstein wrote:
Question about impl regarding handling of `-execfd` with/without a program name.
1) `-execfd` + program name ie: `qemu -execfd <some_fd> ls -a`.
2) `-execfd` without program name i.e: `qemu -execfd <some_fd> -a`.
Do you want to allow both of these? If you want to allow (1), what should
we use for `argv[0]`/`exec_path`. The program pass ("ls") or
`readlink(<some_fd>)`?
The canonical response is, examine the kernel source.
We're not implementing this in a vacuum, you're replicating execveat(2).
I suspect the answer is (1), to be compared with
syscall(__NR_execveat, some_fd, "", &["ls", "-a"], env, AT_EMPTY_PATH);
r~