Hello all, Once again im alittle stuck and my ideas seem to surpass my ability. I'm trying to compare two files that store info on my SUID files for changes and print the details to a web page, im happy with it for the most part, I understand why the output is not produced but have no idea what so ever how to remede the situation.
    #!/usr/bin/perl -w use strict; my $setuidtoday = "/var/log/setuid.today"; my $setuidyest = "/var/log/setuid.yesterday"; my $DIFF = "/usr/bin/diff"; print "Content-type: text/html\n\n"; print "<HTML><TITLE>SET SUID FILE CHECK</TITLE>\n"; print "<BODY BGCOLOR=#000000 Text=#008000 link=#00c000\n"; print "<H1>SET SUID FILE CHECK</H1>\n"; if(-e $setuidtoday && $setuidyest) { print "<H6>Setuid lists exist!</H6>\n"; print `$DIFF $setuidtoday $setuidyest`; } print "</BODY></HTML>";
I believe its this line
print `$DIFF $setuidtoday $setuidyest`;
It works fine at the CLI but the output from diff is not displayed in the webpage, I can see why that is but dont know how to fix the issue... Also if anyone has any improvements please say. The reason I have not used any modules for HTML prasing etc... is because I haven't got that far in my study and i'd like to see what I can code with base perl before I branch out.


In reply to SUID check by n00dles

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.