Commit Graph

145 Commits

Author SHA1 Message Date
jdolecek
9e1ce523c5 account(): fix so that number of copies is optional and whitespace
between it and hostname:username is optional as well (some software relies
in this); while here, covert to use sscanf() instead of explicit parse code,
sprinkle some comments

dumpit(): change so that the price is total price for this entry, instead of
beeing price per copy

Addresses bin/9996 by Brian Stark, though the implementation differs from
patch code attached to it.
2000-07-16 21:33:26 +00:00
matt
3ab02a8704 More #include <stdlib.h> string, etc. cleanup 2000-07-04 20:27:35 +00:00
mycroft
0047d53157 Get rid of the stupid hack that makes this lose when ${CC} is more than one word. 2000-06-05 17:41:19 +00:00
enami
dc0efa126e Just remove the first word so that rcmd.c compiles even if the command line
contains same substrings with the name of compiler.
2000-05-31 07:34:45 +00:00
itojun
ed26506c25 usr.sbin/lpr/lpd now compiles lib/libc/net/rcmd.c on its own, to avoid
use of non-exported function __ivaliduser{,_sa}().

we cannot make __ivaliduser{,_sa}() static yet, since doing that would choke
compiled lpd binaries.  we should do it on next libc major version bump.
added a memo on lib/libc/shlib_version.
2000-05-30 01:07:43 +00:00
thorpej
9581f118ec Need <string.h> for memset() prototype. 2000-04-30 15:47:55 +00:00
abs
6a7a9484ec lpf used its own broken argv parsing (-h without an argument would dump core)
Convert to getopt() and add a basic usage()
2000-04-29 00:12:32 +00:00
msaitoh
c09c988278 remove unused variable 2000-04-27 13:40:18 +00:00
jdolecek
1d83915c52 Finish transition to using getopt(3). Fixes bin/9963 by Brian Stark. 2000-04-27 09:43:38 +00:00
itojun
4be926fbb8 allow lp=port@host again. PR9975 from Andreas Gustafsson. 2000-04-25 02:34:49 +00:00
itojun
e738bb5642 avoid NULL pointer access when rp=<ipv4 numberic address> (no ai_canonname).
From: hiro@takechi.org

XXX checkremote() should be improved.  gethostname -> getaddrinfo is
not the right thing to do, we cannot assume DNS FQDNs is configured
as hostname.  if the goal here is to check if it is really remote or not,
getifaddrs() is the way to go.
2000-04-24 02:53:05 +00:00
mrg
dd28a6c6dd make scandir(3)'s 3rd argument take a function that takes a *const*
struct dirent *, rather than non-const.  this makes scandir(3) the
same as the scandir implementations in libiberty and glibc, and the
select function has no need to modify the dirent.
2000-04-16 14:43:56 +00:00
simonb
fd4ede242b Don't declare 'extern opt*' getopt variables. 2000-04-14 06:26:52 +00:00
mrg
3f207f4f5a - fix usage message to current reality.
- pull over "lpd [port]" code from freebsd's lpr code.
- use posix signal handling.
2000-04-10 08:09:33 +00:00
itojun
7b48263c7b (rcmd.c) to make Zoularis happier, pass sa_len separately from sockaddrs.
this changes function prototype for __ivalid*.
This commit breaks binary compatibility for __ivalid*.  I believe this can be
forgiven due to the following:
- this is not really exported function.  no function prototype is in headers.
  function name starts with underbars.  No third-party applications are
  expected to use it.
- the function was introduced very recently, when rcmd.c was made IPv6-ready.
- the only customer in NetBSD tree is lpd.

(lpd.c) sync with rcmd.c change.
2000-02-24 06:33:47 +00:00
itojun
0c281f2bda do not sleep on ECONNREFUSED, rather, try the next address first.
the behavior itself has a room for debate.  (why we retry on ECONNREFUSED?)

From: SHIMIZU Ryo <ryo@misakimix.org>
2000-02-18 03:53:16 +00:00
itojun
33ba3a0f18 IPv6 support, using rcmd-family funciton added.
NetBSD PR: 9050
From: Feico Dillema
2000-01-27 05:39:50 +00:00
mjl
8515b446a0 Fix null terminating the wrong buffer curtesy of similar variables
mixed up. Seemed to never have any ill effect, but then...
Noted by Tetsuya Furukawa in FreeBSD PR/15604.
1999-12-23 02:10:07 +00:00
mrg
2a987cd998 - use symbolic names for mode bits
- use _exit() where we should
- fix spelling mistake
- use vasprintf() in pstatus()
all from freebsd.
1999-12-11 02:01:18 +00:00
mrg
585454b2f2 xref setsockopt (from freebsd) and hosts.equiv. 1999-12-11 01:59:43 +00:00
mrg
2e2dfe5c71 tsk. tsk. document new features i added. 1999-12-10 23:49:03 +00:00
mrg
5b6d0e7e39 - add timeouts to displayq(), rmremote(), sendfile() and response(),
and use these timeout in the lpq, lpd and lprm programs.

