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: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?

        -is


Home | Main Index | Thread Index | Old Index