i doing small project host site similar ideone.com ie host online compiler compile , run code given input.i using ror backend part.
what have done code inputted in textbox stored string , using system calls in ruby create file , storing string in file.similary storing input code in file.again using system calls compile , run file , storing output string , sending front end part.
i have got 2 problems above implemented method 1) work single user @ time.any idea how implement multiple users , if yes limit of number of users? 2) can put malicious code , harm system.i have sandbox environment such run @ isolated environment. how can it?
program running infinity loop not problem have put limit on execution time.i using backtick execute shell script.i implementing c, if succeed solve problems extend other languages.
for sake of not letting people wipe out hard drive, install spambots etc, need run code inside virtual machine, protect host. solves user problem since can spin virtual machine each user , spin down after running code. however, might use lot of resources on server.
i'd interested find out ideone.com does. suspect runs in client's browser, safer since can use server save code, not run it. if runs in browser sandboxed anyway. sure don't want instead? i've never heard of letting people upload code , run on system server. seems kind of insanely risky.
Comments
Post a Comment