On Wed, Apr 6, 2011 at 12:19 PM, Cyril Hrubis <[email protected]> wrote:
> Hi!
>> > Not all systems have /bin/true. It would be better to do:
>> >
>> > /bin/sh -c ':'
>> >
>> > etc, as we have code that depends on this type of shell-required POSIX 
>> > behavior.
>> >
>> I'm sorry for I cannot figure out how to do this way. I tried, but
>> cannot crash unpatched kernel anymore. So I think the simple workaround
>> is checking if /bin/true installed in the program:
>
> It should as simple as execve("/bin/sh -c ':'", c, c), or that didn't work?

execve doesn't work that way. It should be:

execve("/bin/sh", "sh", "-c", ":");

> What about "/bin/sh -c ''" ?

That just seems like one's trying to be clever and that might not work
with all shells.

Thanks,
-Garrett

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to