--- loncom/build/verifymodown.pl 2001/11/17 22:46:00 1.1 +++ loncom/build/verifymodown.pl 2001/12/06 23:14:33 1.2 @@ -5,9 +5,9 @@ # verifymodown.pl - script to enforce file mode and ownership # # YEAR=2001 -# 11/17 Scott Harrison +# 11/17,12/6 Scott Harrison # -# $Id: verifymodown.pl,v 1.1 2001/11/17 22:46:00 harris41 Exp $ +# $Id: verifymodown.pl,v 1.2 2001/12/06 23:14:33 harris41 Exp $ ### my $filename=shift @ARGV; @@ -19,6 +19,8 @@ my $arguments=shift @ARGV; my ($user)=($arguments=~/\-o (\S+)/); my ($group)=($arguments=~/\-g (\S+)/); my ($mode)=($arguments=~/\-m (\S+)/); +my $nofix; +$nofix=1 if $arguments=~/\-N/; my $currentmode=(stat($filename))[2]; my $currentuser=getpwuid((stat($filename))[4]); @@ -31,9 +33,13 @@ unless (-l $filename) { $cflag.="[MODE IS $currentmode SHOULD BE $mode]" if $mode ne $currentmode; } - $cflag.="[USER IS $currentuser SHOULD BE $user]" if $user ne $currentuser; - $cflag.="[GROUP IS $currentgroup SHOULD BE $group]" - if $group ne $currentgroup; +$cflag.="[USER IS $currentuser SHOULD BE $user]" if $user ne $currentuser; +$cflag.="[GROUP IS $currentgroup SHOULD BE $group]" + if $group ne $currentgroup; + +if ($nofix) { + print $cflag; exit; +} if ($cflag) { `chmod $mode $filename`;