summaryrefslogtreecommitdiffstats
path: root/usr.bin/ypwhich
Commit message (Collapse)AuthorAgeFilesLines
* Prepare for mdoc(7)NG.ru2000-12-271-3/+1
|
* mdoc(7) police: use the new features of the Nm macro.ru2000-11-201-3/+3
|
* $Id$ -> $FreeBSD$peter1999-08-283-3/+3
|
* #include <arpa/inet.h>peter1998-06-121-3/+5
| | | | Also, use real struct in_addr rather than u_long.
* Fix a bunch of spelling errors.steve1998-06-041-2/+2
| | | | | PR: 6856 Submitted by: Josh Gilliam <josh@quick.net>
* .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq.charnier1998-03-231-3/+3
|
* Add ypwhich(1) and yppoll(8) manual pages.wosch1997-09-212-2/+101
| | | | Obtained from: NetBSD, slightly modified
* Use err(3). Cosmetic in usage(). Delay the compute of defaultdomain (fromcharnier1997-08-291-34/+28
| | | | | OpenBSD). Obtained from: OpenBSD.
* Add an alias for master.passwd -> master.passwd.byname to the listpeter1997-07-121-0/+1
| | | | of convenience map aliases.
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* More XDR routine cleanups. These three programs should be the onlywpaul1995-12-151-8/+9
| | | | ones that require this: the others call the yplib functions in libc.
* Slightly better message for `ypwhich -x':wollman1995-07-201-1/+1
| | | | | was: Use "foo" for "foo.bar" now: "foo" is an alias for "foo.bar"
* Remove trailing whitespace.rgrimes1995-05-301-1/+1
|
* ypbind.c: Major overhaul.wpaul1995-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Moved to a more client-driven model. We aggressively attempt to keep the default domain bound (as before) but we give up on non-default domains if we lose contact with a server and fail to get a response after one round of broadcasting. This helps drastically reduce the amount of network bandwitdh that ypbind consumes: if a client references the secondary domain at some later point, this will prod ypbind into establishing a new binding anyway, so continuously broadcasting without need is pointless. Note that we still actively seek out a binding for our default domain even if no client program has queried us yet. I'm not exactly sure if this matches SunOS's behavior or not, but I decided to do it this way since we can get into all sorts of trouble if our default domain comes unbound. Even so, we're still much quieter than we used to be. - Removed a bunch of no-longer pertinent comments and a couple of chunks of #ifdef 0'ed code that no longer fit in to the new layout. - Theo deRaadt must have become frustrated with the callback mechanism in clnt_broadcast(), because he shamelessly stole the clnt_broadcast() code right out of the RPC library and hacked it up to suit his needs. (Comments and all! :) I can understand why: clnt_broadcast() blocks while awaiting replies. Changing this behavior requires surgery. However, you can work around this: fork the broadcast into a child process and relay the results back to the parent via a pipe. (Careful obervation has shown that the SunOS ypbind forks children for broadcasting too, though I can only guess what sort of interprocess communication it uses. pipe() seems to do the job well enough.) This may seem like the long way around, but it's not really that hard to implement, and I'd prefer to use documented RPC library functions wherever possible. We're careful to limit the number of simultaneous broadcasters to avoid swamping the system (the current limit is 5). Each clnt_broadcast() call only sends out a small number of packets at increasing intervals. We're also careful not to spawn more than one bradcaster for a given domain. - Used clntudp_bufcreate() and clnt_call() to implement a ping() function for directly querying a particular server so that we can check if it's still alive. This lets me completely remove the old bradcasting code and use actual RPC library calls instead, at the cost of more than a few handfulls of torn-out hair. (Make no mistake folks: I *HATE* RPC.) Currently, the ping interval is one minute. - Fixed another potential 'nfds too big for select()' bug: use _rpc_dtablesize() instead of getdtablesize(). - Quieted gcc -Wall a bit. - Probably a bunch of other stuff that I've forgotten. ypbind.8: - Updated man page to reflect modifications. ypwhich.c: - Small mind-o fix from last time: decode error results from ypbind correctly (*groan*) yplib.c: - same as above - Change behavior of _yp_dobind() a little: if we get back a 'Domain not bound' error for a given domain, retry a few times before giving up and passing the error back to the caller. We have to sleep for a few seconds between tries since the 'Domain not bound' error comes back immediately (by repeatedly looping, we end up pounding on ypbind). We retry at most 20 times at 5 second intervals. This gives us a full minute to get a response. This seems to deviate a bit from SunOS behavior -- it appears to wait forever -- but I don't like the idea of perpetually hanging inside a library call. Note that this should fix the problems some people have with bindings not being established fast enough at boot time; sometimes amd is started in /etc/rc after ypbind has run but before it gets a binding set up. The automounter gets annoyed at this and tends to exit. By pausing ther YP calls until a binding is ready, we avoid this situation. - Another _yp_dobind() change: if we determine that our binding files are unlocked or nonexistent, jump directly to code that pokes ypbind into restablishing the binding. Again, if it fails, we'll time out eventually and return.
* Make Rod Grimes's life a little simpler: replace all exit(1)'s withwpaul1995-04-221-8/+14
| | | | | | | | | seperate exit values depending on the error. (The error values are #defined and commented near the top of the file for clarity). This is to help write a small bit of shell script for /etc/rc that calls ypwhich a few times after ypbind is invoked to make sure we're actually bound to a server before proceeding (if we aren't, the automounter can fail if it's using NIS maps).
* small NIS binding fixes:wpaul1995-04-211-1/+1
| | | | | | | | | | | | | | | ypbind.c: if a client program asks ypbind for the name of the server for a particular domain, and there isn't a binding for that domain available yet, ypbind needs to supply a status value along with its failure message. Set yprespbody.ypbind_error before returning from a ypbindproc_domain request. yplib.c: properly handle the error status messages ypbind now has the ability to send us. Add a ypbinderr_string() function to decode the error values. ypwhich.c: handle ypbind errors correctly: yperr_string() can't handle ypbind_status messages -- use ypbinderr_string instead.
* Move more YP user programs over.wollman1994-08-082-0/+256
OpenPOWER on IntegriCloud