Commit Graph

2071 Commits

Author SHA1 Message Date
Bill Paul faf215c7ad This commit changes the YPPROC_ALL procecdure so that it handles requests
_without_ using fork().

The problem with YPPROC_ALL is that it transmits an entire map through
a TCP pipe as the result of a single RPC call. First of all, this requires
certain hackery in the XDR filter. Second, if the map being sent is
large, the server can end up spending lots of time in the XDR filter
sending to just the one client, while requests for other clients will
go unanswered.

My original solution for this was to fork() the request into a child
process which terminates after the map has been transmitted (or the
transfer is interrupted due to an error). This leaves the parent free
to handle other requests. But this solution is kind of lame: fork()
is relatively expensive, and we have to keep a cap on the number of
child processes to keep from swamping the system.

What we do now is grab control of the service transport handle and XDR
handle from the RPC library and send the records one at a time ourselves
instead of letting the RPC library do it. We send a record, then go
back to the svc_run() loop and select() on the socket. If select() says
we can still write data, we send the next record. Then we call
svc_getreqset() and handle other RPCs and loop around again. This way,
we can handle other RPCs between records.

We manage multiple YPPROC_ALL requests using a circular queue. When a
request is done, we dequeue it and destroy the handle. We also tag
each request with a ttl which is decremented whevever we run the queue
and a handle isn't serviced. This lets us nuke requests that have sat
idle for too long (if we didn't do this, we might run out of socket
descriptors.)

Now all I have to do is come up with an async resolver, and ypserv
won't need to fork() at all. :)

