Commit graph

2219 commits

Author SHA1 Message Date
Jordan K. Hubbard 0495d47f7e Fix fixit floppy. 1996-12-26 03:32:50 +00:00
Wolfram Schneider c69a537c8f Sort cross references. 1996-12-26 02:02:31 +00:00
Bill Paul adc4fa336b More async resolver refinements:
- yp_main.c: Always add the resolver socket to the set of fds
  monitored by select(). It can happen that pending == 0 but we
  still have some data in the socket buffer from an old query.
  This way, the data will be flushed in a timely manner.

- yp_extern.h: remove proto for yp_dns_pending() since we don't need
  it anynmore.

- yp_server.c: call yp_async_lookup_name()/yp_async_lookup_addr()
  functions with the svc_req pointer as an arg instead of the xprt.
  (The svc_req struct includes a pointer to the transport handle,
  and it also has the service version number which the async DNS
  code will need. (see below))

- yp_dnslookup.c:

   o Nuke yp_dns_pending() since we don't need it anymore.
   o In yp_run_dnsq(), swallow up and ignore replies if no requests
     are pending or the ID doesn't match any of the IDs in the queue.
   o In yp_send_dns_reply(), we assume that we will always be
     replying to an NIS v2 client. While this will probably always
     be the case, we do support the v1 'match' procedure, and it
     has a different result struct than v2. For completeness,
     support replying to both NIS v1 and v2 clients.
   o Update the queue entry structure to include a member to
     keep track of the NIS version number.
   o Have yp_async_lookup_name/addr() extract the version number
     from the svc_req structure and save it with the queue entry
     for yp_send_dns_reply() to inspect later.
   o Add some comments.
1996-12-25 18:10:35 +00:00
Bill Paul 926f037af9 Fix some bugs:
- Don't dereference a NULL hostent pointer (if T_PTR lookup fails).

- Today I asked myself: "Self, you wrote this nifty async resolver
  that does a great job handling delayed replies to clients using
  the UDP transport, and the yplib code in libc always uses UDP
  (except for yp_all()). But what if some dork makes a DNS lookup using
  TCP?" Being the only dork on hand at the time, I tried it and was
  enlightened. As I suspected, my transaction ID frobbing hacks cause
  fireworks if called on a TCP transport handle (duh: the structures
  are different). Fix: check the type of socket in xprt->xp_sock using
  getsockopt() and don't use svcudp_get_xid() and svcudp_set_xid() for
  anything except SOCK_DGRAM sockets. (Since accept() gives you a
  new socket for each connection, the transaction ID munging isn't
  needed for TCP anyway.)
1996-12-24 02:44:52 +00:00
Wolfram Schneider 13608f6661 comma typos 1996-12-23 23:09:55 +00:00
David Nugent b5cc56ab27 Correct file modes on updated /etc/skeykeys. 1996-12-23 02:27:29 +00:00
Mike Pritchard 4c574b956a Some more man page cleanup. 1996-12-23 02:19:12 +00:00
Mike Pritchard 787a18dba6 Minor internal mdoc usage changes. 1996-12-23 00:57:46 +00:00
Mike Pritchard fefbe220bc Convert to mdoc format. 1996-12-23 00:22:00 +00:00
Mike Pritchard 574d7dc09d Minor style fixes.
I also renamed the adduser "-quit" option to "-quiet", since
it is supposed to be the same as the -s/-silent option,
and -quit must have beena typo.
1996-12-23 00:10:22 +00:00
Bill Paul 180807d214 Big round o changes:
- yp_dblookup.c: Create non-DB specific database access functions.
  Using these allows access to the underlying database functions without
  needing explicit knowledge of Berkeley DB. (These are used only
  when DB_CACHE is #defined. Other programs that use the non-caching
  functions (yp_mkdb, ypxfr, yppush, rpc.yppasswdd) shouldn't notice
  the difference.)

- yp_dnslookup: Implement async DNS lookups. We send our own DNS
  requests using UDP and put the request in a queue. When the response
  arrives, we use the ID in the header to find the corresponsing queue
  entry and then send the response to the client. We can go about our
  business and handle other YP requests in the meantime. This way, we
  can deal with time consuming DNS requests without blocking and without
  forking.

