aboutsummaryrefslogtreecommitdiff
path: root/vhostcname/vhostcname
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2019-08-24 22:35:19 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2019-08-24 22:35:19 +0300
commit0b8f6e1e6251758ccdcc9bcf102a67a9e39dd54a (patch)
treeab186003cbf9e3a5a12726d3c461718f069ed3ec /vhostcname/vhostcname
parent9aa788734ab432ef374e88cf550cb8577bdfbfc2 (diff)
downloaddnstools-0b8f6e1e6251758ccdcc9bcf102a67a9e39dd54a.tar.gz
dnstools-0b8f6e1e6251758ccdcc9bcf102a67a9e39dd54a.tar.bz2
Fix the mess with logical conjunction and disjunction
Diffstat (limited to 'vhostcname/vhostcname')
-rwxr-xr-xvhostcname/vhostcname22
1 files changed, 11 insertions, 11 deletions
diff --git a/vhostcname/vhostcname b/vhostcname/vhostcname
index 78d0a4c..4b6b701 100755
--- a/vhostcname/vhostcname
+++ b/vhostcname/vhostcname
@@ -108,8 +108,8 @@ sub check_mandatory {
my $err = 0;
while (my ($k, $d) = each %{$kw}) {
if (ref($d) eq 'HASH'
- and $d->{mandatory}
- and !exists($section->{$k})) {
+ && $d->{mandatory}
+ && !exists($section->{$k})) {
if (exists($d->{section})) {
if ($s) {
err("$loc: mandatory section [$k] not present");
@@ -170,7 +170,7 @@ sub readconfig {
if (ref($param{kw}) eq 'HASH') {
if (defined($rootname)) {
if (ref($param{kw}{$rootname}) eq 'HASH'
- and exists($param{kw}{$rootname}{section})) {
+ && exists($param{kw}{$rootname}{section})) {
$kw = $param{kw}{$rootname}{section};
} else {
err("$file:$line: unknown section");
@@ -216,7 +216,7 @@ sub readconfig {
next;
}
if (exists($x->{check})
- and !&{$x->{check}}($k, $v, "$file:$line")) {
+ && !&{$x->{check}}($k, $v, "$file:$line")) {
++$err;
next;
}
@@ -225,9 +225,9 @@ sub readconfig {
++$err;
next;
}
- } elsif (!exists($x->{var}) and
- !exists($x->{parser}) and
- !exists($x->{mandatory})) {
+ } elsif (!exists($x->{var})
+ && !exists($x->{parser})
+ && !exists($x->{mandatory})) {
err("$file:$line: unknown keyword $k");
++$err;
next;
@@ -261,7 +261,7 @@ sub valid_domain_name {
foreach my $label (split(/\./, $name)) {
$label =~ s/-+/-/g;
$label =~ s/[a-zA-Z0-9]-[a-zA-Z0-9]//g;
- return 0 if $label =~ /^-/ or $label =~ /-$/;
+ return 0 if $label =~ /^-/ || $label =~ /-$/;
return 0 if $label =~ /[^a-zA-Z0-9]/;
}
return 1;
@@ -293,7 +293,7 @@ sub get_cnames($) {
}
foreach my $z (keys %{$config{zone}}) {
if ($name =~ /.*\.$z$/) {
- if ($name =~ /^\*\.(.+)/ and $1 eq $z) {
+ if ($name =~ /^\*\.(.+)/ && $1 eq $z) {
err("$file:$line: $name: first-level wildcard");
next;
}
@@ -596,7 +596,7 @@ my %comtab = (
sub getcom {
my $com = shift;
- while (exists($comtab{$com}) and ref($comtab{$com}) ne 'CODE') {
+ while (exists($comtab{$com}) && ref($comtab{$com}) ne 'CODE') {
die "internal error: unresolved command alias"
unless exists $comtab{$com};
$com = $comtab{$com};
@@ -696,7 +696,7 @@ readconfig($config_file, \%config, kw => \%kw);
unless (exists($config{core}{'apache-config-directory'})) {
foreach my $dir ("/etc/apache2", "/etc/httpd") {
- if (-e "$dir/sites-enabled" and -e "$dir/sites-available") {
+ if (-e "$dir/sites-enabled" && -e "$dir/sites-available") {
$config{core}{'apache-config-directory'} = $dir;
last;
}

Return to:

Send suggestions and report system problems to the System administrator.