mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Fix protocol detection
This commit is contained in:
@@ -2,3 +2,4 @@ xinetd_conf=/etc/xinetd.conf
|
||||
protocols_file=/etc/protocols
|
||||
pid_file=/var/run/xinetd.pid
|
||||
start_cmd=/usr/local/sbin/xinetd -pid 2>/var/run/xinetd.pid
|
||||
lookup_servs=1
|
||||
|
||||
@@ -57,9 +57,20 @@ foreach $x (@conf) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Only service specified, check all protocols
|
||||
# Only service specified, check protocols based on socket type,
|
||||
# or failing that all protocols
|
||||
if ($config{'lookup_servs'}) {
|
||||
foreach $p (&list_protocols()) {
|
||||
local @protos;
|
||||
if ($q->{'socket_type'}->[0] eq 'stream') {
|
||||
@protos = ( 'tcp' );
|
||||
}
|
||||
elsif ($q->{'socket_type'}->[0] eq 'dgram') {
|
||||
@protos = ( 'udp' );
|
||||
}
|
||||
else {
|
||||
@protos = &list_protocols();
|
||||
}
|
||||
foreach $p (@protos) {
|
||||
@s = getservbyname($x->{'value'}, $p);
|
||||
last if (@s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user