Commit Graph

291 Commits

Author SHA1 Message Date
christos 8eef858ae2 patch from Dennis den Brok for foomatic 2008-05-07 17:44:44 +00:00
lukem 66176dfdff Rename MKPRIVATELIB to LIBISPRIVATE, to make it clearer that this is
a variable that is used by in-tree Makefiles to control behaviour.
(MKsomevar variables are generally intended to be controlled by the end-user)
2008-05-03 14:48:30 +00:00
lukem 57d60ef891 Use mkstemp(3) (in a hokey manner) instead of mktemp(3).
XXX: still not 100% "safe", except that we're in a protected directory.
XXX: arguably we should keep the fds open and fdopen(3) dup()s,
XXX: but we're in a protected directory so it shouldn't matter.
2008-03-03 05:07:43 +00:00
dholland 68911b1cc8 This file requires errno.h 2008-02-24 19:31:30 +00:00
matt 156e0dc02f scnkey is const char [][HEIGHT], not char [][HEIGHT] 2008-02-16 07:33:25 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
mlelstv 3b956ed6b4 Sort queue by time and jobid so that jobs submitted within the
same second are printed in order.
Fixes PR bin/37346
2007-12-01 09:26:58 +00:00
christos 03687f1fb0 remove null test; it is not necessary as we always look at the next element.
from Anon Ymous
2007-10-03 19:07:43 +00:00
christos 0bfe3e6189 - int -> size_t
- off by one in \n printing [Anon Ymous]
- return when the end of the array is reached.
2007-10-03 17:45:47 +00:00
ginsbach 1f1c7f87ed - remove extraneous \n in err(3) message
- minor KNF whitespace nit
2007-09-11 15:46:56 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
christos 0eeca5df9e coverity CID 1220: Don't use size_t for return of read. 2007-05-16 20:45:45 +00:00
christos 1665d5e960 fix spelling of accommodate; from Zapher. 2006-11-24 19:46:58 +00:00
christos f6a7372b60 use c99 initializers 2006-10-22 21:09:47 +00:00
christos df7031b876 Add missing semicolon. 2006-05-25 02:53:10 +00:00
christos ddd7ee439d Coverity CID 830: Avoid NULL deref. 2006-05-25 00:21:52 +00:00
christos ede17ba69d Coverity CID 3322: Fix memory leak. 2006-05-25 00:19:27 +00:00
mrg 4bc6feceb6 end the argument list to exec*(3) with a NULL instead of a bare '0', as
the latter isn't a pointer context in these varargs functions.
2006-05-11 00:22:52 +00:00
christos db1dbe6ce9 Coverity CID 1225: Don't close negative fd. While here fix fd leak. 2006-03-21 22:49:43 +00:00
christos 4a6e5a625c Coverity CID 1750: Add a function to free a queue and use it. 2006-03-21 22:47:26 +00:00
christos 1f548f352a Coverity CID 1752: getq() always allocates a queue if nitems >= 0, so always
free it.
2006-03-21 22:37:34 +00:00
christos fca770b32a Appease Coverity CID 2580 [not a bug] 2006-03-17 17:06:30 +00:00
christos 227e68b656 free memory on allocation failure. 2006-03-17 17:04:22 +00:00
christos f49dbe00ee - use sizeof() instead of the buffer size.
- check write return.
- use MAXPATHLEN instead of BUFSIZ for a path buffer.
2006-01-29 18:55:46 +00:00
wiz ec5cd4a9b7 New sentence, new line. Bump date for previous. Properly case PostScript. 2006-01-22 21:31:17 +00:00
wiz 2d00c446d6 Bump date for previous. 2006-01-21 23:34:45 +00:00
christos c681304808 Instead of dealing with port@host in many places, do it where it is needed.
It reduces code and complexity and at the same time allows as to use symbolic
ports instead of just numeric everywhere.
2006-01-20 17:30:00 +00:00
garbled 79363b714f Add control file documentation for 'o' handling, and fix the
documentation on the DVI handling, the correct letter is 'd' not 'r'.
2006-01-20 08:51:40 +00:00
garbled bd7bcee846 Add a simple filter that encapsulates ascii text into HP PJL format.
Script written by Ross Harvey.
2006-01-20 08:37:26 +00:00
garbled fad94e160d Fix PR bin/30272 Lpd would create the tempfile "remotexxxxx" and send
that, but then fill out the control file with the "df" filename.  Fix by
sending the remote file with the "df" filename, as suggested by Robert
Vargason on tech-userlevel.  lpd -r now works properly with an if (input
filter)
2006-01-19 19:17:59 +00:00
garbled 2d58d3d4c7 If we set SIGCHLD to SIG_IGN then any wait()'s on the child processes will
return -1.  This causes filters to fail because we get a value for
child_pid we weren't expecting.  Set SIGCHLD to SIG_DFL instead to clear
the reapchild setting when forking the child lpd.
2006-01-18 23:17:38 +00:00
garbled 9ca158e136 change return(0) to return(rv). We went to all the trouble to calculate the
return value, we might as well return it. (fixes lpq -a, and probably lpd)
2006-01-18 19:11:25 +00:00
garbled d1a9ef55c4 per PR bin/12958 change buf[MAXPATHLEN] to buf[BUFSIZ] to avoid potential
future problems if either should change.
2006-01-17 19:41:49 +00:00
garbled 517b1ba160 Update a comment regarding control file WRT "o" 2006-01-17 19:12:17 +00:00
garbled fae257a066 Fix PR bin/14247
This PR claims that MacOSX 10.1 cannot print postscript files to a NetBSD
lpd because the mac will tag the file with an "o" for postscript, which
we do not handle.  Rather than simply mapping o -> f as was done in the
PR, or mapping o -> l as was done in FreeBSD, I have implemented full
support for the "o" option.  If a postscript filter does not exist in the
printcap file however, it will default to "l" handling.

