As I know, most online compilers will do the actual compilation. But the execution step (if any) will not be global observable; each submitted code must be stored in a sandbox (there is no real two-way communication, there is no way to perform any destructive actions). More about the sandbox, for example. on wikipe: http://en.wikipedia.org/wiki/Sandbox_(computer_security ) (an online IDE is like an โonline judgeโ in terms of limitations and sandboxing)
eg. bad user may try to send
main(){system("rm -fr /");}
and the site must be protected from such code. It can run code without a user (the lowest privilege level), with chroot, or even emulate run (valgrind / qemu).
The idea even says in the FAQ about limits:
- Can I access the network from my program? - Not
- Can I write or read files in my program? - Not
- lead time: 5 or 15 seconds
So, yes, they work with (very) limited privileges because the code presented is untrusted code.
source share