Executing Files (without shell)

T

thefed

Once again, a similarly themed question from me:

Is it possible (without syscall ) to execute a file without using a
shell?


Thanks
_______________________________|
- Ari
I just bought another case of RockStar. Expect architectural changes.
 
K

Ken Bloom

Once again, a similarly themed question from me:

Is it possible (without syscall ) to execute a file without using a
shell?

Calling Kernel#system will sometimes fork a shell if you pass it
something complicated like pipelines, but you can be guaranteed that it
won't spawn a shell (it will execve the binary directly) if you pass the
binary name and the command line arguments as separate parameters. (E.g.
system("echo","hello","world") Likewise if you're running a binary that
takes no parameters so there's only one string being passed as a
parameter.

--Ken
 
T

thefed

Calling Kernel#system will sometimes fork a shell if you pass it
something complicated like pipelines, but you can be guaranteed
that it
won't spawn a shell

Guarenteed? Are you certain? I just want to be sure....



-------------------------------------------------------|
~ Ari
crap my sig won't fit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top