]> git.proxmox.com Git - pve-http-server.git/commit
access control: avoid "uninitialized value" warning if using IP ranges
authorFriedrich Weber <f.weber@proxmox.com>
Wed, 24 Jan 2024 11:38:56 +0000 (12:38 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 30 Jan 2024 10:11:34 +0000 (11:11 +0100)
commita8dd7b668eed7f983511be0247fd31aa949d98b7
tree6b34b681ba3876856fef53f38dc643cb856b4267
parent38535a67dfeaddd2b6e30f9eb7c03a2f1dd0eb08
access control: avoid "uninitialized value" warning if using IP ranges

ALLOW_FROM/DENY_FROM accept any syntax understood by Net::IP. However,
if an IP range like "10.1.1.1-10.1.1.3" is configured, a confusing
Perl warning is printed to the syslog on a match:

  Use of uninitialized value in concatenation (.) or string at [...]

The reason is that we use Net::IP::prefix to prepare a debug message,
but this returns undef if a range was specified. To avoid the warning,
use Net::IP::print to obtain a string representation instead.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
src/PVE/APIServer/AnyEvent.pm