- or download this
die "Usage: permmy -[itcad] [directory] -f config-file\n"
unless @ARGV >= 3;
use vars qw/ $opt_t $opt_c $opt_d $opt_i $opt_f $opt_a/;
getopts('tcdi:f:a:') or die "Usable options are -tcifa: $!\n";
- or download this
sub usage {
my $text = <<USAGE;
...
print $text;
exit 0;
}
- or download this
if ($opt_t || $opt_d || $opt_c)
{
...
{
...
}
- or download this
exit 0;
# --- subroutines
- or download this
if ($opt_d) {
configtest();
...
configtest();
changeperms(); # or whatever this actually does
}
- or download this
if (valid($foo)) { ... }
- or download this
if ($obj->valid) { ... }
- or download this
validate($foo); # dies if invalid
- or download this
sub configurator ($$$$)
{
...
exit;
close CONFIG or die "Could not close config file $conf_file: $!\n"
+;
}
- or download this
my $nice_mode = &return_mode($mode);
- or download this
sub change_mode ($$)
{
...(oct($change_value) != oct($c_nice_mode))...
}
- or download this
chown($num_uid, -1, $the_file) or warn "Could not change owner
+ of $the_file: $!\n";
print "Changed owner of $the_file from $c_pwuid to $change_val
+ue\n";
- or download this
if (chown(...)) {
print "success";
} else {
warn "failure";
}
- or download this
chown(...) or do { warn "failure"; return };
print ...
- or download this
if ($testy eq "dir-mode") { $d_mode = $config{$tes
+t}{$tester}{$testy} }
elsif ($testy eq "file-mode") { $f_mode = $config{
+$test}{$tester}{$testy} }
...
- or download this
elsif ((-d $_) && ($d_uid))