Date: Mon, 14 Apr 1997 10:52:49 -0500 (CDT) From: tinguely@plains.NoDak.edu To: FreeBSD-gnats-submit@freebsd.org Subject: docs/3290: port option in lpd not valid Message-ID: <199704141552.KAA00901@web.cs.ndsu.NoDak.edu> Resent-Message-ID: <199704141600.JAA23159@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 3290
>Category: docs
>Synopsis: port option in lpd not valid
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Class: doc-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Apr 14 09:00:01 PDT 1997
>Last-Modified:
>Originator: mark tinguely
>Organization:
North Dakota State University CS Department
>Release: FreeBSD 2.2.1-RELEASE i386 and before
>Environment:
>Description:
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.
>How-To-Repeat:
# lpd 4
# netstat -a
>Fix:
remove the port# information from the manual page.
>Audit-Trail:
>Unformatted:
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704141552.KAA00901>
