Page 1 of 1

C Compiler

Posted: Fri Feb 27, 2004 3:44 am
by S_henry
Hello guys..If can, I want to make an interactive system (website). The user can type (input) the code (for example C language) into the provided area and when click 'Run' button, the system will output the result. Seem like need a compiler. But I absolutely have no idea how to do that. Anybody can help me pls..??

Posted: Fri Feb 27, 2004 4:22 am
by McGruff
You really don't want to do that. I wonder how many viruses would be dumped on the system per minute...

Posted: Fri Feb 27, 2004 5:31 am
by devork
are you setting up honey pots. :)
your server will be down.
why you want to do this?

Posted: Mon Mar 01, 2004 12:40 am
by S_henry
I think that is the way to make my system better because more flexible and dynamic. User can type their code and can just run through my system. So if there got any alternative or solution of this problem? And I also not very clear how viruses would be dumped on the system. Can anybody explain to me pls..

Posted: Mon Mar 01, 2004 4:58 am
by timvw
Just think about what happens if someone submits some code that keeps forking itself... Plenty of other things are possible too. system("rm -rf /") is a nice one too...

Posted: Mon Mar 01, 2004 8:45 pm
by S_henry
Ok. I got it. That's absolutely right. But I don't know 'system("rm -rf /")'. Actually system("rm -rf /") is what?

Posted: Mon Mar 01, 2004 9:04 pm
by redhair
S_henry wrote:Ok. I got it. That's absolutely right. But I don't know 'system("rm -rf /")'. Actually system("rm -rf /") is what?
.... 8O

You really have no idear what "rm" is?

Posted: Mon Mar 01, 2004 10:09 pm
by McGruff
redhair wrote:You really have no idear what "rm" is?
It's more helpful if you explain. That's what we're here for.

[php_man]system()[/php_man] sends commands to the server.

If you've got shell access (can connect with telnet/SSH), track down an internet tutorial and try out some shell commands (with care!).

Posted: Tue Mar 02, 2004 1:40 am
by S_henry
Actually I'm quite new in this field. So thanx a lot for your info. Ok, I'll try it.

Posted: Tue Mar 02, 2004 2:34 am
by McGruff
Sorry, my last post was a bit ambiguous - didn't mean to criticise you S_henry.

Posted: Tue Mar 02, 2004 3:21 am
by S_henry
No, it's ok McGruff, your reply is very good for me. It's a good explanation. I'll try to study about that first. Thanx.[/pg_man][/mysql_man]

Posted: Tue Mar 02, 2004 6:49 am
by redhair
McGruff wrote:It's more helpful if you explain. That's what we're here for.
Sorry Gruff, I just wanted to be sure before I go explain what a simple command is/ does.

Typing "rm --help" in your shell results in this:

Code: Select all

їredhair@hal9000 redhair]$ rm --help
Usage: rm їOPTION]... FILE...
Remove (unlink) the FILE(s).

  -d, --directory       unlink FILE, even if it is a non-empty directory
                          (super-user only)
  -f, --force           ignore nonexistent files, never prompt
  -i, --interactive     prompt before any removal
  -r, -R, --recursive   remove the contents of directories recursively
  -v, --verbose         explain what is being done
      --help     display this help and exit
      --version  output version information and exit

To remove a file whose name starts with a `-', for example `-foo',
use one of these commands:
  rm -- -foo

  rm ./-foo

Note that if you use rm to remove a file, it is usually possible to recover
the contents of that file.  If you want more assurance that the contents are
truly unrecoverable, consider using shred.

Report bugs to <bug-coreutils@gnu.org>.
There you go.

It's the UNIX equivalent of DOS' "DEL".

Pointless to say to be VERY carefull with this command.