The following sequence in an Apache2 post_config handler gets a taint error:
opendir DIR, DB_DIREC or die "can't open direc ".DB_DIREC.": $!"; my @dels = grep /^__/, readdir(DIR); closedir DIR; for (@dels) {substr($_, 0, 0) = DB_DIREC.'/'} if (@dels) {unlink @dels}
This site runs with taint checking. The code above gets the following fatal error during Apache startup:
[error] Insecure dependency in unlink while running with -T switch at +/usr/local/apache2/plib/Central.pm line 189.
There is nothing like "user input" anywhere near this sequence. Suggestions as to how to get rid of this error will be much appreciated.

Thanks in advance,
cmac
www.animalhead.com

In reply to hard-to-understand taint error by cmac

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.