Description of problem: When an invalid port number that exceeds 0x10000(65536) is specified by the smbd and nmbd command, an improper port number is generated. ** port number definition: unsigned short ex.) specified number: 65537(0x10001) ** generated port number : 1 → 65537(0x10001) - 65536(0x10000) [root@RHEL4U4]# smbd -p 65537 [root@RHEL4U4]# lsof -i COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME ......................................................................... ...... smbd 24449 root 20u IPv4 66689 TCP *:tcpmux (LISTEN) [root@RHEL4U4]# nmbd -p 65537 [root@RHEL4U4]# lsof -i COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME ......................................................................... ...... smbd 24449 root 20u IPv4 66689 TCP *:tcpmux (LISTEN) nmbd 24453 root 7u IPv4 66768 UDP *:tcpmux nmbd 24453 root 8u IPv4 66769 UDP *:netbios-dgm nmbd 24453 root 9u IPv4 66771 UDP 10.34.211.121:tcpmux nmbd 24453 root 10u IPv4 66772 UDP 10.34.211.121:netbios-dgm [root@RHEL4U4]# [root@RHEL4U4]# less /etc/services | grep tcpmux tcpmux 1/tcp # TCP port service multiplexer tcpmux 1/udp # TCP port service multiplexer [root@RHEL4U4]# less /etc/services | grep netbios-dgm netbios-dgm 138/tcp # NETBIOS Datagram Service netbios-dgm 138/udp Version-Release number of selected component (if applicable): All, even upstream. How reproducible: Always. Steps to Reproduce: 1. As shown on the description. smbd -p 65537; lsof -i Actual results: tcpmux (port 1 is listening) Expected results: default smbd/nmbd set. Additional info: [Patch proposed]
Created attachment 135637 [details] Patch fixing the problem.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2007-0698.html
Just to make it clear for possible further testing: The final patch does not set ports to default values when a bad port number is specified. Instead the solution is that these bad ports are ignored (no ports are opened by smbd).