ak4good has asked for the wisdom of the Perl Monks concerning the following question:
Total beginner here. I need a cgi script to run as root to recursively change file permissions. I slapped something together from examples, but Apache complains:
Insecure dependency in chmod while running setuid at /var/www/cgi-bin/ +set-perms.pl line 13., referer: https://example.com/cgi-bin/
This is the script:
#!/usr/bin/perl -wT BEGIN { $ENV{PATH} = ""; } use strict; use File::Find; $|++; my $baseDir = "/var/www/test/"; my $modeFile = oct(664); my $modeDir = oct(2775); sub setperms { chmod($modeFile, $_) if(-f $_); <------/line 13/ chmod($modeDir, $_) if(-d $_); chown(-1, 1005, $_); } find(\&setperms, "$baseDir");
Please help... :(
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Insecure dependency in chmod while running setuid
by Corion (Patriarch) on Jun 12, 2009 at 08:25 UTC | |
by afoken (Chancellor) on Jun 12, 2009 at 09:06 UTC | |
by ak4good (Initiate) on Jun 13, 2009 at 04:18 UTC | |
|
Re: Insecure dependency in chmod while running setuid
by JavaFan (Canon) on Jun 12, 2009 at 09:47 UTC | |
|
Re: Insecure dependency in chmod while running setuid
by tweetiepooh (Hermit) on Jun 12, 2009 at 11:08 UTC | |
by ak4good (Initiate) on Jun 13, 2009 at 04:11 UTC |