You are not logged in.
Pages: 1
So....in fortran the code
call system(...)
can perform shell commands [ie call system('rm -f oldfile.dat') ]
Can anyone suggest something similar in C. For example, it would be nice to edit a fortran source code then compile and run it inside of a C program.
Thanks!
Offline
You can check out popen: http://www.space.unibe.ch/comp_doc/c_ma … popen.html
Offline
there is a system() function in C, too:
may the Source be with you
Offline
there is a system() function in C, too:
d'oh
thanks
Offline
But after all .. why are u using the system() call ? Thats exploitable... Use the specific system calls (in this case unlink) otherwise avoid the overhead going to scripts or shell scripts
And, what if the rm command isnt the "remove files or directories" command but a custom script that the admin
wrote as
rm / -fr
or linked to a setuid command ?? uh ?
Last edited by elgatofelix (2008-03-04 21:16:42)
Are u listening?
Offline
But after all .. why are u using the system() call ? Thats exploitable... Use the specific system calls (in this case unlink) otherwise avoid the overhead going to scripts or shell scripts
And, what if the rm command isnt the "remove files or directories" command but a custom script that the admin
wrote asrm / -fr
or linked to a setuid command ?? uh ?
Uh, depending on the context, system calls are perfectly valid:
For example, it would be nice to edit a fortran source code then compile and run it inside of a C program.
Sure, for unlinking a file, system() is a bad idea, but I think miggy was just providing that as an example
Offline
thank you for the warning elgatofelix. Yes, rm was just an example and obviously a poor one.
Offline
Pages: 1