Bug 3290

Summary: port option in lpd not valid
Product: Documentation Reporter: tinguely <tinguely>
Component: Books & ArticlesAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description tinguely 1997-04-14 17:00:01 UTC
lpd(8) does not accept another port number as documented in the manual
page. Looking at the sources for lpd, lpd does not recognize the additional
port arguement. in lpd.c (main())

                sp = getservbyname("printer", "tcp");
                if (sp == NULL) {
                        syslog(LOG_ERR, "printer/tcp: unknown service");
                        mcleanup(0);  
                }       
                memset(&sin, 0, sizeof(sin));
                sin.sin_family = AF_INET;
                sin.sin_port = sp->s_port;
                if (bind(finet, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
                        syslog(LOG_ERR, "bind: %m");
                        mcleanup(0);
                } 

Later in the code it make sure the port is a reserved port (lower than 1024)
for security purposes, so even if we could change to port number it would
only work for reserved ports.

Fix: 

remove the port# information from the manual page.
How-To-Repeat: 
# lpd 4
# netstat -a
Comment 1 Joerg Wunsch freebsd_committer freebsd_triage 1997-08-23 17:04:13 UTC
State Changed
From-To: open->closed


Promised feature added in rev 1.7 of lpd.c.