Hang when trying to access a privileged port without permission
Running a test as an unprivileged user (i.e. without "sudo") on the latest version of master with the following "options" statement:
options {
directory "/home/jenkins/workspace/bind9-nsd-axfr/interop/bind/work";
allow-query { any ; };
allow-notify { 10.53.0.1 ; } ;
listen-on port 5300 { 10.53.0.1 ; } ;
pid-file "/home/jenkins/workspace/bind9-nsd-axfr/interop/bind/work/named.pid";
};
(Note that as no "listen-on-v6" is specified, BIND will attempt to listen on all IPv6 interfaces on the default privileged port 53.) In 9.15.5 or earlier, when an unprivileged BIND starts and attempts open port 53 on an IPv6 interface, it fails with a permission problem and continues the initialization, e.g.
12-Dec-2019 16:26:28.179 using default UDP/IPv4 port range: [32768, 60999]
12-Dec-2019 16:26:28.179 using default UDP/IPv6 port range: [32768, 60999]
12-Dec-2019 16:26:28.180 listening on IPv6 interfaces, port 53
12-Dec-2019 16:26:28.188 could not listen on UDP socket: permission denied
12-Dec-2019 16:26:28.188 listening on all IPv6 interfaces failed
12-Dec-2019 16:26:28.188 listening on IPv4 interface lo, 10.53.0.1#5300
12-Dec-2019 16:26:28.190 generating session key for dynamic DNS
(.. and then reports a failure to open the port on the IPv6 interfaces every few seconds thereafter). In the latest version of "master" (commit 6f3fdf36), the behavior has changed: it hangs after outputting the message:
listening on IPv6 interfaces, port 53
The problem is easily overcome (e.g. specify "-4" on the command line). Nevertheless, BIND should not hang if it encounters a permission problem.
The test was run on a Fedora 30 system.