2009/327 [system_noshell]
Casper.Dik at sun.com
Casper.Dik at sun.com
Fri May 29 15:33:46 PDT 2009
>Glenn Skinner wrote:
>> I think it would be helpful to see a few worked examples that show how
>> system_noshell() and its variants make things simpler than using
>> posix_spawn().
>>
>> Date: Fri, 29 May 2009 10:41:30 -0700
>> From: Sumanth Naropanth <Sumanth.Naropanth at sun.com>
>> Subject: Re: system_noshell [PSARC/2009/327 FastTrack timeout
>> 06/05/2009]
>>
>> ...
>>
>> system_noshell("/bin/rm /tmp/tmpfile") is simpler than
>> posix_spawn(pid, "rm", NULL, NULL, argv, NULL) which also includes
>> populating an argv vector.
>>
>> The example given above is a start, but I'd like to see something more
>> realistic.
>>
>>
>Yes. In the case above, unlink("/tmp/tmpfile") would be better than
>either, and a lot more efficient! :-)
Quite; and what if the argument is "/tmp/tmpfile /etc/shadow"?
if we do that, it's still an unsafe interface.
Casper
More information about the opensolaris-arc
mailing list