these stop hung remote printers that accept tcp connections but do
not process jobs from hanging the whole system and letting the sysadmin
have a clue about what is going on with this rogue printer.

- add a -r flag to lpd to allow `of' filters for remote jobs.

i know there are ways around this, but i just don't care.

- add a -f flag to lpf to add missing carriage returns.

useful when printing UNIX files to an, eg, LaserWriter that wants CR's
as well as LF's in raw text.  stair-stepped text is no fun.

- implement child process accounting: we just have a limit on the number
  of children we can have (settable by the sysadmin), and we sleep when
  this number is reached.  this can reduce malicious not-so-malicious
  attacks on the print server by a rogue remote client..

- use setproctitle() where appropriate so the sysadmin has a clue about
  what each of the lpd's here are doing.

this was useful to help diagnose a problem (that the above child process
accounting change reduces the lossages of) where a rogue client was
attempting "lpq" operations on one stuck queue in rapid succession,
causing the lpd server to be extremely slow, due to the large number
of lpd processes running.


i have been running these changes in production for about a year.
1999-12-07 14:54:44 +00:00
jdolecek
5986e9b6ee main(): g/c variable errs accidentaly introduced in last commit, rename
'i' to 'opt'
1999-12-05 22:22:05 +00:00
jdolecek
0e29a42af3 Change the formatting of output so that entries with host:user longer than
24 characters would be displayed correctly.
Fixes bin/8880 by Brian Stark <bstark@uswest.net>.

While here, convert code to use getopt(3) and do some const poisoning.
Also g/c variables uid and euid, they are no longer needed after
the split of ../common_source/common.c
1999-12-05 22:18:40 +00:00
jdolecek
b86257129c put fatal() and a some of variables used independantly of other functions
in common.c into separate files - this slighly cuts down size of pac(1)
not that it's really significant, but every bit counts ....
1999-12-05 22:10:57 +00:00
mrg
23b9fac082 delint and other cleanups. 1999-09-26 10:32:27 +00:00
simonb
299578ebd5 Spell "privilege" correctly (correct spelling from Jonathan Stone). 1999-08-16 02:59:22 +00:00
mycroft
68d6f4bf44 Remove spurious .ne's. 1999-03-24 06:27:49 +00:00
garbled
d1407362ba More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages.  Many more to
come.
1999-03-22 18:43:46 +00:00
lukem
7e1c62baf8 set MKLINT=no. noted by NAKAJIMA Yoshihiro <nakayosh@kcn.ne.jp> 1999-03-13 23:17:46 +00:00
erh
0f61c6801e Add missing .El line. 1999-03-10 08:17:35 +00:00
mycroft
d77575d3c8 Clean up SYNOPSIS formatting. 1999-03-07 11:58:22 +00:00
lukem
dcab0210a0 convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
1999-02-13 02:54:17 +00:00
frueauf
c548010b99 Fix pr 5071 better after feedback from the Originator Havard Eidnes. 1998-09-14 21:23:07 +00:00
frueauf
988c143116 Add (ugly?) code to prevent core dump as described in pr 5071 by Havard Eidnes.
XXX Maybe someone with more taste and understanding should have a look
XXX at this? At least I prefer this over the solution provided in the pr.
1998-09-14 11:52:21 +00:00
mycroft
1f86e5830d const poisoning. 1998-07-27 00:52:00 +00:00
lukem
786b86d71b use AF_LOCAL instead of AF_UNIX 1998-07-18 05:04:35 +00:00
msaitoh
4944940fcf Declare ints, too, don't default them. 1998-07-09 18:32:52 +00:00
mrg
18ae3abbcd fix "-s" option 1998-07-07 17:05:28 +00:00
mrg
c0aa4ce503 oops, missed this in gethostname sweep. 1998-07-07 03:36:53 +00:00
mrg
33c0bbba35 add "lp -s" switch, from darcy@druid.net in pr#5713. document "lp -s" and "lp -o" 1998-07-07 02:01:37 +00:00
mrg
32f519716b - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:56:06 +00:00
fair
dc026e0515 Change occurrences of "UNIX" to .Ux or .At as appropriate. 1998-04-28 06:00:51 +00:00
christos
8f09e5bcdb Use obj dirs 1997-12-21 15:53:38 +00:00
lukem
0a94f4f077 use CPPFLAGS instead of CFLAGS 1997-10-25 06:57:53 +00:00
scottr
94cf433266 Add support for DTR/CTS flow control, from Bill Studenmund. 1997-10-20 08:07:47 +00:00
mycroft
e8018f6da9 Use S_IS*(), not S_IF*. 1997-10-19 19:40:21 +00:00
lukem
fbafdc25f8 use memcmp/memset/memmove instead of bcmp/bzero/bcopy 1997-10-18 08:52:17 +00:00
lukem
f5bf267d90 enable WARNS=1 by default, but disable in unclean 3rd party code 1997-10-18 06:42:25 +00:00
lukem
4d10189f4c fix race condition when building libcommon with make -j 1997-10-16 05:10:14 +00:00