help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Passing script by fd on Linux and setuid scripts


From: Chet Ramey
Subject: Re: [Help-bash] Passing script by fd on Linux and setuid scripts
Date: Mon, 1 Aug 2016 21:03:51 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 8/1/16 8:11 AM, Petr Skočík wrote:
> Hi.
> 
> The bash reference mentions that /dev/fd/* files are treated specially,
> as filedescriptors, when used in conditionals.

They're not treated specially on Linux, which provides /dev/fd (or its
close relation, /proc/self/fd) directly.  There's no reason for bash to
handle it specially as a filename argument.  All that needs to be done
is for the kernel to pass the open file descriptor to bash using the
/dev/fd/N pathname.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]