Bug 3290 - port option in lpd not valid
Summary: port option in lpd not valid
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Books & Articles (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-04-14 17:00 UTC by tinguely
Modified: 1997-08-23 17:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.