[ale] C question

David Tomaschik david at systemoverlord.com
Fri Apr 5 18:26:19 EDT 2013


Having a shell in between shouldn't be a problem...

Alternatively, set up a pipe, fork(), dup2(pipe_output, STDIN); exec(),
(from parent process) push "stuff" into pipe?


On Fri, Apr 5, 2013 at 1:47 PM, Geoffrey Myers
<lists at serioustechnology.com>wrote:

> Actually, this won't work as it execs a shell.  The binary is suid for a
> particle user and the program being spawned needs to be executed by the
> same user.
>
>
> --
> From my iPhone
> Geoffrey Myers
>
> On Apr 5, 2013, at 3:53 PM, David Tomaschik <david at systemoverlord.com>
> wrote:
>
> Must it be fork/exec specifically?  Seems like popen would be easier...
> popen("somebinary arg1 arg2", "w"); then write stuff to the returned file
> ptr?
>
>
> On Fri, Apr 5, 2013 at 12:33 PM, Geoffrey Myers <
> lists at serioustechnology.com> wrote:
>
>> So, shaking some cobwebs loose here. How do I replace the following:
>>
>> system("echo stuff | somebinary arg1 arg2");
>>
>> With a fork/exec ??
>>
>> (Digging out my old C books....)
>>
>> --
>> From my iPhone
>> Geoffrey Myers
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>>
>
>
>
> --
> David Tomaschik
> OpenPGP: 0x5DEA789B
> http://systemoverlord.com
> david at systemoverlord.com
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>


-- 
David Tomaschik
OpenPGP: 0x5DEA789B
http://systemoverlord.com
david at systemoverlord.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20130405/fcd176c8/attachment.html>


More information about the Ale mailing list