format of 'sccsid' lines so they consistently match style(9).
A minor Makefile change is needed so lptest.c can find lp.cdefs.h.
Reviewed by: discussed with bde and obrien
MFC after: 15 days
format of 'sccsid' lines so they consistently match style(9)
Also the 'sccsid' line is formatted to match style(9), and
a 'From:' is removed so the sccsid returns to what it was back
in the days of '-r CSRG' (1996).
Reviewed by: discussed with bde and obrien
MFC after: 15 days
programs, minor Makefile changes are needed to find lp.cdefs.h.
For lpf.c, the 'sccsid' line is formatted to match style(9), and
a 'From:' is removed so the sccsid returns to what it was back
in the days of '-r CSRG' (1994).
Reviewed by: discussed with bde and obrien
MFC after: 15 days
format of 'sccsid' lines so they consistently match style(9)
guidelines. Note that this means you will have to add '-a' to
the 'strings' command when searching for rcs ids, eg:
strings -a /usr/sbin/lpc | grep '$FreeBSD'
Reviewed by: discussed on cvs-src & with bde and obrien
MFC after: 15 days
'#ifdef lint/#endif' around the lines should not have been removed.
Also add blank lines where one (per file) was missing.
Reviewed by: First part noticed by bde, blank lines noticed by me
MFC after: 15 days
get from '-r CSRG', instead of having that sccsid as a comment.
(this is the sccsid from 1996 -- there have been many changes to
printcap.c since then!)
MFC after: 15 days
format of 'sccsid' lines so they consistently match style(9)
guidelines. Inspired by recent update to lpd.c by charnier.
Reviewed by: discussed on cvs-src & with bde and obrien
MFC after: 15 days
source to use __FBSDID() for setting rcsids. Also fix the format
of 'sccsid' lines to consistently match style(9) guidelines.
Reviewed by: discussed with bde and obrien
MFC after: 15 days
somewhat easier to build this lpr on other operating systems.
This simply includes <sys/cdefs.h> when that is appropriate,
and then checks for any cdefs-ish macros that lpr uses, and
defines them if they don't already exist. This is only a start
at making freebsd's lpr less of a hassle to port. It is mainly
added so all of lpr can be changed to use the __FBSDID() macro,
without making it *more* of a hassle to build on other OS's.
Reviewed by: discussed with bde and obrien
MFC after: 15 days
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.
Suggested by: bde
MFC after: 3 days
reflect much valuable feedback from wollman. More details on the new
'lpc topq' are in the log message for revision 1.2 of lpc/movejobs.c.
The previous implementation of 'lpc topq' is available as 'lpc xtopq',
in case there are any problems noticed in the new implementation. If
there are no problems with this version, a later update will remove the
'lpc xtopq' command.
Reviewed by: freebsd-print@bostonradio.org
MFC after: 6 days
mainly so the compiler can correctly do printf-style parameter checking.
Some minor improvements to a few of the error messages, but the main
goal here is to get rid of a few more compile-time warning messages.
MFC after: 5 days
visible change should be that more than one queue can now be specified,
if one uses the '-msg' parameter to separate the list of queues from the
status message to set.
The previous implementation of 'down' remains available as the command
'xdown', available for instant fallback if there seems to be anything
wrong with the new one. If no one reports a problem after a few weeks,
then a later update will remove 'xdown'.
Reviewed by: freebsd-print@bostonradio.org
MFC after: 10 days
change the status message of a print queue. This includes some minor
changes to the upstat() routine, so that error messages are not printed
while seteuid(priv-user).
Reviewed by: freebsd-audit and freebsd-print@bostonradio.org
MFC after: 10 days
'restart', 'start', 'stop' and 'up'. These are commands which mainly
just alter the access bits on the lock-file of a queue, and they all
now use a central routine to do that. This reduces the amount of code
that is run as the priv userid, and eliminates a number of cases where
error messages were written while that priv uid was in effect.
As far as users are concerned, there should be no noticable difference
in the new versions. In case there *is*, the previous implementations
are still there as 'xabort', 'xenable', etc, so they are available for
instant fallback. If no one reports a problem after a few weeks, then
a later update will remove those x-commands.
Reviewed by: freebsd-audit and freebsd-print@bostonradio.org
MFC after: 10 days
of them to keep better track of which-is-which (multiple variables were
named 'pid'). Moved a global pid-variable into the only routine that
used it. Net result: fixes two compile-time warnings...
MFC after: 2 weeks
This is a boolean option, and if it is specified in a print queue
for a remote host, it causes lpd to resend the data file for each
copy the user requested on 'lpr -#n'. This is useful for network
printers which accept lpd-style jobs, but which ignore the control
file (and thus they ignore any request for multiple copies).
PR: 25635
Reviewed by: short review on freebsd-audit
MFC after: 6 days
for what is currently the '-p' parameter. '-s' is what NetBSD
used (and they implemented it before I added -p in FreeBSD), and
it also matches the '-s' option in syslogd. Someone in OpenBSD
land had also talked about adding a '-s' option, but it hasn't
happened yet.
MFC after: 5 days
"confused" about it being unassigned. In fact, gcc was right. Fix the
real problem by setting that variable before break-ing out of a select
statement so gcc is happy, and then remove the unnecessary assignment.
Reported by: a user wondering why lpd syslog-ed about "compiler confusion"
MFC after: 12 days
input file and any temporary (filter) file are closed upon return, and
that is generally done at the end of the routine. This should make it
easier for a later update (not yet written) to implement a "resend_copies"
option.
MFC after: 12 days
remote machines. Now they really are handled *exactly* the same as
input filters (if=) for remote queues, except that they are started
with a different set of parameters. This should fix a few subtle
bugs in output-filter processing on such queues. It is a pretty
significant re-arranging of sendfile(), moving some of it to a new
execfilter() routine.
PR: 36552
Reviewed by: no screams from freebsd-audit
MFC after: 12 days
"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
to be the same as -ragged in the current implementation) to
-ragged. With mdocNG, -filled displays produce the correct
output, formatted and justified to both margins.
done, so the correct directory is being checked. The mkstemp() call
is meant to create a temp file for stderrs when running filters. This
update also fixes log-file processing for remote (rm=) queues which
specify an input filter (if=). Before, filter-errs were thrown away.
Now they'll be copied to the queue's logfile (lf=).
Reviewed by: (a little) audit@FreeBSD.ORG & freebsd-print@bostonradio.org