freebsd-dev/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
..
ac strncmp use wrong utmp name size 1994-11-14 20:26:52 +00:00
accton Changed a ACCTON 1 to a ACCTON 8 . 1994-12-12 00:32:36 +00:00
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 make the right link to "zzz" 1994-11-02 07:20:58 +00:00
apmconf Remove a relic from the old "equiv" kludge 1994-11-02 04:55:15 +00:00
arp Remove talk about trailers from arp(8) manual page 1994-09-26 04:32:57 +00:00
bad144 Change the ioctl to match what went into wd.c 1995-05-18 21:26:06 +00:00
bootparamd Stop callbootd from dumping core when attempting to directly query a 1995-03-26 03:15:39 +00:00
bootpd __386BSD__ -> __FreeBSD__ 1994-11-04 02:14:13 +00:00
bootpef add rtmsg.c. 1994-09-12 07:48:33 +00:00
bootpgw add rtmsg.c. 1994-09-12 07:48:33 +00:00
bootptest Changes for bootpd to work on FreeBSD 2.0: 1994-09-10 15:00:08 +00:00
cdplay Use CDPLAY environment variable to not type argument each time 1995-02-22 01:45:03 +00:00
chown groups[] is of type gid_t. 1994-09-23 10:02:21 +00:00
chroot Get rid of update. Make man page installation work with our scheme 1994-08-05 16:31:05 +00:00
config Fix 3 printf's that had the wrong number of arguments. 1995-05-14 19:19:55 +00:00
config.new Get rid of update. Make man page installation work with our scheme 1994-08-05 16:31:05 +00:00
cron Fix nested comments for -Wcomment warnings. 1995-05-09 12:48:21 +00:00
crunch Added a crunched_here(char *path) function so crunched programs can find out 1995-05-21 01:50:13 +00:00
ctm Check for i/o errors in fclose() so that a full disk doesn't almost 1995-04-16 22:40:49 +00:00
dbsym Changes to adapt to 2.0. 1994-08-23 11:17:55 +00:00
dev_mkdb Get rid of update. Make man page installation work with our scheme 1994-08-05 16:31:05 +00:00
diskpart Get rid of update. Make man page installation work with our scheme 1994-08-05 16:31:05 +00:00
edquota Cast some expressions involving dbtob() to (unsigned long) and print them 1995-05-07 07:48:35 +00:00
eeprom BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00
fdcontrol Import the fdcontrol command. It has been in 1.1.5, but obviously has been lost on its way to 2.0. 1994-10-30 18:52:01 +00:00
fdformat Corrected the xref to the driver man page to be fdc(4) now that 1994-10-28 17:07:32 +00:00
fdwrite #include'ing mysterious stuff from ${DESTDIR}/sys/<somewhere> is no longer 1994-10-14 16:03:33 +00:00
inetd Disable UDP service looping attack. 1994-12-21 19:08:45 +00:00
iostat Fix printout bug 1994-11-10 13:39:01 +00:00
kbdcontrol Added h option for setting the historysize. 1995-01-30 21:41:14 +00:00
kbdmap Manpage not installed 1995-04-06 14:41:50 +00:00
kernbb Don't dereference NULL pointers. 1995-04-28 04:58:19 +00:00
kgmon Get rid of _PATH_UNIX completely; use getbootfile(3) instead. 1994-09-24 00:08:43 +00:00
kvm_mkdb Speed kvm_mkdb up by a factor 5 or thereabout. Rewrote all the fseek/fread 1995-01-10 18:37:12 +00:00
lpr Close PR: 1995-04-27 04:56:10 +00:00
lptcontrol Make it possible to run lptcontrol on a printer port which does not 1994-09-03 22:47:08 +00:00
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 non-X mixer, useful into rc.local 1995-02-15 17:33:04 +00:00
mount_portalfs Bugfixes : 1995-04-19 12:24:08 +00:00
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 mtree * MD5 = better security 1995-02-10 03:12:42 +00:00
named Fix nested comments for -Wcomment warnings. 1995-05-09 12:48:21 +00:00
ncrcontrol Reading NCR registers is not secure at all times, so prevent 1995-03-16 15:10:11 +00:00
nfsd Add support for kerberised NQNFS. 1995-01-30 18:56:06 +00:00
nologin Convert to our man installation style. Also fixed long-standing bug 1994-08-05 02:42:42 +00:00
nslookup Correct the nslookup manpage that has some macros in it, that our man system 1994-11-19 13:16:52 +00:00
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 Changed a PPSTATS 1 to PPPSTATS 8 . 1994-12-12 00:36:41 +00:00
pstat Reflect the fact that we do not swap on the first <dmmax> blocks of a 1995-05-14 03:37:40 +00:00
pwd_mkdb Add what looks to be the right fix to this bogus code. 1995-03-24 16:07:09 +00:00
quot BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00
quotaon Get rid of update. Make man page installation work with our scheme 1994-08-05 16:31:05 +00:00
rarpd Get rid of ether_addr.c: it's been moved to libc. Also add proper 1995-04-02 01:35:54 +00:00
repquota Fix 3 fatal mismatches in format args involving dbtob() and 7 nonfatal 1995-05-07 08:13:37 +00:00
rmt The rmt protocol didn't allow to pass a file creation mode (permission 1995-04-09 09:20:47 +00:00
routed Doc fix - ``active'' specification not parsed by routed in /etc/gateways. 1995-05-16 14:10:07 +00:00
rtprio "idle priority" support. Based on code from Henrik Vestergaard Draboel, 1994-10-02 04:48:21 +00:00
rwhod Get rid of update. Make man page installation work with our scheme 1994-08-05 16:31:05 +00:00
sa Local changes - manual page extension, and minor man page changes 1994-09-26 21:41:06 +00:00
sade Add CRC checking to sysinstall. 1995-05-25 18:49:58 +00:00
sendmail Fix nested includes for -Wcomment. 1995-05-09 12:35:29 +00:00
sgsc sgsc - utility to control the Genius GS-4500 scanner. 1995-01-07 14:17:22 +00:00
sliplogin 1. Correct invalid setsid and ioctl return value checks. 1994-08-08 17:14:46 +00:00
slstat Change a SLSTAT 1 to SLSTAT 8 . 1994-12-12 00:38:01 +00:00
spkrtest Change ${COPY} to -c, always needed here 1994-12-31 11:13:52 +00:00
swapinfo Don't follow a null pointer for the reporting error if kvm_openfiles() fails. 1994-11-14 07:54:06 +00:00
sysctl Learn how to print out kern.dumpdev as a name. 1995-05-12 19:10:56 +00:00
sysinstall Add CRC checking to sysinstall. 1995-05-25 18:49:58 +00:00
syslogd Updates from Peter da Silva to match the recent syslogd changes. 1995-01-04 00:40:38 +00:00
tcpdump tcpdump is in (1) not (l) 1995-05-14 15:21:36 +00:00
timed Fully initialize (bzero) the stack-allocated "struct sockaddr_in server" 1995-05-15 09:56:49 +00:00
traceroute Changed output formatting to correctly represent the precision - it's 1994-08-29 17:45:43 +00:00
trpt Removed bogus #include of netinet/in_pcb.h 1995-04-10 00:41:25 +00:00
trsp Get rid of _PATH_UNIX completely; use getbootfile(3) instead. 1994-09-24 00:08:43 +00:00
tzsetup Grand new all-singing, dialog-wielding tzsetup(8). Still needs a man page. 1995-04-24 21:04:35 +00:00
update BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00
vidcontrol remove option "-s saver" from usage() 1995-03-03 21:21:24 +00:00
vipw Fix suspended vipw hangs 1995-03-09 21:53:12 +00:00
vnconfig The changes to support the new flags in the vn driver. 1995-03-11 09:33:25 +00:00
watch same 1995-02-27 19:48:19 +00:00
XNSrouted Get rid of update. Make man page installation work with our scheme 1994-08-05 16:31:05 +00:00
xntpd Do what the previous log message claimed to do and don't enable DES if 1995-04-16 01:40:24 +00:00
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 remove swapinfo. 1995-05-13 17:27:10 +00:00
Makefile.inc BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00