Commit Graph

115 Commits

Author SHA1 Message Date
plunky
87d4f6076b Apply casts to cases where xdrproc_t is expected but is not
strictly passed, for example because the second argument is
a different kind of pointer.
2011-08-30 17:06:20 +00:00
joerg
dccf569e0e Use __dead. 2011-08-29 20:38:53 +00:00
dholland
0c53a1f2e4 Don't print uninitialized values off the stack, even as debug messages. 2011-05-25 04:59:22 +00:00
dholland
ef192e52d5 When checking if /var/yp/binding/foo.ypservers exists, use the domain
name of the domain being checked instead of the default domain name. Duh.
Necessary for PR 43900.
2011-05-25 04:33:52 +00:00
dholland
8066ee6b9b Remove two entirely unused members of struct domain (previously struct
_dom_binding). I guess these were there because it was cutpasted at
some point from struct dom_binding in <rpcsvc/yp_prot.h>.
2011-05-24 07:02:08 +00:00
dholland
cfb05cb343 Merge a couple more minor improvements from Wolfgang Stukenbrock's
patch in PR 43900.
2011-05-24 07:01:53 +00:00
dholland
9d84fe187a The FILE* kept open for /var/yp/binding/foo.ypservers needs to be
per-domain. Also, use the file for the domain we're servicing instead
of always the file for the default domain.

Partly from Wolfgang Stukenbrock's patch in PR 43900.
2011-05-24 07:01:40 +00:00
dholland
6f997d891d The been_ypset flag really needs to be per-domain also. Do that.
Partly from Wolfgang Stukenbrock's patch in PR 43900.
2011-05-24 07:01:24 +00:00
dholland
bb36c8993e The ypbindmode really needs to be per-domain, so adjust accordingly.
Partly from Wolfgang Stukenbrock's patch in PR 43900.
2011-05-24 07:01:15 +00:00
dholland
0d20b396fd Allowing ypset is a global permission flag, not an operating mode like
broadcast vs. configured/direct. Don't conflate the logic. As I proposed
in PR 43900.
2011-05-24 07:00:34 +00:00
dholland
e61f3e4872 Fix initialization of struct domain; initialize all fields in all
cases, merge duplicate code, make sure every domain gets an xid
assigned.

Partly from Wolfgang Stukenbrock's patch in PR 43900.
2011-05-24 07:00:07 +00:00
dholland
fec4c9631a The name field of a domain should be dom->dom_name, not dom->dom_domain.
(This and the previous patch make the code far more readable.)
2011-05-24 06:59:53 +00:00
dholland
771940852d The default name for a "domain" variable should be "dom", not "ypdb".
Change them all, and make a couple other related adjustments.
2011-05-24 06:59:35 +00:00
dholland
006489acb9 ypbindlist -> domains 2011-05-24 06:59:07 +00:00
dholland
c9b3b0763b xid2ypdb() -> domain_find() 2011-05-24 06:58:54 +00:00
dholland
df3a50ea87 Rename struct _dom_binding -> struct domain. 2011-05-24 06:58:42 +00:00
dholland
1cb987c954 Move a bunch of messy sunrpc-related initialization stuff into its own
function instead of blatting it all into main().
2011-05-24 06:58:19 +00:00
dholland
fe8f2f2d61 Assimilate the open/flock combination used several times into its own
function.
2011-05-24 06:58:07 +00:00
dholland
2b880b64f4 Fix up calls to yp_log. They cannot use %m, because if the -d option
is used the messages are sent via printf instead of syslog(3).

Also, make sure that none of the calls include a trailing newline and
issue a trailing newline in the -d case so they actually print properly.
(This was noted by Wolfgang Stukenbrock in PR 43900.)

