| Summary: | /bin/sh does not work when invoked with argv[0] different from "sh" | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Laszlo Ersek <laszlo.ersek> |
| Component: | Standard Compliance | Assignee: | unassigned |
| Status: | NEW --- | ||
| Severity: | normal | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.35.x | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
|
Description
Laszlo Ersek
2023-03-22 16:01:03 UTC
In parallel, I've opened https://www.austingroupbugs.net/view.php?id=1645; maybe POSIX will be relaxed to allow libc implementations to fall back to execl("/bin/sh", "sh", "-c", ". quoted_file", argv[0], argv[1], ..., NULL) or execl("/bin/sh", "sh", "-c", "exec -a \"$0\" quoted_file \"$@\"", argv[0], argv[1], ..., NULL), at which point busybox can still depend on argv[0] ending in "sh" while passing the correct $0 to the shell script. Let's see what the libc and POSIX folks say... Compliance-wise, it looks like POSIX intends to relax things, so that as long as libc invokes the sh fallback with argv[0] of "sh" (or maybe "/bin/sh"), that is acceptable. Thus, it is no longer as urgent that busybox consider installing a shim that performs shell functionality regardless of argv[0] contents. https://austingroupbugs.net/view.php?id=1645#c6281 |