freebsd_amp_hwpstate/usr.sbin
Bill Paul a7acf629b6 Reviewed by: rgrimes, jkh and davidg (sort of)
Rod, Jordan and David have more or less given me the OK on this
with the understanding that it doesn't change any functionality.
It doesn't: these are bug fixes only. No other part of the system
should be affected. Of course, since I'm the only one working on
NIS, you'll just have to take my word on it. :)

Fixes for the following annoyingly subtle bugs:

- ypbindproc_setdom_2 is supposed to be declared void *, not boot_t *,
and it fails to correctly signal failures back to the ypset(8) command:
we need to call one of the svcerr_*() functions (in this case,
svcerr_noprog() seems a logical choice -- we're really cheating
a bit here because nothing else quite fits) to tell ypset that the
attempt to set the binding for a domain failed. If we don't do this,
failed ypset attempts either appear (incorrectly) to succeed, or
they time out.

- The lock handling for child processes isn't quite right. The
child broadcaster processes have to release all locks on the
binding files and the ypbind.lock file.

- The parent ypbind process will SEGV if you do the following:

-- start ypbind with the -ypset or -ypsetme flag
-- type 'ypwhich -d random_unserved_domain'
-- type 'ypset -d random_unserved_domain anyhost'
-- type 'ypwhich -d random_unserved_domain' again
-- wait about 60 seconds

What happens is this: the ypwhich command causes ypbind to fork a
broadcaster process that searches for a server for random_unserved_domain.
If you then use ypset to force a binding while this process is still alive,
the state flags that tell the ypbind parent process that the child
is running will be cleared. The second ypwhich command then causes
a *second* child process to be forked for random_unserved_domain,
which is verbotten. When the first broadcaster exits and tells the
parent that it wasn't able to find a server for the domain, the parent
clobbers the entry for random_unserved_domain. Then the second broadcaster
exits and the same thing happens, only trying to clobber the entry
twice causes a SEGV.

The fix for this is a slight change in program structure: since we
can't have more than one broadcaster for a given domain at a time,
we save the pipe descriptors and pid for the child broadcaster in members
of the _dom_binding struct for the domain. (As a side effect, we
can get rid of the global child_fds variable.) So when rpc_received()
finds that it's been asked to do a ypset for a domain for which a
broadcaster process exists, it sends a SIGINT to the child to kill it
and closes the pipe to the now-dead child. This keeps everything in sync
and insures that we don't leak file descriptors.

- ping() should be using YPPROC_DOMAIN rather than YPPROC_DOMAIN_NONACK
when it does its clnt_call() to the server.

- Removed the check for client_handle == NULL in ping() and make
client_handle local to ping instead of a member of the _dom_binding
struct. This fixes another potential ypset problem: using ypset to
force a binding to a machine that has an NIS server but which *doesn't*
support the domain we're after can result in permanently bogus bindings.

- the 'server OK' message prints the wrong IP address.
1995-05-26 05:28:00 +00:00
..
XNSrouted
ac
accton
adduser The problem is the returned salt, while the freebsd man pages asks that the 1995-05-20 13:05:22 +00:00
amd Added "doc" to the list of subdirs, so that amdref.info* will get 1995-05-14 11:24:41 +00:00
apm
apmconf
arp
bad144 Change the ioctl to match what went into wd.c 1995-05-18 21:26:06 +00:00
bootparamd
bootpd
bootpef
bootpgw
bootptest
cdplay
chown
chroot
config
config.new
cron
crunch Added a crunched_here(char *path) function so crunched programs can find out 1995-05-21 01:50:13 +00:00
ctm
dbsym
dev_mkdb
diskpart
edquota
eeprom BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00
fdcontrol
fdformat
fdwrite #include'ing mysterious stuff from ${DESTDIR}/sys/<somewhere> is no longer 1994-10-14 16:03:33 +00:00
inetd
iostat Fix printout bug 1994-11-10 13:39:01 +00:00
kbdcontrol
kbdmap
kernbb Don't dereference NULL pointers. 1995-04-28 04:58:19 +00:00
kgmon
kvm_mkdb
lpr Close PR: 1995-04-27 04:56:10 +00:00
lptcontrol
lsdev Moved "#include <pci/pcivar.h>" from "usr.sbin/lsdev/i386.c" 1995-02-04 12:47:19 +00:00
manctl I've found two bugs in manctl(8). There are two spurious ";" after a "then" 1995-02-15 00:07:59 +00:00
mixer
mount_portalfs
mountd Add a undocumented '-d' flag to set debugging. 1995-05-21 19:31:09 +00:00
mrouted A number of bug fixes to mrouted (no functionality enhancements from 3.5, just 1995-05-16 00:28:50 +00:00
mtree
named Fix nested comments for -Wcomment warnings. 1995-05-09 12:48:21 +00:00
ncrcontrol
nfsd
nologin
nslookup
pcvt Fix nested comments for -Wcomment warnings. 1995-05-09 12:48:21 +00:00
pkg_install Only apply @mode directives to files. 1995-05-19 22:40:54 +00:00
pkg_manage Allow pkg_manage to take a directory argument; I need this for the CDROM. 1995-05-24 06:20:08 +00:00
portmap Fix conflicts from import 1994-09-29 09:36:16 +00:00
ppp A few more typos fixed and some general cleanup done. 1995-05-24 05:51:29 +00:00
pppd Add missing arg to fprintf() error message. 1995-05-24 01:56:52 +00:00
pppstats
pstat
pwd_mkdb
quot
quotaon Get rid of update. Make man page installation work with our scheme 1994-08-05 16:31:05 +00:00
rarpd
repquota Fix 3 fatal mismatches in format args involving dbtob() and 7 nonfatal 1995-05-07 08:13:37 +00:00
rmt
routed Doc fix - ``active'' specification not parsed by routed in /etc/gateways. 1995-05-16 14:10:07 +00:00
rtprio
rwhod
sa
sade Add CRC checking to sysinstall. 1995-05-25 18:49:58 +00:00
sendmail
sgsc
sliplogin
slstat
spkrtest
swapinfo
sysctl
sysinstall Add CRC checking to sysinstall. 1995-05-25 18:49:58 +00:00
syslogd
tcpdump
timed
traceroute
trpt
trsp Get rid of _PATH_UNIX completely; use getbootfile(3) instead. 1994-09-24 00:08:43 +00:00
tzsetup
update
vidcontrol
vipw
vnconfig
watch
xntpd
xten Switch from bogus absolute path to a relative one. 1995-05-09 23:48:54 +00:00
ypbind Reviewed by: rgrimes, jkh and davidg (sort of) 1995-05-26 05:28:00 +00:00
yppoll Added YP section 8 programs from 1.1.5. (Obligatory notice that this 1994-08-08 01:10:28 +00:00
ypset Added YP section 8 programs from 1.1.5. (Obligatory notice that this 1994-08-08 01:10:28 +00:00
zic FreeBSD port of timezone code. 1994-09-13 03:36:16 +00:00
Makefile
Makefile.inc