And finally, fix some cases that could in some circumstances print
uninitialized errnos.
2011-05-24 06:57:55 +00:00
dholland
15569646a4 Abstract out some of the handling of the ypservers file. 2011-05-24 06:57:30 +00:00
dholland
dfd8a41891 Check that the domain name is valid up front, instead of doing it
after opening sockets and registering services and whatnot.
2011-05-24 06:57:04 +00:00
dholland
cb269e446a Remove now-unnecessary extra forward decls; sprinkle a little more static. 2011-05-24 06:56:48 +00:00
dholland
20f9d4037f Sort contents of file. 2011-05-24 06:56:16 +00:00
dholland
58a3e249b1 sort includes 2011-05-23 02:54:53 +00:00
dholland
d2f44d281f Don't use _t as an identifier suffix meaning "variable containing a time". 2011-05-23 02:43:10 +00:00
dholland
86a03218b2 Introduce DPRINTF() macro, remove most #ifdef DEBUG usages.
No change to compiler output.
2011-05-23 02:36:35 +00:00
dholland
41741c3c2a u_int32_t -> uint32_t and similar 2011-05-23 02:06:41 +00:00
dholland
81f95bf6fa Don't cast return value of malloc 2011-03-30 05:24:05 +00:00
dholland
b639c25325 use __printflike() 2011-03-30 05:20:59 +00:00
skrll
96092d9e00 Whitespace. 2009-11-06 15:41:58 +00:00
christos
225e9fc5c1 make this compile. 2009-11-06 15:36:55 +00:00
chuck
1f5ddb4eb6 in the case where ypbind is serving more than one domain (i.e.
not just the yp_get_default_domain() domain), we must remove
any old binding files from /var/yp/binding (BINDINGDIR) from
previous runs, or the non-yp_get_default_domain()'s will not
bind properly.   add a purge_bindingdir() function that basically
does "rm BINDINGDIR/*.[0-9]" at ypbind startup time.

example case of where this is an issue: bind a second (non-default)
domain.   ypbind will create and flock a /var/yp/binding/xxx.2
file for it.  stop and restart ypbind.  the old /var/yp/binding/xxx.2
file will remain from the previous run.   since it is not flock()'d
by the new instance of ypbind, libc functions like yp_master() will
fail without even bothering to talk to ypbind itself.   (and ypbind
is totally unaware of the old file...)
2009-11-05 19:34:06 +00:00
lukem
d877c4c3c0 Enable WARNS=4 by default, except for:
cpuctl  dumplfs  hprop  ipf  iprop-log  kadmin  kcm  kdc  kdigest
	kimpersonate  kstash  ktutil  makefs  ndbootd  ntp  pppd  quot
	racoon  racoonctl  rtadvd  sntp  sup  tcpdchk  tcpdmatch  tcpdump
	traceroute  traceroute6  user  veriexecgen  wsmoused  zic
(Mostly third-party applications)
2009-04-22 15:23:01 +00:00
lukem
b118202501 fix -Wsign-compare issues 2009-01-18 10:39:17 +00:00
martin
11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos
97dcde77bc - Compile in with debugging by default.
- General cleanup.
2007-07-07 22:33:57 +00:00
tls
4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
tron
886853e55b Ensure alignment of the structure used for RPC requests. This stop
"ypbind" from segfaulting under NetBSD-sparc64 when "ypwhich" is
used to display the current NIS server.
2006-10-05 09:18:11 +00:00
elad
c443814068 Fix misleading error message (from PR/32519). 2006-10-01 19:43:15 +00:00
mrg
0c37c63edc change (mostly) int to socklen_t. GCC 4 doesn't like that int and
socklen_t are different signness.
2006-05-09 20:18:05 +00:00
wiz
84b1788811 Improve diagnostics section. Inspired by PR 32217 from Jeff Ito. 2005-12-03 11:24:02 +00:00
wiz
48e5d8d4fa Sort SEE ALSO (first section, then name); new sentence, new line; bump date for previous. 2005-02-26 16:19:08 +00:00
thorpej
a303186ec8 YP -> NIS 2005-02-26 16:15:09 +00:00
dsl
3cca093e74 Add (unsigned char) cast to ctype functions 2004-10-30 15:51:20 +00:00
jrf
190b2e4c51 Replaced strncpy with strlcpy. Thanks to Peter Postma who
pointed them our in PR #25762. Approved by christos@NetBSD.org.
2004-09-07 13:20:39 +00:00
jmmv
b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
agc
7db1d33cba Modify the licences of code written by Theo De Raadt from a 4-clause
to a 2-clause licence (retaining UCB clauses (1) and (2)), per PR
22409 from Joel Baker, approved by Theo de Raadt, and ratified by
myself - the only discrepancy being the handling of the original
clause 3 in src/usr.sbin/yppoll/yppoll.c.
2003-12-10 12:06:25 +00:00
bouyer
6f4c1c24ee Apply patch proposted to tech-userlevel on Sun, 12 Oct 2003:
Remove dom_server_port from struct _dom_binding. It's never initialised
and used in only one place, where dom_server_addr.sin_port was probably
intended.
2003-11-17 21:29:21 +00:00
bouyer
d2c13c7513 width needs to be updated before each loop, because svc_maxfd may have
changed.
2003-09-05 14:59:37 +00:00