summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/lpd
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2001-07-22 01:05:20 +0000
committergad <gad@FreeBSD.org>2001-07-22 01:05:20 +0000
commit088f7e2128c168afd561139953bc5dcab91ab224 (patch)
tree1a9550cc0cab0e1be48d8ea30536a5169906af93 /usr.sbin/lpr/lpd
parent18d3a289450ddec08065a58e4b15e607aa84b4cd (diff)
downloadFreeBSD-src-088f7e2128c168afd561139953bc5dcab91ab224.zip
FreeBSD-src-088f7e2128c168afd561139953bc5dcab91ab224.tar.gz
Rename the -w option to be -W. The recently-added -w option is different
than the long-standing -w option in NetBSD, so change it before anyone in FreeBSD gets used to it. For now, -w is still accepted, but prints out some warnings via syslog. MFC after: 1 week
Diffstat (limited to 'usr.sbin/lpr/lpd')
-rw-r--r--usr.sbin/lpr/lpd/lpd.86
-rw-r--r--usr.sbin/lpr/lpd/lpd.c31
2 files changed, 30 insertions, 7 deletions
diff --git a/usr.sbin/lpr/lpd/lpd.8 b/usr.sbin/lpr/lpd/lpd.8
index b2b6af5..da093ce 100644
--- a/usr.sbin/lpr/lpd/lpd.8
+++ b/usr.sbin/lpr/lpd/lpd.8
@@ -40,7 +40,7 @@
.Nd line printer spooler daemon
.Sh SYNOPSIS
.Nm
-.Op Fl cdlpw46
+.Op Fl cdlpW46
.Op Ar port#
.Sh DESCRIPTION
.Nm Lpd
@@ -99,13 +99,13 @@ This means that
will not accept any connections from any remote
hosts, although it will still accept print requests
from all local users.
-.It Fl w
+.It Fl W
By default, the
.Nm
daemon will only accept connections which originate
from a reserved-port (<1024) on the remote host.
The
-.Fl w
+.Fl W
flag causes
.Nm
to accept connections coming from any port.
diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c
index 542ef3c..21ec54d 100644
--- a/usr.sbin/lpr/lpd/lpd.c
+++ b/usr.sbin/lpr/lpd/lpd.c
@@ -153,7 +153,7 @@ main(int argc, char **argv)
errx(EX_NOPERM,"must run as root");
errs = 0;
- while ((i = getopt(argc, argv, "cdlpw46")) != -1)
+ while ((i = getopt(argc, argv, "cdlpwW46")) != -1)
switch (i) {
case 'c':
/* log all kinds of connection-errors to syslog */
@@ -168,7 +168,19 @@ main(int argc, char **argv)
case 'p':
pflag++;
break;
- case 'w':
+ case 'w': /* netbsd uses -w for maxwait */
+ /*
+ * This will be removed after the release of 4.4, as
+ * it conflicts with -w in netbsd's lpd. For now it
+ * is just a warning, so we won't suddenly break lpd
+ * for anyone who is currently using the option.
+ */
+ syslog(LOG_WARNING,
+ "NOTE: the -w option has been renamed -W");
+ syslog(LOG_WARNING,
+ "NOTE: please change your lpd config to use -W");
+ /* FALLTHROUGH */
+ case 'W':
/* allow connections coming from a non-reserved port */
/* (done by some lpr-implementations for MS-Windows) */
ch_options |= LPD_NOPORTCHK;
@@ -185,6 +197,17 @@ main(int argc, char **argv)
errx(EX_USAGE, "lpd compiled sans INET6 (IPv6 support)");
#endif
break;
+ /*
+ * The following options are not in FreeBSD (yet?), but are
+ * listed here to "reserve" them, because the option-letters
+ * are used by either NetBSD or OpenBSD (as of July 2001).
+ */
+ case 'b': /* set bind-addr */
+ case 'n': /* set max num of children */
+ case 'r': /* allow 'of' for remote ptrs */
+ /* ...[not needed in freebsd] */
+ case 's': /* secure (no inet), same as -p */
+ /* FALLTHROUGH */
default:
errs++;
}
@@ -888,9 +911,9 @@ static void
usage(void)
{
#ifdef INET6
- fprintf(stderr, "usage: lpd [-cdlpw46] [port#]\n");
+ fprintf(stderr, "usage: lpd [-cdlpW46] [port#]\n");
#else
- fprintf(stderr, "usage: lpd [-cdlpw] [port#]\n");
+ fprintf(stderr, "usage: lpd [-cdlpW] [port#]\n");
#endif
exit(EX_USAGE);
}
OpenPOWER on IntegriCloud