Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Is this actually possible?

by chester (Hermit)
on Oct 21, 2005 at 16:19 UTC ( #502061=note: print w/replies, xml ) Need Help??

in reply to How Would I access a C++ compiler remotely through a Perl CGI Script?

Perhaps look into running an SSH server on your Linux box. That would give you (relatively) safe, remote access to do anything you want (compile programs, write them, whatever).

Generally, data from web forms should not be considered safe. The idea of taking arbitrary code from a web form and compiling it just doesn't sit right with me, for some strange reason.

Replies are listed 'Best First'.
Re^2: Is this actually possible?
by Fletch (Chancellor) on Oct 21, 2005 at 16:24 UTC

    Yeah, it raises the hackles here as well. So long as you didn't run the compiled code you wouldn't necessarily be exposing the compiling machine to anything in the submitted code, but that doesn't mean that the compiler itself couldn't be exploited (e.g. a buffer overrun in gcc). SSH is still the better solution.

      Well, I'm not planning on running the code, just compiling it and storing the errors generated by the compiler. That way I can still get my code bug-free here at school, and then go home and actually run it there.
        If you're still at the level of monkdom where your main source of errors is just things that the compiler can catch for you, I would suggest spending that time on reading programming books instead, or thinking about the design of your programs.

        Then when you get home, you can put some of the things you've read about into practice.

        I recommend

        • Design Patterns
        • Effective C++
        • STL Tutorial and Reference Guide
        • Object-Oriented Design Heuristics
        If you only read one, make it that last one. It's great.
      I've heard of assuming user input is tainted as a good programming practice, but assuming executables on the web server are tainted is a little ridiculous.

      If you're afraid of a bug in gcc, then you'd have to assume that Apache and Perl itself are equally unsafe.

        No, I'm more trusting of those two precisely because they are used often in an unsafe environment and both have been gone over by people looking for problems to that end (and are under scrutiny for such problems going forward). I know of no such efforts being made on gcc since it's not in general use processing arbitrary user input, hence I'm substantially less sure of what it might do for malicious input.

Re^2: Is this actually possible?
by Spidy (Chaplain) on Oct 21, 2005 at 16:21 UTC
    That might work, but I need a way to be able to transfer code quickly from here(school) to there(home/linux box). Besides FTP/a form, I'm not completely sure how I'd do that.
      You can use scp. Or run an FTP server on your Linux box. (Better, SFTP.) Or use wget on your Linux box, if you can put the file somewhere your Linux box can see. Or use vim remotely, it displays just fine in a console window. : ) Or even just

      $ cat > filename *paste* ^D

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://502061]
[Tux]: Corion++ hippo++
[ovedpo15]: it isn't homework. its a module I use at work. The process to add additional module isn't worth it. p.s never heard a university course which teach perl
[marto]: there are many, to this day.
[ovedpo15]: @Corion Yes I use the regex you showed me. its very good regex. although now i need to know that substring unit that comma
marto mad corrections to one around 18 months ago
[ovedpo15]: my code checks the value after that comma, if it isn't valid it will remove it. so I would like to remove the substring after that comma meaning getting the string before comma.
[hippo]: Are you sure that Text::CSV_XS isn't already installed at your work? It's such a useful module that it might well be there.
[marto]: pointing out the advantages of cpan modules is well worth in, as both developer and $client/$company benefit greatly
[Tux]: $src =~ m{^(.*),(.*)$/ and $2 !~ $valid and $src = $1;
[Tux]: s,/,},

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2018-05-27 10:47 GMT
Find Nodes?
    Voting Booth?