- yp_server.c: Convert to using new non-DB-specific database access
  functions. This simplifies the code a bit and removes the need for
  this module to know anything about Berkeley DB. Also convert the
  ypproc_match_2_svc() function to use the async DNS lookup routines.

- yp_main.c: tweak yp_svc_run() to add the resolver socket to the
  set of descriptors monitored in the select() loop. Also add a
  timeout to select(); we may get stale DNS requests stuck in the
  queue which we want to invalidate after a while. If the timeout
  hits, we decrement the ttl on all pending DNS requests and nuke
  those requests that aren't handled before ttl hits zero.

- yp_extern.h: Add prototypes for new stuff.

- yp_svc_udp.c (new file): The async resolver code needs to be able
  to rummage around inside the RPC UDP transport handle in order to
  work correcty. There's basically one transport handle, and each time
  a request comes in, the transaction ID in the handle is changed.
  This means that if we queue a DNS request, then we handle some other
  unrelated requests, we will be unable to send the DNS response because
  the transaction ID and remote address of the client that made the DNS
  request will have been lost. What we need to do is save the client
  address and transaction ID in the queue entry for the DNS request,
  then put the transaction ID and address back in the transport handle
  when we're ready to reply. (And then we have to undo the change so
  as not to confuse any other part of the server.) The trouble is that
  the transaction ID is hidden in an opaque part of the transport handle,
  and only the code in the svc_udp module in the RPC library knows how
  to handle it. This file contains a couple of functions that let us
  read and set the transaction ID in spite of this. This is really a
  dirty trick and I should be taken out and shot for even thinking about
  it, but there's no other way to get this stuff to work.

- Makefile: add yp_svc_udp.c to SRCS.
1996-12-22 22:30:58 +00:00
Jordan K. Hubbard 6d14e2a8e6 For /usr/sbin/ppp, you must choose between running ppp in the background or
connecting to a host immediately in the foreground.

I would like to be able to run ppp from a script so that my script can be
sure that it is connected to the 'net before it continues running:

  # Dial up the internet.
  ppp -background myprovider || exit 1

  do-some-net-command

  # Hang up the modem.
  kill -HUP `cat /var/run/ppp.tun0.pid`

