Commit Graph

133 Commits

Author SHA1 Message Date
itojun 1ae287d8f9 fix alignment issue with 64bit arch (packed struct/SIOCGIFCONF).
From: =?iso-8859-1?Q?G=F6ran_Bengtson?= <goeran@cdg.chalmers.se>
2000-02-18 08:26:01 +00:00
itojun 5a38b81b42 implement bindresvport_sa(), which is necessary for IPv6 support in certain
programs (like rshd or rlogind).

bindresvport() and bindresvport_sa() exhibits exactly the same functionality,
with different function prototype (sockaddr_in * and sockaddr *).

The behavior and prototype was discussed and agreed among shin@kame.net
(who is doing freebsd-current kame merge), deraadt@openbsd.org, and
Jean-Luc.Richier@imag.fr (INRIA IPv6/IPv6 RPC support).  so it will be
portable across *bsd.
2000-01-26 13:20:24 +00:00
itojun e5aaa3fce0 fix include file. bindresvport() is declared in rpc/rpc.h, not netinet/in.h. 2000-01-26 07:06:03 +00:00
mycroft c6a0f46b4f Delint. 2000-01-22 22:53:59 +00:00
mycroft 605490369c Delint.
Remove trailing ; from uses of __weak_alias().  The macro inserts this if
needed.
2000-01-22 22:19:07 +00:00
drochner 65bf8c30e2 fix use of uninitialized "buflen" (botched in 1.18), closes PR lib/9104
by bgrayson@ece.utexas.edu
2000-01-05 18:40:06 +00:00
thorpej 22b2fb0830 Document the 64-bit XDR routines that Sun also documents. This manual
page needs a lot of help:
- restructure it into xdr_admin(3), xdr_complex(3), xdr_create(3), and
  xdr_simple(3), as is done in Solaris.
- rewrite in mandoc, and document all of the XDR primitives that NetBSD
  actually supplies.
1999-12-01 19:00:23 +00:00
thorpej 0bbf216692 Implement XDR routines for 64-bit integer data types:
- xdr_int64_t(), xdr_u_int64_t(), per NetBSD convention.
- xdr_hyper(), xdr_u_hyper(), xdr_longlong_t(), xdr_u_longlong_t(), a'la
  Solaris, implemented in terms of the above.
1999-12-01 18:34:21 +00:00
lukem 67fecdbace remove unnecessary exit() after err() 1999-11-28 03:47:24 +00:00
msaitoh 4e87e41c66 check __sh3__ 1999-11-26 07:39:45 +00:00
explorer 93eb76dd3d Fix incorrectly initialized value from _DIAGASSERT() changes. 1999-09-29 03:58:51 +00:00
lukem d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
lukem 8a0f61568f since clnt_p*error() are expected to print an error message, print one if they're called with dodgy args. ;) 1999-09-17 00:21:12 +00:00
sommerfeld 8a665c09ef Let this build without _DIAGNOSTIC 1999-09-16 17:03:46 +00:00
lukem b48252f365 * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
  and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

		_DIAGASSERT(path != NULL)
	#ifdef _DIAGNOSTIC
		if (path == NULL) {
			errno = EFAULT;
			return (-1);
		}
	#endif
1999-09-16 11:44:54 +00:00
christos ce19a15ee8 Fix bug I introduced on 19990503 by renaming a variable. 1999-05-09 20:11:23 +00:00
christos 6312884315 int -> socklen_t 1999-05-03 15:32:13 +00:00
christos 28fbffc215 int -> size_t 1999-05-03 15:26:49 +00:00
kleink 94281e536b Declare more local items static. 1999-04-19 21:56:01 +00:00
drochner 7e87965b8a Use TCP to register RPC services with the portmapper.
This has the advantage that we get an immediate error in case of
network problems (loopback, actually) instead of a nasty timeout.
1999-04-17 13:16:39 +00:00
lukem 15896e79fe * don't close the socket unless it was opened by the function
* note (in the comments) that the client is responsible for closing
  the socket if they opened it, or they didn't use CLNT_DESTROY()

