"skimming thru" the printcap file looking for some common mistakes that
people make. These are the kinds of mistakes where the printcap file
probably looks correct to human eyes, but is wrong in some subtle way
which causes a problem in some queue definitions. The program treats
these as "warnings" not "errors".
Note that I'm flexible on the m.f.c. schedule, if people would rather
this waited until after 4.5-release.
Reviewed by: no screams from freebsd-audit freebsd-print@bostonradio.org
MFC after: 4 days
for a remote print job. This change comes from OpenBSD (who got it from
Sebastian Krahmer of SuSE). In OpenBSD this avoids a tiny theoretical
security issue, but that security issue does not exist in FreeBSD's lpr
due to the changes which added 'ctl_renametf()' just before 4.4-release.
This change is still worth doing in our version, but it isn't fixing a
security issue.
MFC after: 4 days
control-files will always start with 'cfA*'. It turns out that some
implementations of lpd (such as solaris) may send a control file which
starts with 'cfB*', or really 'cf<anyLetter>*'. Although such filenames
are very odd, we did used to accept them. This changes ctl_renametf to
work correctly with them, and fixes up 'lpc clean' to match.
PR: bin/32183
MFC after: 10 days
'l' ("plain text which includes control characters") is somewhat more
appropriate for 'o' ("postscript files"), and in fact some printers treat
'l' as a request to print a postscript file.
MFC after: 1 week
'lpc tclean'. In some obscure cases, the previous version could cause a
valid user job to be removed (by 'clean'), due to invalid assumptions in
the sort routine. This was a rare problem, unless ctlinfo.c is compiled
with 'LEAVE_TMPCF_FILES' turned on (to check what that rtn was doing).
Reviewed by: Lack of outcry on -audit and freebsd-print@bostonradio.org
MFC after: 10 days
This was described in the original RFC wrt lpr, but most lpr's do not
actually implement it. There is some indication that MacOS 10.1 will
be using this when sending postscript files to print servers (that is
what "o"-type was supposed to signify -- postscript files).
MFC after: 1 week
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
correct the error-checking that was there. With the old code, an error
return from getpwuid(daemon_user) could turn the lpd process into a very
effective fork-bomb...
Reviewed by: freebsd-audit freebsd-print (a little...)
MFC after: 6 days
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
receives them from other hosts. This is meant to protect from both
nefarious users (which maybe broke into some remote host that we accept
print jobs from), and broken implementations of lpr on other platforms.
This is done by changing recvjob.c to call the new ctl_renametf()
routine in the new common_source/ctlinfo.[ch] files. This will not
affect jobs coming via lpr on the local machine.
Reviewed by: freebsd-print@bostonradio.org & freebsd-audit
MFC after: 16 days
often by just telling gcc that some internal routine is "__printflike"
(work done by Kris Kennaway <kris@FreeBSD.org>). Also fix the new warnings
which show up once gcc starts checking the "printf-like parameters" passed
to those routines.
MFC after: 1 week
This fixes a problem with using print filters (if=, of=, etc) that showed
up in -current around June 20th. That problem initially reported by
Georg-W Koltermann <gwk@sgi.com>, while most of the investigation that
led to this fix was done by Anton Berezin <tobez@FreeBSD.org>.
Reviewed by: freebsd-print@bostonradio.org
MFC after: 1 week
one to see what files would be removed *if* an 'lpc clean' is done. 'tclean'
will remove no files, and is therefore not a privileged command. Also, both
'lpc clean' and 'lpc tclean' will now look for 'core' files in spool directories
(but not remove them). They also print out an extra line of info when a
datafile to be removed is a symlink (from 'lpr -s'), saying what file it is
a symlink to.
The 'lpc clean' commands also now print out a summary line saying how many
queues were checked, how many files were removed (or "would be" removed, for
tclean), and how much disk space is involved. For the benefit of those who
have many print queues, 'lpc clean all' will only print out the names of print
queues where some "interesting" files were found, instead of printing out a
header-line for every queue in your printcap file.
Reviewed by: freebsd-print@bostonradio.orgfreebsd-audit@FreeBSD.org
MFC after: 2 weeks
while -w allows connection from non-reserved ports. Also improves the
helpfulness of various connection-error messages.
The changes for IPv6 added back in the reserved-port check which was mistakenly
dropped from lpd in 1997 (copying a change from openbsd). It is best to have
that check in place, but the check breaks lpr's from some implementations of
lpr/lpd for Windows. The -w option is for those admins who need to accept
jobs from non-reserved ports, the -c option is for admins who would like a
print-server machine to log all failed connection-attempts to syslog.
Reviewed by: freebsd-audit@FreeBSD.orgfreebsd-print@bostonradio.org
MFC after: 2 weeks
more sensible/understandable. 'from'->'from_host' 'host'->'local_host'
'fromb'->'frombuf' 'fromhost'->'origin_host' and a local-variable
named 'host'->'hostbuf'. This fixes some compile-time warnings about
local variables shadowing global variables.
Other than renaming variables, the only actual code changes are to call
strlcpy() instead of strncpy() when setting those (renamed) variables,
and that 'from_ip' is now a strdup()-created buffer instead of being a
static buffer compiled in as 1025 bytes.
Reviewed by: freebsd-print@bostonradio.org (an earlier version)
MFC after: 1 week
warnings which come up for various routines that have a parameter which
is also called 'name'.
Reviewed by: freebsd-print@bostonradio.org
MFC after: 1 week
with BDECFLAGS on, mainly by adding 'const' to parameters in a number
of routine declarations. While I'm at it, ANSI-fy all of the routine
declarations. The resulting object code is exactly the same after
this update as before it, with the exception of one unavoidable
change to lpd.o on freebsd/alpha.
Also added $FreeBSD$ line to lpc/extern.h lpc/lpc.h lptest/lptest.c
Reviewed by: /sbin/md5, and no feedback from freebsd-audit