Another problem is that the current ppp calls its process id file
`/var/run/PPP.server', which may conflict if you have more than one IP
tunnel interface available.

Closes PR#1469
Submitted by:	Gord Matzigkeit <gord@enci.ucalgary.ca>
1996-12-22 17:29:33 +00:00
Jordan K. Hubbard 17e762ca3d Make CRTSTS selection a runtime option. Closes PR#1392
Submitted by:	Mike McGaughey <mmcg@heraclitus.cs.monash.edu.au>
1996-12-22 17:09:17 +00:00
Mike Pritchard ab40944758 Convert to mdoc format. 1996-12-21 23:23:11 +00:00
Mike Pritchard 441c428f70 Grr. Fix a spelling error. 1996-12-21 22:22:55 +00:00
Mike Pritchard ee3704e411 Convert to mdoc format, and rewrite most of the man page
while I was at it.
1996-12-21 22:21:48 +00:00
Mike Pritchard 747f0006ca Convert to mdoc format. 1996-12-21 21:57:21 +00:00
Mike Pritchard 389766f3b2 Convert to mdoc format. 1996-12-21 21:15:09 +00:00
Nate Williams 66041afd67 Compute IP checksums in addition to TCP checksums when necessary in the
new 'aliased' packets.  Note, if the original packet has a bogus cksum,
we will *NOT* re-compute the cksum, therefore the new packet will also
be wrong (but passed on).

Found by:	MartinRenters@awfulhak.demon.co.uk
Reviewed by:	Brian Somers <brian@awfulhak.demon.co.uk>
Submitted by:	Charles Mott <cmott@srv.net>
1996-12-21 18:34:52 +00:00
David Nugent 0970881ff6 1) 200 users per group limitation removed and pw
will handle lines of any length in /etc/group.
2)	Fixed bug with usermod -d not updating user's home
	directory.
3)	Minor formatting display changes/fixes with *show -P.
1996-12-21 15:35:45 +00:00
David Nugent 5e75134d21 Bugfix (cosmetic) for output of generated passwords. 1996-12-20 10:45:39 +00:00
Bill Fenner 7ae3d6826f Merge from release 5.1. 1996-12-20 01:32:12 +00:00
Bill Fenner 0ad74a38f4 This commit was generated by cvs2svn to compensate for changes in r20701,
which included commits to RCS files with non-trunk default branches.
1996-12-20 01:29:00 +00:00
Bill Fenner 54e56efac0 Import the mtrace "5.1" release. The version number jump is because
mtrace is now distributed seperately from mrouted.
1996-12-20 01:29:00 +00:00
Nate Williams 63c6440041 Renamed private copy of ether_aton to my_ether_aton so as to not
conflict with the version in <net/ethernet.h>
1996-12-19 19:33:10 +00:00
David Nugent d9b711b719 Allow 8-bit characters in the passwd gecos field, and adds a paragraph
to the mangpage explaining the consequences (to be updated at a later
date after login class conf support is added).
1996-12-19 15:22:45 +00:00
Nate Williams 3b92d2dee8 Fixed prototypes of PacketAliasIn/Out. (cosmetic)
Submitted by:	Brian Somers <brian@awfulhak.demon.co.uk>
1996-12-19 00:41:42 +00:00
Warner Losh d07d447b29 Apply patch in pr 2067 to correct an uninitialized pointer dereference
in tickadj.  Tested briefly here and it it seems to work.

Possible 2.2 candidate.

Submitted by:	Don Lewis <Don.Lewis@tsc.tdk.com>
Closes PR:	2067
1996-12-17 17:21:47 +00:00
Jordan K. Hubbard 7837dcf615 Use RAW, not CBREAK 1996-12-17 15:26:40 +00:00
Stephen McKay aded5373e9 Correct MLINKS, now that I know how it actually works. 1996-12-17 14:28:09 +00:00
David Nugent 2e3db6fbe0 Changes to password generator: fallback to MD5 generator disabled
(/dev/urandom used by default under FreeBSD), and implemented a
"portable" but less secure generator for other systems.
Add display of expiry/password change dates in -P user display.
1996-12-17 14:15:35 +00:00
David Nugent a36f769f47 Submitted by: proff@iq.org
Minor fix for security patch.
1996-12-17 01:43:30 +00:00
Paul Traina bdddbd2f3f Replace my "inane" usage of snprintf to copy strings with strncpy as
used by OpenBSD.  (Quite frankly, I think it's perfectly reasonable to
use snprintf to copy strings, given that the semantics for strncpy()
are utterly idiotic and there is no POSIX sstrncpy().)

While I'm at it, incorporate some of OpenBSD's bugfixes to cron.

NOT for 2.2
1996-12-17 00:55:20 +00:00
Jordan K. Hubbard 3cce01a416 1. Engage brain. 2. Write macro. Previous commit attempted to perform
2 before 1.
1996-12-17 00:00:15 +00:00
Paul Traina 482bfccc70 Close yet another buffer overrun 1996-12-16 18:21:00 +00:00
David Nugent b7d2ba7cb8 Reviewed by: davidn@blaze.net.au
Submitted by:	proff@iq.org
	Security patch for better random password generation.
1996-12-16 17:37:58 +00:00
Mike Pritchard 94a804c558 Add man page for moused(8). It is basically a rehash of the
usage output from moused, but it is a start for anyone
else who wants to expand on it.

Closed PR# 1552.
1996-12-16 01:05:00 +00:00
Bill Fenner 72f54beaca Add mtest. 1996-12-16 01:01:46 +00:00
Mike Pritchard ee6dc17bd1 Add the one line description of the man page at the top so
that "whatis" will report something more than just "mtest".
1996-12-15 23:02:48 +00:00
Bill Fenner cf20f87153 Make mtest build. Write a makefile and a man page. 1996-12-15 21:57:32 +00:00
Bill Fenner fc3cc3f5cf A multicast testing program, allowing you to join and leave both
IP and ethernet multicast groups.

Obtained from:	Multicast release 3.5
1996-12-15 21:30:02 +00:00
Paul Traina 053edb3c0c Avoid some buffer overrun problems. 1996-12-15 20:39:30 +00:00
Jordan K. Hubbard 50aaa93770 make note of which /etc files need upgrading in installUpgrade rather
than asking the user to keep track of the list himself.
1996-12-15 18:14:37 +00:00
Stephen McKay 147962b004 Documented ctm_dequeue and the new feature of ctm_smail that goes with it.
Expanded the ctm_rmail example usage section.
1996-12-15 15:10:11 +00:00
Joerg Wunsch 833e0176e3 Increase the size of the vector that is allocated for execv(). Jordan
apparently forgot this when adding the password feature.
1996-12-15 11:22:37 +00:00
Jordan K. Hubbard 507372af02 Now that I've got my source tree sorted out, bring all the things
I've been committing into 2.2 directly all this time.
1996-12-14 23:09:10 +00:00
Joerg Wunsch 5bd7b80934 Part #2 of the config cleanup. More aggressive, replaced an NIH
version of strdup() by a macro, killed many calls to strdup(), thus
potentially wasting less malloc'ed space (their args were never be
free()ed desptie despite of being malloc'ed).  Probably still a huge
memory leak at all...  Also killed two totally useless variables.

I've tested it as i could, but wouldn't be surprised if unexpected
problems showed up.  So watch out this space!
1996-12-14 19:53:49 +00:00
Joerg Wunsch f0b48d9876 Round #1 of cleaning up the config(8) mess. This is only the more
conservative part of the tidyup, like fixing potential buffer overflow
conditions.  It is believed to be safe to go into 2.2.

Pointed out by:	lozenko@cc.acnit.ac.ru (Evgeny A. Lozenko)
1996-12-14 19:44:13 +00:00
Jordan K. Hubbard d17f0c47d4 Fix some very minor cosmetic cruft I couldn't help tweaking when
I went over the code.

Add shortcuts for addUser and addGroup, documenting same.

Add a password field for adduser and use no-echo string field for it.
This requires my latest libdialog changes (in RELENG_2_2 or -current) to work.
1996-12-14 16:24:01 +00:00
Stefan Eßer 2640db5095 Remove reference to unused variable ncr.ns_async. 1996-12-14 12:53:30 +00:00
Bruce Evans c08d58eade Moved nonstandard compiler profiling options out of config. Just print
the profiling level in config and decide what to do in makefiles.

Makefile.i386:
Align functions to 16-byte boundaries if profiling is enabled.  This
will allow a fourfold reduction in the size of the profiling buffers.
1996-12-13 12:46:28 +00:00
Jordan K. Hubbard af3bab3687 700 now. :) 1996-12-12 23:12:44 +00:00
Jordan K. Hubbard 177baf1802 Fix trunctation of domainname. 1996-12-12 22:44:22 +00:00
Jordan K. Hubbard 3cd31ab739 Add some additional smarts for XFree86 configuration.
Fix a bogon I thought I fixed in the last commit.
1996-12-12 22:38:41 +00:00
Jordan K. Hubbard 40e60c63b3 Update these docs to more closely reflect reality. 1996-12-12 20:03:35 +00:00
Jordan K. Hubbard 6258ab4afc smart-alec error checking. 1996-12-12 16:55:37 +00:00
Jordan K. Hubbard a9f484e520 The infamous IP aliasing code for ppp, modified to work as a runtime option
(otherwise ppp's behavior remains unchanged) and documented by myself,
Steve Sims, Nate Williams, Martin Renters and god-only-knows who else. :-)
Submitted by:	nate
Obtained from:	Charles Mott <cmott@srv.net>
1996-12-12 14:39:47 +00:00
Jordan K. Hubbard a674766556 Whups, remove relic from close method going away. 1996-12-12 08:36:25 +00:00
Jordan K. Hubbard 0da9521b5a Undo one of my memory optimization hacks - it actually made things more
complicated.
1996-12-12 08:33:38 +00:00
Jordan K. Hubbard d62f165304 Fix some bogons in my close() handling. 1996-12-12 08:23:51 +00:00
Jordan K. Hubbard 0a0e709620 Cosmetic tweaks, initialize a few variables, fix a reversed conditional. 1996-12-11 19:35:26 +00:00
Jordan K. Hubbard 86767547be Be more efficient in how we use memory (stumbled across while looking for
something else) for attributes and variables.

Remove stack-stomper in sstrncpy().
1996-12-11 18:23:19 +00:00
Joerg Wunsch 669d204645 Update from David, reflecting Wolfram's wishes regarding limitation of
the allowable character set.

Submitted by:	David Nugent
1996-12-11 15:10:47 +00:00
Jordan K. Hubbard 0fd6d431cf Do a few things I've been threatening to do for a long time:
1. Don't use the MSDOSFS code for accessing FreeBSD distribution data.
   Use Robert Nordier's stand-alone DOS I/O library for the purpose.
   It this works as well as Robert says it does, it should drastically reduce
   (or even eliminate) our "I can't install from my DOS partition!" calls.

2. As a result of the above, go to stdio file descriptors for all
   media types.

3. Taking advantage of #2, start using libftpio for FTP transfers instead
   of maintaining our own parallel version of the FTP transfer code.
   Yay!  I ripped something out for a change!

#1 Submitted-By: Robert Nordier <rnordier@iafrica.com>
1996-12-11 09:35:06 +00:00
Joerg Wunsch db34a7105c Merg-o-matic. 1996-12-11 00:07:19 +00:00
Joerg Wunsch ad7cf975be Copyright update by the author, to be more in line with our sample
copyright.

Submitted by:	David Nugent
1996-12-10 23:59:04 +00:00
Peter Wemm 5bb4699e9c Revert part of the previous change. syslogd (when logging to ttys)
has always held an open file descriptor.  This allowed logging to
spare virtual consoles and being able to switch to them.

My previous change removed this since all writes were done with ttymsg()
which opens it's own fd, and hence syslogd didn't need it's own fd to
send messages on... but this caused an unexpected behavior change.

This should close PR#2176
1996-12-10 17:52:23 +00:00
Garrett Wollman 628d2ac1b0 Fix up programs which expect <net/if.h> to include <sys/time.h> to instead
do it themselves.  (Some of these programs actually depended on this
beyond compiling the definition of struct ifinfo!)  Also fix up some
other #include messes while we're at it.
1996-12-10 17:11:53 +00:00
Joerg Wunsch c381383f32 Update to benefit from David's recent changes to pw(8). The most
obvious effects are that most of the automagically chosen defaults
will now be displayed while going through the menu, and an improved
error handling thanks to the more detailed error status reporting.

2.2 fodder, but i'll leave it to Jordan's review.
1996-12-10 02:16:06 +00:00
Joerg Wunsch 9fd0dafc15 Merge from the vendor-branch. 1996-12-10 00:21:28 +00:00
Joerg Wunsch 48aee7f33a Upgrade from the author, reflecting all my wishes resulting out of the
sysinstall use of this tool (plus some bug fixes).

2.2 candidate...

Submitted by:	David Nugent <davidn@nserver.usn.blaze.net.au>
1996-12-09 23:55:27 +00:00
Mike Pritchard 053375e81b Minor spelling/mdoc/style fixes. 1996-12-09 16:44:13 +00:00
Jordan K. Hubbard a4ba0988d9 Set timeout interval to 0 in ppp so connections don't hang up while
we're doing something lengthy with the disk.
1996-12-09 15:16:36 +00:00
Jordan K. Hubbard 1b62258da5 Add pw to build list - I need it now. :) 1996-12-09 14:53:36 +00:00
Joerg Wunsch b0b4f32a68 Slightly improve the wording of a ``not yet there'' message. 1996-12-09 14:08:26 +00:00
Joerg Wunsch d6f907dc7a pw(8) -- a backend utility to manage the user and group databases.
sysinstall's new User&group menu will use it, hence it's a 2.2
candidate despite of providing new functionality.

Submitted by:	David L. Nugent, <davidn@blaze.net.au>
1996-12-09 14:05:35 +00:00
Jordan K. Hubbard 00b69db338 As Paul has just pointed out, much of my strncpy() usage was either
bogus or overly complex and really needed to be done more consistently
and sanely throughout - no question about it.  Done.

Suggested-By: Paul Traina <pst@Shockwave.COM>
1996-12-09 08:22:19 +00:00
Mike Pritchard 256835f230 Minor formatting/style fixes.
Submitted by:	Sandro Sigala <sandro@cat.local.net> as part of PR# 2134
1996-12-09 08:04:55 +00:00
Mike Pritchard 9e9e968a54 Convert to mdoc format.
Submitted by:	Sandro Sigala <sandro@cat.local.net> as part of PR# 2134
1996-12-09 07:20:41 +00:00
Jordan K. Hubbard 3f266859a3 Whups, missed two strcpy()s. 1996-12-09 06:45:03 +00:00
Jordan K. Hubbard 5153026dfc Eliminate great evil in the networking code. That's all I'm gonna say. 1996-12-09 06:37:46 +00:00
Jordan K. Hubbard 325403f959 Add Joerg's user management screen for David Nugent's pw(8) program, something
which will also need to be brought in before this screen will work.

Add some commentary about how the slip startup code is bogus.

Steal Joerg's loop for more properly closing all files and graft it into
the EHS startup.  My loop was functional but more bogus.
1996-12-09 06:02:36 +00:00
Jordan K. Hubbard ba5555f0e6 Several areas of improvement:
o Incorporate some of Tatsumi's bug fixes.
	o Remove the xperimnt and commerce distribution items; they haven't
	  been actual distributions for awhile.
	o Try to sanitize the device checking code a little more.
	o Cosmetic work on the network code.
1996-12-08 12:27:58 +00:00
Andrey A. Chernov 2f71230e78 Expand username limit to 16 1996-12-07 21:25:12 +00:00
Peter Wemm e8fce182a6 Update this to what freefall's been running for a day or so. 1996-12-06 11:29:15 +00:00
Nate Williams 680026d67a Added my 'ddial' patches to user-PPP. The new mode tries it's darndest
to keep the link up, so it re-dials whenever it detects the link go
down.  This is useful for 'dedicated' links who use PPP.

It's been used for over a year w/out problems at different sites.
1996-12-03 21:38:52 +00:00
Peter Wemm 691ca30fca Remove file that we don't have any way of using. We don't have the other
Makefiles for other OS's in our tree that this uses when not using bmake.
1996-12-03 06:21:49 +00:00
Peter Wemm 5d72136fb8 Remove file no longer shipped with sendmail 1996-12-03 06:20:18 +00:00
Peter Wemm 91e5dab34f Remove defunct files that are no longer shipped (and don't work with this
version of sendmail any more)
1996-12-03 06:19:51 +00:00
Peter Wemm dc5a26cc5c Back out rev 1.6, it's in the official source now (a few lines up) 1996-12-03 06:18:11 +00:00
Peter Wemm 589790e627 Merge 8.8.3->8.8.4 changes onto our mainline where we've edited the
file at some point in the past.

Obtained from: Eric Allman <eric@sendmail.org>
1996-12-03 06:15:52 +00:00
Peter Wemm b4165e3a49 This commit was generated by cvs2svn to compensate for changes in r20103,
which included commits to RCS files with non-trunk default branches.
1996-12-03 06:07:35 +00:00
Peter Wemm 33cdb0aebd Import sendmail 8.8.4. See RELEASE_NOTES for changes. 1996-12-03 06:07:35 +00:00
Bill Paul 4c69e7b9d5 Back out the non-forking YPPROC_ALL stuff. Whatever drugs I was doing
when I came up with this idea weren't strong enough to help me see it
through. If this was a self-contained application and I had complete
control over what data got sent through what socket and when, I might
be able to get everything to work right without blocking, but instead
I have RPC/XDR in between me and the socket layer, and they have their
own ideas about what to do.

Maybe one day I'll go totally mad and figure out the right way to do
this; in the meantime this mess goes on the back burner.
1996-12-03 02:37:39 +00:00
Bill Fenner 7c0ac9472b Fix a typo in the man page (the "-n" flag was added to the synopsis in
a comment).
1996-12-02 16:21:20 +00:00
Jordan K. Hubbard 5009d1be3c I have added a '-n' flag to the watch(8) command. This option
disables the ability to interactively select a new tty.  I have also
removed a check for uid == 0 because it gets in the way of using suid
mode based access control.  Watch (8)is only runnable by root, so this
does not really change things much.

Closes PR#2131

Submitted-By: adrian@virginia.edu
1996-12-02 12:32:46 +00:00
Jordan K. Hubbard b4a24ca1f0 Don't run routed by default.
Virtually-Demanded-At-Gunpoint-By: joerg
1996-12-02 05:01:02 +00:00
Jordan K. Hubbard a2a3d9f413 Move configResolv() to *after* the chroot(). This is what was causing
NFS installation to fail the first time.  This will go into 2.2.
1996-12-01 12:27:36 +00:00
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