Note: these changes should not go into 2.2 unless they get a very
throrough shakedown before the final cutoff date.
1996-11-30 22:38:44 +00:00
Jordan K. Hubbard ab9a6af1c4 Change boolean nature of "router" variable since it's not a boolean
anymore.
Noticed-By: joerg
1996-11-29 23:52:20 +00:00
Poul-Henning Kamp f8d8dfe86e Try to impreve DD mode.
Try to make 4Mb floppies work again.
1996-11-27 22:52:34 +00:00
Andrey A. Chernov 28c5126cfb Don't show on the screen just securely entered password
(in /etc/adduser.message text)
Sending password by E-mail on local machine is joke in any case
1996-11-27 22:04:55 +00:00
Bill Fenner a9695b96ac Add -s flag to always supply mapping if known, ignoring the
presence or absence of files in /tftpboot.
1996-11-27 20:45:10 +00:00
Bill Fenner b60287db00 Make the man page reflect reality. Add BUGS section about DNS.
Logging cleanups (including logging the requestor's MAC address instead
 of the server's).
1996-11-27 20:42:09 +00:00
Stephen McKay 735fa92ade Simplified. Some fts related bugs removed. Made less verbose. The default
number of mail messages sent per run was lowered from 2 to 1.  Why?  Well,
some numbers just give you the warm fuzzies, like zero and one.  Zero isn't
much use here, so I picked my all time favourite, one.
1996-11-27 13:06:51 +00:00
Stephen McKay 37b2250f56 Removed unnecessary locking. Simplified. Tidied. 1996-11-27 12:58:44 +00:00
Jordan K. Hubbard d8c4fd0c82 Correct some typos relating to PC98 server selection.
Submitted-By: HOSOKAWA Tatsumi <hosokawa@mt.cs.keio.ac.jp>
1996-11-27 12:44:43 +00:00
Joerg Wunsch 4b8d17f492 Open devices read-only to test whether they are available. This
allows to use write-protected tapes...
1996-11-27 01:01:52 +00:00
Andrey A. Chernov ae2c6adddd Use LC_TIME=C 1996-11-26 08:53:48 +00:00
Andrey A. Chernov ba0163f6d8 Use LC_TIME=C 1996-11-26 03:41:39 +00:00
Andrey A. Chernov e11ba3694e Use LC_TIME=C instead of LC_TIME= 1996-11-26 03:31:26 +00:00
Peter Wemm a66a1e11cf Don't close f->f_file on F_TTY types on error returns from ttymsg() since
it wasn't open in the first place..
1996-11-26 02:35:08 +00:00
Peter Wemm d486bc8fb9 Make the handling of the /dev/ prefix for tty names more consistant.
ttymsg() insists on them not being there.

Also, since ttymsg() opens the tty "on demand", don't keep an fd open
ourselves.  This would interfere with HUPCL etc.

This should close PR#2103 from <xaa@stack.nl>
1996-11-26 02:24:42 +00:00
Poul-Henning Kamp bbf432c0d6 bin/1974: core dump from amd when phkmalloc is set to AJ. 1996-11-25 19:36:26 +00:00
Mike Smith c1abba55d6 Correct the syntax of the example to reflect reality, and note that the
'host:' element is mandatory.
A better fix would involve reworking bootparamd not to require a ':'
in the response string.
1996-11-25 01:52:28 +00:00
John Hay dbba40ddb7 Slow down the RIP and SAP broadcasts. At least some NW4.x machines can't
handle them back-to-back. (We couldn't either without my ipx receive buffer
enlargement.)
1996-11-24 08:35:23 +00:00
Poul-Henning Kamp da18dc1a65 Don't dump core on zero-size files. 1996-11-21 15:17:04 +00:00
Poul-Henning Kamp 83c7762d77 Latest reality. 1996-11-20 08:21:27 +00:00
Jordan K. Hubbard 0bf57c683e Got the bugger. Eric's now passing in a hint structure to dbopen()
but forgot to zero the structure first, leaving hinfo.bsize undefined
and causing a loop in __log2().
1996-11-20 07:53:42 +00:00
Wolfram Schneider 42eacfd392 do not print 'illegal shell' for pseudo users news and xten
Submitted by:	 kuku
1996-11-20 01:07:46 +00:00
Bill Paul 7632575be6 Although I got rarpd to work, it was largely through kludgery. Bill
Fenner was kind enough to point out the error of my ways. This incorporates
diffs from him which:

- Keep everything in network order.
- Log the booted ether & ip address, instead of my address on that net
- change several exit()'s to return()'s, so that rarpd continues running
  even if it thinks it's in a weird state.

One small tweak by me: in rarp_bootable(), we have to make sure to
construct 'ipname' in host byte order (if we don't, we have to
specify /tftpboot/<remote IP in hex> with <remote IP in hex> in
network byte order, which is confusing).

Also restored use of <dirent.h> rather than <sys/dir.h> as pointed
out by bde.

Also updated the man page so that the -v flag is documented.

With any luck, I won't have to touch this thing again.
1996-11-19 23:57:06 +00:00
Joerg Wunsch b0fa330d5f Remove two uninitialized and unused variables that used to cause a
segfault before.
1996-11-19 23:21:52 +00:00
Garrett Wollman 037def9693 Completely re-vamped `tzsetup':
- It no longer attempts to fiddle wall-vs-UTC-in-RTC.  The results
  were just confusing most of the time.

- The program no longer contains a pre-compiled list of timezones
  (compiled by groveling through the tzdata source files for comments
  starting with `ZONE-DESCR').  Now it uses the new `zone.tab' file
  supplied with current versions of the timezone data files, to determine
  the list at run time.  (It also requires the ISO 3166 table  I
  committed some months ago.)

AS A RESULT, this program will NOT work until the new timezone data files
are committed (should happen sometime soon).
1996-11-19 18:09:41 +00:00
Poul-Henning Kamp fe6aa2730a typo 1996-11-19 11:08:27 +00:00
Bill Paul 5a0da0a5bc Dohw! Left out one important htonl() in update_arptab().
Pointed out by: Bill Fenner
1996-11-18 23:32:55 +00:00
Bill Paul 867de4336b Fix up new rarpd.
This includes the following changes:

- Support for poking ARP entries into the local table is now built
  in, so the arptab.c module I hacked together is no longer needed.

- rarp_process() and rarp_reply() now accept a len argument which is
  passed down from rarp_loop() which tells rarp_reply() exactly how
  long the original RARP frame was. (Usually, it's 60 bytes, which is
  the minimum.) Previously, the length was calculated using the sum
  of sizeof(struct ether_header) + sizeof(struct ether_arp) (plus the
  ethernet frame header, I think). The result was a total packet
  length of 42 bytes. Now, rarp_reply() sends out packets that are
  the same size as those it recieves (60 bytes). This agrees with the
  behavior of rarpd on SunOS (as observed with tcpdump). The unused
  extra bytes are zeroed.
1996-11-18 22:07:41 +00:00
Bill Paul 557201898b This commit was generated by cvs2svn to compensate for changes in r19855,
which included commits to RCS files with non-trunk default branches.
1996-11-18 21:53:21 +00:00
Bill Paul 4bef56e86c Import new version of rarpd from the BPF 1.1 distribution from LBL.
Obtained from: LBL, BPF 1.1 distribution
1996-11-18 21:53:21 +00:00
Peter Wemm a30a31bb3f put on my flame resistant suit and tempt fate by attempting to fix some of
the races in my previous commits here, and fix some other problems with
syslogd as well.

- if the child process exited early (eg: could not bind to the socket),
  the boot process would hang for 30 seconds.  The parent was not noticing
  that the child had exited.  (my fault)
- when writing to tty devices, instead of treating them like files that
  need \r\n instead of \n, actually use ttymsg() which has specific code
  intended to write to potentially blocking ttys safely.  I had a machine
  lock up last night because /dev/console on a serial port got flow control
  blocked.  Setting comcontrol drainwait fixed everything but syslogd which
  was going into a spin trying to write to the console and completely
  ignoreing everything else.
- fix a couple of nonsensical bits of code while here..  eg: wait3 takes
  a pointer to an int.  There is no sense in declaring it as 'union wait',
  then casting the pointer to (int *), then forgetting about it.
1996-11-18 21:48:29 +00:00
Peter Wemm 39c2b03943 Merge conflicts from 8.8.3 import onto mainline. 1996-11-18 02:34:34 +00:00
Peter Wemm dfae3a83bb This commit was generated by cvs2svn to compensate for changes in r19841,
which included commits to RCS files with non-trunk default branches.
1996-11-18 02:26:51 +00:00
Peter Wemm fcf445de96 Import sendmail-8.8.3 - this contains the official fix to replace the
previous workaround patch that I used.

Obtained from: Eric Allman <eric@sendmail.org>
1996-11-18 02:26:51 +00:00
Bill Fenner 31a322801a Update wording of the one message that was in the DIAGNOSTICS section.
Add three other common messages.

This should be in 2.2 to go with the netinet/if_ether.c rewording.
1996-11-17 23:25:17 +00:00
Poul-Henning Kamp a5c57c4040 Make the case where there is no changes look less fatal. 1996-11-17 08:11:18 +00:00
Wolfram Schneider 901c028ed7 install rmuser, addgroup, rmgroup in /usr/sbin 1996-11-17 03:51:33 +00:00
Joerg Wunsch eb14881596 Initialize memory obtained by malloc().
Detected by: phkmalloc -AJ
1996-11-16 22:49:02 +00:00
Joerg Wunsch 7ef22d9129 Provide a symlink for /bin/sh when the fixit floppy is mounted, so
scripts using #!/bin/sh (like /mnt2/dev/MAKEDEV) will work.

Observed by:	andreas
1996-11-16 22:42:13 +00:00
Stefan Eßer b1427fd412 Fix core dump after printing usage message (pointed out by BDE).
Add printing of PCI header type register. (This makes the output
80 columns wide. Ughh. I'm looking for a better way to put the
information on one line ...)
1996-11-16 22:05:52 +00:00
Poul-Henning Kamp e534982b63 Check bogus and ignore against the relative name, not the absolute. 1996-11-16 22:05:46 +00:00
Poul-Henning Kamp 9c0f44a5b3 Improve mkctm.c so we can use it, and start using it.
This should help quite a bit on the load.  Notice that
some minor changes in config files will be needed.
Contact me for details.
1996-11-16 19:30:14 +00:00
Peter Wemm bf8919163f Disallow non-root users to start in daemon mode.
Obtained from: Eric Allman <eric@sendmail.org>
1996-11-16 16:41:17 +00:00
Jordan K. Hubbard 532c723611 Add vx to list of devices. 1996-11-15 19:53:08 +00:00
Bill Paul 58dc15740f Eek! When I added the YP_INTERDOMAIN and YP_SECURE support, I documented
and set the B and S variables here, but I forgot to actually add them to
the master.passwd and hosts.* targets. In other words, they weren't being
passed to yp_mkdb as needed.

This needs to go into 2.2; it doesn't break things a lot, but it leaves
your master.passwd maps available to unprivileged users without you
realizing it.
1996-11-15 18:01:59 +00:00
Peter Wemm a2c9113628 oops, forgot to commit this. the sockaddr_un init code was missing
initialisers for sun_len and not accounting for it in the sizeof
calculation.  Ie: it was potentially sending an unterminated string into
the kernel.
1996-11-15 15:56:45 +00:00
Peter Wemm d21fb5dc4c Fix harmless bugs found while hunting for chpass nis failure 1996-11-15 14:13:51 +00:00
Peter Wemm 8ada212ae6 Uninitialised length variable passed to accept(), causing random accept()
failures due to EFAULT.

This is screaming out to go into 2.2
1996-11-15 14:12:21 +00:00
Andrey A. Chernov 5e8809d7b9 Use new ftpGetURL interface, as result, report FTP error
via ftpErrString or net error via hstrerror(h_errno)
1996-11-14 07:30:17 +00:00
Jordan K. Hubbard 5c3507a872 "over 600 packages" (geeze, this has been sitting uncommitted in my
source tree for 5 days! :-( ).
1996-11-14 05:46:22 +00:00