On (09/01/03 17:35), Alex Blum wrote:
> ok. there's two options:
> 2. I fix this.

Good choice!

> can someone help me please? I'm stuck with this, and don't know, how to
> solve the problem. just in case: I did read the
> "Chapter 23. Security" of programming perl (3rd edition) and still don't
> know any way out of this...

First, you need to realize why Perl is die'ing with taintmode errors. If
you haven't figured that out, it is becuase you are gathering the list
of files by reading a directory in the following line:

>       my @files = readdir DIR;

Now, everything in the @files array is considered tainted by Perl. To
untaint, you pass your data through a regex as follows (untested!):

my @cleanfiles;
foreach my $file (@files) {
        $file =~ /^(\w\.)+$/; # allow only alphanum and dot
        push @cleanfiles, $1;
}

Try working with the above to see if you can get your array untainted
*before* passing it off to chmod.


Good luck,
William

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to