fixes a couple of unnecessary closing of already-closed sockets.
noted by: Matthias Drochner <M.Drochner@fz-juelich.de>
1999-03-25 01:16:10 +00:00
lukem 26f7149c70 avoid possible denial of service attack. from freebsd 1999-03-04 05:26:48 +00:00
lukem 758519f01c * don't reference rpc_secure(3N) (yet)
* use section (3) not (3N) (from freebsd)
1999-03-04 02:59:43 +00:00
christos caaf1528bc xdrproc_t casts. 1999-01-31 20:45:31 +00:00
lukem 6c13a3b826 * ensure memory is released if operations fail (in authunix_create(),
xdr_callmsg(), xprt_register(), svc_tcp(), svc_udp(), etc)
* don't attempt to close a socket filedescriptor if it's -1 (some from
  freebsd, some i found)
* make the initial xid a little more random (from freebsd)
* fix some spelos and tyops in comments (some from freebsd)
* use warn() instead of warnx() for many errors; the user probably
  wants to know what the error code was.
* knf & whitespace nitpicks
1999-01-20 11:37:34 +00:00
lukem 774097a310 * svctcp_create():
- bump listen backlog to a modern value (should fix [lib/6379])
	- always check if sock should be closed
	- provide more informative error messages
* svctcp_rev(); set strm_stat = XPRT_DIED if error (from freebsd)
1999-01-20 08:40:13 +00:00
mrg f228fbea11 deal with printf()ing another size_t. print a u_int %u. 1998-11-22 06:09:00 +00:00
mrg 35e4d57c26 deal with printf()ing a size_t. 1998-11-22 05:37:13 +00:00
christos 1325a26d7b delint 1998-11-15 17:32:41 +00:00
christos 664c057479 Restructure the send and recv buffers slightly to avoid lint warnings and
make their treatment symmetric.
1998-11-15 17:30:40 +00:00
christos c4fda000eb Use a union again to make sure that we are aligned; this is not necessary
in this case, but makes the code easier to read, and avoids lint warnings.
1998-11-15 17:29:17 +00:00
christos 6f2f908d59 avoid potential buffer overflow and alignment problem that was caused
by casting a char[24] array to struct rpc_msg (sizeof(struct rpc_msg) == 48)
on i386. Use a union instead.
1998-11-15 17:27:35 +00:00
christos ee3762617d delint:
- memmove -> memcpy
	- check that we don't get a bogus h->h_length
1998-11-15 17:25:39 +00:00
christos ae3564f2ff int -> uid_t, gid_t 1998-11-15 17:24:07 +00:00
matt ef01540446 Change #ifdef vax to __vax__. 1998-10-19 02:54:57 +00:00
mycroft 982e920022 const poisoning. 1998-07-26 14:13:00 +00:00
mycroft ad96894bb9 const poisoning. 1998-07-26 13:57:41 +00:00
mycroft 00eb97ddac const poisoning. 1998-07-26 13:16:59 +00:00
mycroft 79788fe0d2 const poisoning. 1998-07-26 12:47:38 +00:00
mycroft dae9fd960e const poisoning. 1998-07-26 12:35:24 +00:00
mycroft 053e241137 constify some tables. 1998-07-26 11:47:37 +00:00
mycroft 423c2aade7 constify some tables. 1998-07-26 11:38:24 +00:00
msaitoh 1e6012f954 KNF. 1998-07-09 18:15:18 +00:00
mrg 32f519716b - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:56:06 +00:00
tv cce0ef1a56 Initialize variable "stat" in case it falls through the timeout "for" loop. 1998-05-23 13:37:26 +00:00
pk b81c16cec8 If poll(2) times out, report failure. 1998-04-24 11:21:19 +00:00
mrg 512c5be5af add "int" to bare static 1998-03-30 01:15:21 +00:00
jtc f7ca86bc2d regsterrpc.3 -> registerrpc.3 1998-03-18 01:37:39 +00:00
lukem 46e6c5e813 * in get_myaddress(); always return sockaddr_in containing localhost:PMAP_PORT.
(as recommended in Weiste Venema's portmap5_beta distribution)
* deprecate register
* use memmove instead of bcopy
* KNF includes
* use err/warn() instead of perror/fprintf(stderr,)
* fix some typos
1998-02-13 05:52:11 +00:00
lukem ce147c1c1c revert; we can't break the existing ABI and API 1998-02-12 01:57:27 +00:00