Commit Graph

321 Commits

Author SHA1 Message Date
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
tron
f4ae533fa6 Really set "MKPRIVATELIB" and not "INTERNALLIB". 2004-05-23 14:05:39 +00:00
lukem
b817247988 Use MKPRIVATELIB=yes instead of providing an empty libinstall:: target and
setting NOLINT, NOPIC, NOPROFILE (etc)
2004-05-23 02:24:50 +00:00
christos
70229c52ba constify printcapdb 2004-04-24 02:59:19 +00:00
christos
6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
lukem
eae82b3d06 #define _PATH_BIN_RCMD in common_source/pathnames.h rather than using
wacky Makefile rules to compile rcmd.c
2003-10-19 05:51:44 +00:00
itojun
686afb7f65 safer use of realloc 2003-10-16 06:22:09 +00:00
itojun
94a111ae53 safer realloc.
sizeof() for malloc was mistaken in socksetup().
2003-10-16 03:03:04 +00:00
itojun
67ad87844e plug memory leak. oenbsd-pr-3425 2003-09-01 00:21:08 +00:00
agc
326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
itojun
2a470e2847 use bounded string op 2003-07-13 14:06:06 +00:00
lukem
001c68bd94 Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO".  The new variables are:
	TOOL_ASN1_COMPILE  TOOL_CAP_MKDB  TOOL_CAT  TOOL_CKSUM  TOOL_COMPILE_ET
	TOOL_CONFIG  TOOL_CRUNCHGEN  TOOL_CTAGS  TOOL_DB  TOOL_EQN  TOOL_FGEN
	TOOL_GENCAT  TOOL_GROFF  TOOL_HEXDUMP  TOOL_INDXBIB  TOOL_INSTALLBOOT
	TOOL_INSTALL_INFO  TOOL_M4  TOOL_MAKEFS  TOOL_MAKEINFO  TOOL_MAKEWHATIS
	TOOL_MDSETIMAGE  TOOL_MENUC  TOOL_MKCSMAPPER  TOOL_MKESDB
	TOOL_MKLOCALE  TOOL_MKMAGIC  TOOL_MKTEMP  TOOL_MSGC  TOOL_MTREE
	TOOL_PAX  TOOL_PIC  TOOL_PREPMKBOOTIMAGE  TOOL_PWD_MKDB  TOOL_REFER
	TOOL_ROFF_ASCII  TOOL_ROFF_DVI  TOOL_ROFF_HTML  TOOL_ROFF_PS
	TOOL_ROFF_RAW  TOOL_RPCGEN  TOOL_SOELIM  TOOL_SUNLABEL  TOOL_TBL
	TOOL_UUDECODE  TOOL_VGRIND  TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
	TOOL_FOO?=	foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
	TOOL_FOO=	${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
2003-07-10 10:33:58 +00:00
itojun
85da88227f use strlcpy/strlcat.
[fix off-by-one in displayq.c]
2003-05-17 20:46:42 +00:00
itojun
658519705e sscanf possible overrun 2003-05-17 14:56:40 +00:00
wiz
d0e6ae84ee p before q in options/usage. 2003-04-16 11:56:11 +00:00
wiz
b190a86ddc Sort options; fix typo; new sentence, new line. 2003-04-16 11:48:11 +00:00
perry
f13ae3a980 fix the fix, from Brian Ginsbach 2003-03-28 17:40:39 +00:00
perry
687a657d3e Add a -R flag to lpr, which prints the print job number
Make lp use the -R flag to lpr unless the lp -s flag is used.
This fixes standards/17917, patches and PR from
Brian Ginsbach <ginsbach@cray.com>
2003-03-28 14:37:43 +00:00
perry
266f8437dd Fix the broken -q option to lpr, apparently broken long ago after lpr
was converted to getopt.
Also, document the -q option.

Fix supplied by Brian Ginsbach in PR #20890
2003-03-27 16:25:28 +00:00
wiz
37a402fc28 IPv4/IPv6, not IPV4/IPV6. 2003-03-15 19:26:08 +00:00
wiz
990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
perry
8a49ec08e4 "Utilize" has exactly the same meaning as "use," but it is more
difficult to read and understand. Most manuals of English style
therefore say that you should use "use".
2003-02-04 23:07:28 +00:00
wiz
7d667a5da9 Stanford, not Standford. From Chad Loder. 2003-01-06 12:18:02 +00:00
pooka
732f4c9fa5 Add ${MACROS} to ${ROFF} usage to make output readable
from jbernard@mines.edu in misc/19685
2003-01-05 12:24:22 +00:00
thorpej
2b3b2f08d6 Rather than relying on pure luck to get the log file on STDERR_FILENO,
explictly dup2 the log file dscriptor to STDERR_FILENO and close the
original.
2002-10-26 01:47:52 +00:00
thorpej
d2ed7ebdd1 * Use STDOUT_FILENO instead of 1.
* Pass the file descriptor to request_init() (libwrap) so that
  it can actually do something useful later in fromhost().
2002-10-26 01:46:31 +00:00
itojun
c41e40e20e set IPV6_V6ONLY socket option for AF_INET6 socket, to avoid
complicated access control issue due to IPv4 mapped address.
2002-09-24 13:31:33 +00:00
lukem
1b2d905cd0 cast "%ld", xxx.tv_sec to a long 2002-09-20 04:12:42 +00:00
mycroft
59edfd2c03 Simplify the accept() code a little -- sockaddr_storage is fine for both
AF_LOCAL and AF_INET{,6}.
2002-09-19 20:35:56 +00:00
mycroft
4082cae6ac If we exit because the pid file is locked, syslog that. 2002-09-19 20:22:32 +00:00
mycroft
e1a3e519ec select() -> poll(), nanosleep() 2002-09-19 20:08:58 +00:00
mycroft
ae627c1271 select() -> nanosleep() 2002-09-18 23:27:25 +00:00
lukem
c52b93f508 minor makefile delint 2002-09-18 13:31:52 +00:00
lukem
17d72c8a6b use NETBSDSRCDIR as appropriate 2002-09-18 03:54:26 +00:00
abs
2cbe5b958f Add back __attribute__() data for pstatus() removed by error in last commit.
Noted by wiz.
2002-09-04 13:49:20 +00:00
abs
8531949548 When -r is given actually pass the file through of, and also enable if. 2002-09-03 18:35:11 +00:00
wiz
a05630c34e Minor mdoc nit. 2002-08-12 18:08:13 +00:00
itojun
166e26e413 add libwrap support for lpd (you need to pass all tests to print,
so you will want "+" in hosts.lpd then restrict by hosts.allow/deny).
setsockopt(SO_REUSEPORT) while i'm here.
2002-08-12 18:03:41 +00:00
wiz
330119fdb5 Correct usage. bin/17916 by Brian Ginsbach. 2002-08-12 17:41:32 +00:00
grant
cc65da74ac specify the reason when aborting with "Malformed from address",
suggested by Matt Green.
2002-08-11 07:04:00 +00:00
itojun
1917442aa9 die if fd_set overruns 2002-08-09 02:40:57 +00:00
jschauma
a1e7e17b3e Fix typo pointed out by haes at shrubbery dot net in PR bin/17396
"filter to be use" -> "filter to be used"
2002-07-31 01:49:48 +00:00
grant
eda9e509bb sweep of errx/warnx, remove unnecessary trailing \n 2002-07-20 08:40:16 +00:00
wiz
895dc72a69 Unifdef __STDC__. Remove __P(). ANSIfy. 2002-07-14 15:27:58 +00:00
hubertf
534ff5d5e9 This fixes various little problems in the lpd source.
lpd.c           bogus 'c' option in getopt option string

        printjob.c      spelling "prstatic inter" -> "printer"
                        finish ANSIfication

        recvjob.c       finish ANSIfication

Patch contributed by Brian Ginsbach <ginsbach@cray.com> in PR 17520
2002-07-09 01:12:35 +00:00
wiz
a234ffc74d Document -w. Patch from Brian Ginsbach in bin/17518. 2002-07-08 14:05:37 +00:00
kleink
41b912792c postive -> positive 2002-07-03 22:28:28 +00:00
wiz
3560ae7f37 Sort options in getopt string. 2002-07-03 22:19:25 +00:00
hubertf
1b7f271a58 * Add missing 'break'
* cosmetic update in getoipt string

Patch supplied by Brian Ginsbach <ginsbach@cray.com> in PR 17473.
2002-07-03 22:12:46 +00:00
wiz
84d465bb02 Improve last. 2002-07-03 22:12:38 +00:00
wiz
53e326dd05 Fix error output for negative argument to '-w'.
Also update usage to include -w.
Patches from Brian Ginsbach in bin/17471.
2002-07-03 22:10:28 +00:00
hubertf
e925e82dbe Document missing -w option.
Patch submitted by Brian Ginsbach <ginsbach@cray.com> in PR 17472.
2002-07-03 22:07:33 +00:00
itojun
0b52cc9109 avoid more hardcoded octals. openbsd 2002-06-08 23:43:24 +00:00
itojun
b4daa6bb72 avoid hardcoded octals. openbsd 2002-06-08 23:40:12 +00:00
itojun
5da007343b avoid hardcoded octals 2002-06-08 23:37:47 +00:00
wiz
01ff6324be Make ngroups, which is the size of a static array, static too. From
Todd Miller in bin/16871.
2002-05-19 17:38:36 +00:00
ross
2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
wiz
b36c0a5406 deamon -> daemon 2002-01-21 14:42:26 +00:00
wiz
5d2bc3031d empty line -> .Pp; sort sections. 2002-01-19 03:24:14 +00:00
wiz
00dce9aae8 Sort sections, whitespace nit. 2002-01-19 03:23:47 +00:00
wiz
6051a9a396 Sort sections. 2002-01-19 03:23:11 +00:00
wiz
34828cce4a Convert .Xr to non-existing program to Ic. 2002-01-19 03:22:53 +00:00
wiz
d8081e42ef Sort SEE ALSO and sections. 2002-01-19 03:22:19 +00:00
wiz
51d0450786 Whitespace and punctuation nits, use standard headers. 2002-01-19 03:21:59 +00:00
tv
8e6f7afb5b MKfoo=no -> NOfoo 2001-12-12 01:48:43 +00:00
christos
e363b58375 Make sure that the we have a valid pathname. [We did the check too late,
and we had a buffer overflow].  Bug found by Sebastian Krahmer of SuSE,
fix inspired by patch 008 for OpenBSD-3.0.
2001-12-04 22:52:44 +00:00
wiz
1fd7eeefcd "than" instead of "then". 2001-11-21 19:14:19 +00:00
enami
6737e7d6b2 Test absense of command differently to avoid null pointer deference
when only whitespaces are given.
2001-11-14 03:01:15 +00:00
mjl
c903850da8 Replace 1 and 2 with STDOUT_FILENO and STDERR_FILENO.
ANSIfy and constify.
2001-10-09 02:15:37 +00:00
wiz
4c99916337 va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00
wiz
456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00