#! /usr/bin/perl -w # # # Set the right permission where it has to be on a wen site !!! # # Execution for .cgi and read for all html files ! # # # (c) 1998 Emmanuel PIERRE # epierre@maile-nef.com # http://www.e-nef.com/users/Emmanuel.PIERRE # print "Changing permissions on $ARGV[0]\n"; chmod 0755,$ARGV[0]; $whereami=`pwd`; chomp($whereami); push @dir,$whereami."/".$ARGV[0]; while ($dirs=pop @dir) { $whereami=`pwd`; chomp($whereami); chomp($dirs); chdir $dirs; print "changing to $dirs\n"; while (<*>) { next if ($_ eq "."); next if ($_ eq ".."); if (-d $_) { next if (-l $_); chmod 0755,$_; push @dir,$dirs."/".$_; #print "pushing ".$dirs."/".$_."\n"; } else { if (/.*\.cgi/) { chmod 0755,$_; } else { chmod 0744,$_; } } } chdir $whereami; #print "changing to $dirs\n"; }