News for hackers. Stuff that matters.
Re:Why bother with argv[0]? by Arch-TK on Tuesday September 03, 2024 @11:25AM (#41435873)
Restricting setting it would break login.

Not that it couldn't be fixed by changing how we handle login shells but still. Worth remembering.

Similarly the busybox situation could be solved by having busybox ship posix shell wrapper scripts which use `#!/bin/busybox sh` as the shebang and simply consist of a line like `exec /bin/busybox ls "$@"`.

Re:Why bother with argv[0]? by zekica on Tuesday September 03, 2024 @12:02PM (#41436270)
You are over-complicating it, you only need `#!/bin/busybox ls` as the entire contents of the file.
Re:Why bother with argv[0]? by Arch-TK on Tuesday September 03, 2024 @03:32PM (#41438327)
This doesn't work. The eventual command would be /bin/busybox ls /path/to/ls/wrapper ...
Re:Why bother with argv[0]? by nrclark on Tuesday September 03, 2024 @11:48AM (#41436110)
It can already do that, afaik. When I last checked, BusyBox supported installations via 4 methods:

  - symlink
  - hardlink
  - shell script wrappers
  - executable binary wrappers around libbusybox
Re:Why bother with argv[0]? by Arch-TK on Tuesday September 03, 2024 @03:34PM (#41438341)
Nice!