Re: Bug report for the man page execve(2), the paragraph Interpreter scripts
From: Alejandro Colomar <alx@kernel.org>
Date: 2025-08-03 17:23:28
Attachments
- signature.asc [application/pgp-signature] 833 bytes
From: Alejandro Colomar <alx@kernel.org>
Date: 2025-08-03 17:23:28
Hi Nikola, On Sun, Aug 03, 2025 at 06:50:49PM +0300, Никола Константинов Кралев wrote:
Hello,
with some manual testing, when a large optional-arg is placed I can
see that the byte count limit is not 255/127 characters (since/before
Linux 5.1) after the first two bytes of the file being "#!" these, but
the actual count limit is 255 characters starting at file offset zero.
So, technically, the largest possible full path that can be placed as
the interpreter is (255 - strlen("#!")) bytes long.Would you mind showing a test that demonstrates this?
Meaning that, the execve(2) man page https://www.man7.org/linux/man-pages/man2/execve.2.html should be corrected to something like: The kernel imposes a maximum length on the text that follows the "#!" characters at the start of a script; characters beyond the limit are ignored. Before Linux 5.1, the limit is 127 characters including the "#!" characters at the start. Since Linux 5.1, the limit is 255 characters including the "#!" characters at the start.
Sounds good.
Should I manually send a pull request and edit the plaintext man page from its git repository? Or will the man page maintainers correct that?
Yes, you're welcome to send a patch! Please have a look at <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING> <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING.d> Have a lovely day! Alex -- <https://www.alejandro-colomar.es/>