Skip to content

Commit

Permalink
Handle IPv6 addresses in access control
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Mar 2, 2024
1 parent 9482646 commit 7e6f4f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions virtualmin-nginx-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,8 @@ sub nginx_access_parse
&check_ipaddress($addr) ||
$addr =~ /^(\S+)\/(\d+)$/ &&
&check_ipaddress("$1") && $2 > 0 && $2 <= 32 ||
&check_ip6address($addr) ||
$addr =~ /^(\S+)\/(\d+)$/ && &check_ip6address("$1") ||

This comment has been minimized.

Copy link
@iliajie

iliajie Mar 24, 2024

Contributor

Jamie, can you explain more about $addr =~ /^(\S+)\/(\d+)$/ and what is it checking here exactly? I mean, against which string?

This comment has been minimized.

Copy link
@jcameron

jcameron Mar 24, 2024

Author Collaborator

It's looking for an IPv6-format address and mask like fe80::80f2:5bff:fe05:b36f/64

&error(&text('access_eaddr', $addr));
}
push(@obj, { 'name' => $mode,
Expand Down

4 comments on commit 7e6f4f9

@iliajie
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, alright! Could you tag another release then to include those two latest commits?

@jcameron
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iliajie
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duh, I didn't update module.info file. Let me do it now, and you can retag it.

@iliajie
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, perfect! You already did it! Thanks! All good!

Please sign in to comment.