[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: That '[' file in /usr/bin
From: |
H. Peter Anvin |
Subject: |
Re: That '[' file in /usr/bin |
Date: |
Sun, 03 Mar 2013 16:01:52 -0800 |
User-agent: |
K-9 Mail for Android |
The kernel will never pass that; that will fail at the exec side.
Mike Frysinger <address@hidden> wrote:
>On Sunday 03 March 2013 14:03:24 H. Peter Anvin wrote:
>> On 03/03/2013 02:53 AM, Pádraig Brady wrote:
>> >> personally, i find it a bit ironic that a lot of GNU apps
>(including
>> >> coreutils) simply abort() themselves when argv[0]==NULL
>considering the
>> >> project's hard line position about not relying on argv[0] for
>behavior.
>> >
>> > This issue was mentioned here:
>> >
>http://lists.gnu.org/archive/html/bug-coreutils/2009-11/msg00215.html
>> >
>> > The problem with avoiding the aborts is that NULL is only
>> > one of many invalid values for argv[0]
>>
>> Come again?
>>
>> You can't seriously say that checking for a null pointer or an
>invalid
>> string (for whatever definition of "valid" you happen to have) is
>hard.
>
>he's saying that, why special case NULL if we think this scenario is
>invalid.
>a pointer of argv[0] = 1 will crash just as hard.
>-mike
--
Sent from my mobile phone. Please excuse brevity and lack of formatting.