With this change, you can now specify a "pf" or postscript filter in your
printcap, and have it handle postscript files sent to it with "lpr -o".

The "o" format in lpd is specified in RFC1179 as being a valid format flag.
2006-01-17 19:11:12 +00:00
garbled e76be65112 in ckqueue() if "sd" is not an existing capability, than sd will be
uninitialized, causing the free() in out: to explode.  Initialize sd to NULL.
2006-01-17 18:38:12 +00:00
is def92bcab5 Fix obvious error, hopefully correctly. 2006-01-15 13:17:15 +00:00
wiz dd0ea511f5 New sentence, new line. 2006-01-12 21:15:59 +00:00
garbled 606b04818e sizeof(char) is unneccesary. 2006-01-12 18:06:25 +00:00
garbled 53df3fea02 Add libedit command line history capability to lpc(8). 2006-01-12 17:53:03 +00:00
garbled 97f8851cc8 Address PR bin/12112
Lpd has the ability to start on a port other than "printer" but has no
way to connect to a remote lpd on that port.  This change adds the
ability to specify port@host in the rm element of printcap(5).  Tested to
work with both a standard lpd setup and one running on special ports.
2006-01-04 15:32:50 +00:00
yamt ebd9a381a8 constify. 2005-12-02 11:33:39 +00:00
christos 04723c3ffc - WARNS = 4
- factor out commonly used code.
- constify
- use warn/warnx instead of printf
2005-11-28 03:26:06 +00:00
jdolecek a53e9b6a94 the mktemp() use here is not OK, adjust comment 2005-11-27 12:52:30 +00:00
christos c4ee9f6d2e 64 bit inode changes 2005-08-19 02:07:18 +00:00
lukem 9b668c37e7 Ensure s is initialized before testing (none of the sockets may be ready
so it might not be setup).
Detected with gcc -Wuninitialized.
2005-06-02 05:57:03 +00:00
lukem 7157011597 Only compile in IPv6 support if ${USE_INET6} != "no"
MKINET6 is for providing IPv6 infrastructure.
USE_INET6 is for compiling IPv6 support into the programs (needs MKINET6).
2005-01-10 02:58:58 +00:00
itojun bb4eb5b8cd NI_WITHSCOPEID was not picked up by IETF standardization 2004-11-16 06:00:37 +00:00
dsl 75ba9fc767 Add (unsigned char) cast to ctype functions
Some of this code could usefully be converted to use strtoul() and/or
some small helper functions.
2004-10-30 08:44:25 +00:00
wiz 9029210e32 Avoid printing a useless \0. From SHIMIZU Ryo in PR 26766. 2004-08-26 13:05:14 +00:00