From what I can see... ditch this script.

  • It is for a "PERL 5-enabled web site". What ever that is :)
  • It uses cgi-lib, this is terrible. It is perl 4 code and has not been supported for 4 to 5 years
  • They are making you pay for it (not that I am against that, but that is usually a red-flag to me that these guy/girls do not know what they are doing, especially since the functionality is trivial).
  • The functionality they offer is minimal.
  • and the topper is they require permissions at 777. (if you had this on my server I would shut down your account)

    Run, don't walk away from this script.

    UPDATE: this is basically parsing routine
    my $cache = 'blah=hi;cat /etc/passwd'; @pairs = split(/&/, $cache); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; if (defined($FORM{$name})){ $FORM{$name}.="\0"; } $FORM{$name} .= &strip($value); } sub strip { my($cheese)= @_; $cheese =~ s/\t/&nbsp;/g; $cheese =~ s/\|//g; $cheese =~ s/\r//g; # should use this. $cheese =~ s/\n/<P>/g; # should use this. $cheese =~ s/%95/<li>/g; $cheese =~ s/"<P><P>"/<P>/g; return ($cheese); }
    Pardon me if I'm wrong but this does not strip out ;'s which gets really bad since I just spotted.
    $directory_size = `du -s $target/$where `;


    grep
    grep> cd pub grep> more beer

    In reply to Re: cgi.pm file upload script by grep
    in thread cgi.pm file upload script by wolverina

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.