mirror of
https://github.com/webmin/webmin.git
synced 2026-06-04 20:30:22 +01:00
Exclude ProhibitLeadingZeros from perlcritic, use .perlcriticrc
This commit is contained in:
6
.perlcriticrc
Normal file
6
.perlcriticrc
Normal file
@@ -0,0 +1,6 @@
|
||||
severity = 5
|
||||
|
||||
# Octal file permission literals (0700, 0640, etc.) are the standard Perl
|
||||
# idiom for chmod/mkdir/permission helpers throughout this codebase. The
|
||||
# policy flags chmod 0700 itself, so it is too coarse for our use.
|
||||
[-ValuesAndExpressions::ProhibitLeadingZeros]
|
||||
@@ -37,7 +37,7 @@ my %link = ( 'id' => &generate_random_id(),
|
||||
'user' => $wuser->{'name'},
|
||||
'uuser' => $unixuser, );
|
||||
$link{'id'} || &error($text{'forgot_erandom'});
|
||||
&make_dir($main::forgot_password_link_dir, 0700); ## no critic (ProhibitLeadingZeros)
|
||||
&make_dir($main::forgot_password_link_dir, 0700);
|
||||
my $linkfile = $main::forgot_password_link_dir."/".$link{'id'};
|
||||
&lock_file($linkfile);
|
||||
&write_file($linkfile, \%link);
|
||||
|
||||
@@ -73,7 +73,7 @@ else {
|
||||
&save_module_acl(\%maccess, $in{'_acl_user'},
|
||||
$in{'_acl_mod'},1);
|
||||
}
|
||||
&set_ownership_permissions(undef, undef, 0640, $aclfile); ## no critic (ProhibitLeadingZeros)
|
||||
&set_ownership_permissions(undef, undef, 0640, $aclfile);
|
||||
&unlock_file($aclfile);
|
||||
|
||||
if ($in{'_acl_group'}) {
|
||||
|
||||
@@ -131,7 +131,7 @@ if ($in{'old'} && $in{'acl_security_form'}) {
|
||||
my $aclfile = "$config_directory/$in{'name'}.gacl";
|
||||
&lock_file($aclfile);
|
||||
&save_group_module_acl(\%uaccess, $in{'name'}, "", 1);
|
||||
&set_ownership_permissions(undef, undef, 0640, $aclfile); ## no critic (ProhibitLeadingZeros)
|
||||
&set_ownership_permissions(undef, undef, 0640, $aclfile);
|
||||
&unlock_file($aclfile);
|
||||
}
|
||||
|
||||
|
||||
@@ -378,7 +378,7 @@ if ($in{'acl_security_form'} && !$newgroup && !$in{'safe'}) {
|
||||
$uaccess{'rpc'} = $in{'rpc'};
|
||||
&lock_file($aclfile);
|
||||
&save_module_acl(\%uaccess, $in{'name'}, "", 1);
|
||||
&set_ownership_permissions(undef, undef, 0640, $aclfile); ## no critic (ProhibitLeadingZeros)
|
||||
&set_ownership_permissions(undef, undef, 0640, $aclfile);
|
||||
&unlock_file($aclfile);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +51,7 @@ if (!@files) {
|
||||
}
|
||||
|
||||
my $critic = Perl::Critic->new(
|
||||
-severity => 5,
|
||||
-profile => '',
|
||||
-profile => "$bindir/../../.perlcriticrc",
|
||||
);
|
||||
|
||||
foreach my $file (@files) {
|
||||
|
||||
@@ -46,8 +46,7 @@ if (!@files) {
|
||||
}
|
||||
|
||||
my $critic = Perl::Critic->new(
|
||||
-severity => 5,
|
||||
-profile => '',
|
||||
-profile => "$bindir/../../.perlcriticrc",
|
||||
);
|
||||
|
||||
foreach my $file (@files) {
|
||||
|
||||
Reference in New Issue
Block a user