tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [PATCH] Fix system() behaviour when parameter is NULL
On Fri, Aug 22, 2008 at 12:20 PM, Ignatios Souvatzis <is%netbsd.org@localhost>
wrote:
> On Fri, Aug 22, 2008 at 12:11:39PM +0300, Andy Shevchenko wrote:
>> On Fri, Aug 22, 2008 at 11:18 AM, Ignatios Souvatzis
>> <is%netbsd.org@localhost> wrote:
>> >> + * ISO/IEC 9899:1999 in 7.20.4.6 describes this special case.
>> >> + * We need to check availability of a command interpreter.
>> >> + */
>> >> + if (command == NULL) {
>> >> + if (access(_PATH_BSHELL, R_OK | X_OK) == 0)
>> > assuming we want to do that: shouldn't checking for X_OK be enough?
>> There is a difference between some readable file and executable one.
> Exactly, that's why I ask. Assuming /bin/sh is 111, it'll still execute,
> but wouldn't that test fail?
Hmm... You probably right.
I don't know the standard about that, but X_OK should be enough for
Linux and NetBSD.
--
With Best Regards,
Andy Shevchenko
Home |
Main Index |
Thread Index |
Old Index