freebsd-src/usr.bin
Bill Paul 456ebbf8f5 ypbind.c: Major overhaul.
- 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.
1995-04-26 19:03:16 +00:00
..
apply BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
apropos BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
ar Old fix from Robert Crowe <bob@speakez.com> that has been sitting in 1995-01-09 04:50:30 +00:00
at Fight over non-working setruid 1995-04-15 22:08:10 +00:00
banner More merry makefile munging for man page compatability. 1994-08-05 19:00:04 +00:00
basename BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
bdes BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
biff BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
cal BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
calendar Reflects $HOME dir handling 1994-12-31 12:32:01 +00:00
cap_mkdb BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
chat Use proper device names. 1994-12-19 01:22:21 +00:00
checknr BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
chflags Document the arch flag. It has always worked in 2.0. 1994-12-27 16:49:08 +00:00
chpass Missing ${DESTDIR} on chflags commands added. 1995-04-17 19:15:38 +00:00
cksum BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
cmp I don't like what they did to cmp(1) in 4.4 Lite; now it whines all 1994-08-20 11:14:07 +00:00
col Obtained from: looked at the fix in 1.1.5 and rewrote it 1995-01-17 07:02:31 +00:00
colcrt BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
colldef Move digits before letters 1995-04-14 15:56:32 +00:00
colrm BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
column BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
comm BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
compile_et According to stdlib.h, malloc and realloc return void * but error_table.y 1995-03-15 19:05:28 +00:00
compress Correct the usage of the maxmaxcode so that compress -b 12 works again. 1995-01-02 10:04:02 +00:00
cpp Define __GNUC__ as 2 same as cc -E would do. 1994-09-05 13:58:58 +00:00
ctags BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
cut Fix wrong separator output 1995-03-21 00:26:32 +00:00
devmenu Don't crash when there are too many items to fit on one screen. 1995-04-15 23:10:59 +00:00
diff BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
dig Correct the dig manpage that has some macros in it, that our man system 1994-11-19 13:12:37 +00:00
dirname BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
du The last commit was bogus...the putenv doesn't affect the parent process, 1994-08-12 10:19:05 +00:00
env BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
error BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
expand BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
f2c Don't default to -g in ${CFLAGS}. Developers can still use `make g=-g ...' 1995-01-21 14:41:45 +00:00
false BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
fib Fix calculation of default field heights and a bug in the setting 1995-02-01 04:08:19 +00:00
file Add recognition of HP Printer Job Language (PJL) commands. 1995-03-24 01:17:29 +00:00
file2c This is a small little program used to execute a bad practice a clean way :-) 1995-01-29 00:49:57 +00:00
find Fix completely broken find behaviour: 1995-02-27 20:52:36 +00:00
finger Make finger(1) accept "cua" to be also a tty, and use the suffix instead 1995-03-25 18:15:40 +00:00
fmt BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
fold BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
fpr BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
from BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
fsplit BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
fstat Added #include <sys/queue.h> 1995-04-10 00:38:15 +00:00
ftp Use port 21 as default if getservbyname fails to find it for us. This let 1995-04-20 05:38:58 +00:00
gcore Add dependencies on libraries to DPADD. Someday this should be done 1994-08-28 18:49:06 +00:00
gencat Add the gencat command for creating message catalog fodder for the new 1995-03-30 12:49:09 +00:00
getopt Added README which explains the copyright status of getopt(1) 1993-07-27 17:24:17 +00:00
gprof Added much-needed new options -[lL], to suppress printing of either the 1994-12-22 20:52:15 +00:00
grep/egrep Add dependencies on libraries to DPADD. Someday this should be done 1994-08-28 18:49:06 +00:00
head BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
hexdump Change .0 man extents to .1, as reported by Julian Elischer. Whoops, 1994-08-13 05:00:39 +00:00
host Changed the usage of the new not existant manpage macros CMD_EXT, INDOT 1994-12-12 00:23:00 +00:00
id Make id' and groups' somewhat faster and less cpu-intensive :-) 1994-10-11 02:13:21 +00:00
indent BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
ipcrm Utility for deleting message queues, semaphores and shared memory segments. 1994-09-13 16:52:12 +00:00
ipcs NetBSD -> FreeBSD 1994-11-19 18:19:27 +00:00
join BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
jot BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
kdump -I${.CURDIR}/../.. 1994-11-21 00:54:28 +00:00
key Include most of the logdaemon v4.4 S/key changes 1994-10-19 00:03:45 +00:00
keyinfo 1) Added s/key support . 1994-05-19 18:13:11 +00:00
keyinit Include most of the logdaemon v4.4 S/key changes 1994-10-19 00:03:45 +00:00
ktrace Reviewed by: 1994-08-28 15:49:55 +00:00
kzip Do kernels up to 2Mb. 1995-04-25 05:27:04 +00:00
lam BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
last BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
lastcomm Fix output field range 1995-04-11 18:50:51 +00:00
ld BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
ldd Updated to recent version of Paul K.'s shlib code. This code has better 1994-12-23 22:31:35 +00:00
leave BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
lex Change references to flex(1) and flexdoc(1) to lex(1) and 1994-08-27 10:00:14 +00:00
locate Better protection against too long pathes and 8bit controls in file 1995-01-21 05:50:50 +00:00
lock Add dependencies on libraries to DPADD. Someday this should be done 1994-08-28 18:49:06 +00:00
logger BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
login Fix spelling error that keeps this from compiling with KERBEROS & SKEY 1995-04-16 20:00:21 +00:00
logname BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
look BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
lorder lorder(1) manual page not properly installed due to makefile usurping 1994-10-27 19:23:30 +00:00
lsvfs Fix bonehead formatting error. 1995-03-16 21:43:03 +00:00
m4 1) kill temp diver upon exit 1995-04-16 23:31:35 +00:00
mail This is the 90's, ask the user for a Subject by default when sending mail. 1995-04-03 05:40:54 +00:00
make Bring in a number of changes from NetBSD's make, fixing quite a few 1995-01-23 21:03:17 +00:00
man BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
mesg BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
mk_cmds Port to FreeBSD. (Sorry there's no man page yet.) 1995-01-19 22:27:58 +00:00
mkdep Fix -p option sed script so that it really does change program.o: into 1994-10-03 23:01:03 +00:00
mkfifo BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
mklocale Fix owner/mode for installed data 1995-01-30 15:34:06 +00:00
mkstr BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
modstat Undo the stupidity I inflicted on these files and replace it with 1995-04-20 05:08:53 +00:00
more more now uses POSIX regular expressions and no longer needs libcompat. 1995-02-21 03:46:48 +00:00
msgs Use tcflush(), eliminate libcompat. 1995-02-21 04:15:15 +00:00
mt Make mt(1) orthogonal: now that we print the densities as strings 1995-04-18 22:27:43 +00:00
ncftp Merge. 1995-04-16 14:26:18 +00:00
netstat That's what I get for doing things in a hurry...applied up-to-date patch 1995-04-09 15:12:21 +00:00
nfsstat Use new NFS sysctl interface to get statistics rather than reading /dev/kmem, 1994-10-23 23:25:43 +00:00
nice BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
nm Fix bug with printing out short archive entries, 1994-12-28 14:11:21 +00:00
nohup BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
pagesize More merry makefile munging for man page compatability. 1994-08-05 19:00:04 +00:00
passwd Remove references to yppasswd_xdr.c: the stuff in this file already exists 1995-04-01 19:19:15 +00:00
paste BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
patch BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
pr BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
printenv BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
printf BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
quota BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
ranlib Fixed two bugs: some malloced space wasn't freed after it was no longer 1995-01-09 05:59:04 +00:00
rdist Use POSIX.2 regular expressions, kill libcompat. 1995-02-21 04:32:55 +00:00
renice Add renice's correct man page to the Makefile. 1994-08-11 01:33:22 +00:00
rev BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
rlogin Add distribution=krb for P-HK 1994-11-20 23:23:28 +00:00
rpcgen Fix rpcgen so that generated files are written to the current working 1995-03-04 17:47:50 +00:00
rpcinfo Move rpcinfo program over from 1.1.5. Based on original work by J.T. Conklin 1994-08-07 18:23:25 +00:00
rs BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
rsh Fix Sharnoff complain bin/136 (-e flag doesn't work). 1995-01-14 20:36:22 +00:00
rup Fixed a typo. Seems this manual page has stemmed from the rwall 1994-11-18 21:37:40 +00:00
ruptime BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
rusers rusers from FreeBSD 1.1.5.1 1994-08-28 15:06:02 +00:00
rwall rwall from FreeBSD 1.1.5.1 1994-08-28 15:11:02 +00:00
rwho My prevoius commit missed some things. The out_line didn't need 1994-12-27 00:53:14 +00:00
sccs BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
script BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
sed Sed dumps core when linked with some coalescing malloc because it 1995-04-05 22:55:27 +00:00
shar More merry makefile munging for man page compatability. 1994-08-05 19:00:04 +00:00
showmount Use the right man page. 1994-08-11 01:38:23 +00:00
size BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
soelim BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
sort BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
split BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
strings >Description: 1995-02-15 02:47:47 +00:00
strip strip not close files on error 1994-12-18 01:18:17 +00:00
su It has always bugged me that ps and w did not display su with tcsh 1995-04-06 06:06:47 +00:00
symorder Use exactly the same checks in excluded() as in inlist(): ignore stabs and 1995-01-21 10:24:18 +00:00
systat Updated for 4.4BSD queue macros. (Oops, I forgot to commit this last night; 1995-04-09 15:21:08 +00:00
tail BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
talk Don't allow talk own messages wrap around on the screen, just 1995-03-28 19:48:45 +00:00
tconv The Makefile contained in usr.bin/tconv contains a bogus 1995-01-15 06:19:01 +00:00
tcopy BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
tee BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
telnet Fix big f*ckup by doing "make nocrypt" 1994-08-27 15:46:29 +00:00
tftp BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
time Submitted by: Ollivier ROBERT roberto@keltia.frmug.fr.net 1995-02-18 20:44:55 +00:00
tip Greatly clean up the Makefiles and add a Makefile.inc to more obviously 1995-04-01 09:14:37 +00:00
tn3270 Get rid of gets 1994-11-29 01:11:43 +00:00
touch BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
tput Fix includes, tputs argument, ospeed setting, printing 1994-12-12 06:14:42 +00:00
tr Fix print class mistype 1994-10-28 23:31:48 +00:00
true BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
tset Fix erase determination code: don't look at 1995-03-27 03:42:21 +00:00
tsort BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
tty BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
ul BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
uname BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
unexpand BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
unifdef BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
uniq BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
unvis BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
users BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
uucp More merry makefile munging for man page compatability. 1994-08-05 19:00:04 +00:00
uudecode BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
uuencode More merry makefile munging for man page compatability. 1994-08-05 19:00:04 +00:00
vacation BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
vgrind Build database at build time instead of at install time. 1994-09-05 14:07:37 +00:00
vi This got ignored as a shared object during the import. Add it back as 1995-04-22 06:07:48 +00:00
vis BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
vmstat Removed object lookup/hit count and changed the order of things a little. 1995-03-25 08:44:48 +00:00
w Install with default BINOWN (as it once used to be). 1995-04-15 03:31:19 +00:00
wall The talkd security hole can ealso be exploited by wall (and thus rwall). 1994-10-23 15:33:55 +00:00
watch Rewrite manual page to use mandoc correctly and fix english grammar. 1995-02-22 23:47:51 +00:00
wc BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
what BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
whatis BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
whereis BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
which Unify the copyright notice. 1995-01-30 22:21:29 +00:00
who BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
whois BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
window Include <stdlib.h> so that malloc() is declared. 1995-04-02 19:01:07 +00:00
write BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
xargs BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
xinstall Reviewed by: 1994-09-04 22:35:27 +00:00
xstr BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
yacc Fix man extents from .0 to .1 1994-08-11 01:42:28 +00:00
yes BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00
ypcat Move more YP user programs over. 1994-08-08 01:13:35 +00:00
ypmatch Submitted by: Sebastian Strollo <seb@erix.ericsson.se> 1995-03-25 23:26:54 +00:00
ypwhich ypbind.c: Major overhaul. 1995-04-26 19:03:16 +00:00
Makefile Added kzip in i386 section 1995-04-15 08:19:16 +00:00
Makefile.inc BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00