Re: [PATCH] execve.2: add more detail about Shebangs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Shawn,

On 3/22/19 12:23 AM, Shawn Landden wrote:
> Signed-off-by: Shawn Landden <shawn@xxxxxxx>
> ---
>  man2/execve.2 | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/man2/execve.2 b/man2/execve.2
> index a052f34b0..c363214c0 100644
> --- a/man2/execve.2
> +++ b/man2/execve.2
> @@ -336,6 +336,14 @@ For portable use,
>  should either be absent, or be specified as a single word (i.e., it
>  should not contain white space); see NOTES below.
>  .PP
> +The maximum length of the shebang line is 128 bytes, and excess bytes will be truncated.
> +.\" https://lwn.net/Articles/779997/ The case of the supersized shebang
> +The interpreter is passed the absolute filename to the file. There is no way to get the argv[0]
> +that was passed to the kernel via execve(2).
> +.\" See the P - preserve-argv[0] option.
> +.\" Documentation/admin-guide/binfmt-misc.rst
> +.\" https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html
> +.PP
>  Since Linux 2.6.28,
>  .\" commit bf2a9a39639b8b51377905397a5005f444e9a892
>  the kernel permits the interpreter of a script to itself be a script.

Thanks!

I've applied most of this patch, except for the first changed line,
and made some further tweaks.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux