jdolecek
ca797c3c15
make local constant arrays const
2001-01-25 22:50:55 +00:00
lukem
1b4c6a992b
don't _DIAGASSERT(cp != NULL) until after cnt is checked for != 0.
...
other stuff in the rpc systems (e.g, authnone_create() with _null_auth)
trigger this assertion otherwise
2001-01-17 01:07:10 +00:00
lukem
9004e39fee
rename MAX_MARSHEL_SIZE to MAX_MARSHAL_SIZE
2001-01-16 15:46:52 +00:00
lukem
0d2d9acca6
whitespace consistency fixups
2001-01-04 14:57:17 +00:00
lukem
0e8cfd8ffb
sprinkle _DIAGASSERT() appropriately. minor other cleanups
2001-01-04 14:42:18 +00:00
lukem
29e8291322
sprinkle _DIAGASSERT() around
2001-01-04 01:45:30 +00:00
christos
128bd71ffc
oops fix previous typos.
2000-12-20 23:08:51 +00:00
christos
f9b8c27ae8
appease lint casts
2000-12-20 20:52:50 +00:00
christos
663f790f35
remove redundant declarations.
2000-12-20 20:51:08 +00:00
christos
c2285c0805
remove dedundant declaration of _svc_getreq_common; declared in <rpc/svc.h>
2000-12-10 04:12:03 +00:00
christos
ec4fa3bdcc
remove redundant declaration of _seterr_reply. Already declared in
...
<rpc/rpc_msg.h>
2000-12-10 04:10:08 +00:00
kleink
dbf8a5327c
Need "namespace.h".
2000-09-28 09:07:04 +00:00
fvdl
3b9024546d
For an accepted connection (tcp), set xp_netid, as it might be examined
...
by some applications, most notably rpcbind.
2000-08-03 00:01:53 +00:00
matt
dd8046c23f
fix a bug in the NOIEEE (aka VAX) case.
2000-07-17 04:59:51 +00:00
itojun
52f552d80a
correct delint mistake (missing "&").
...
may fix recent rpc/nfs-related PRs, including 10579 and 10601.
2000-07-16 06:41:43 +00:00
fvdl
4063df8381
Use rpcvers_t, not long, for some variables holding version numbers. They
...
were sometimes passed by reference, creating problems on 64bit be systems.
2000-07-14 10:29:16 +00:00
fvdl
7c5c8962ad
Use explicit int32 get/put macros. Needed for 64bit big-endian systems.
2000-07-14 08:40:41 +00:00
kleink
1e67e23b6f
De-delint previous: svc_vc_rendezvous_ops() isn't unused unless the single
...
reference to it is accidently deleted; from Shuuichirou Murata in PR lib/10537.
2000-07-08 11:41:50 +00:00
christos
deb154d2bc
add __RPC_GETXID macro
...
don't const castway __rpc_getconf and __rpc_getconfig. It might try to
write const strings
fix non-portable casts
remove duplicated prototypes
cast things to proper types
remove extraneous casts to NULL
fix variable cast mismatches
remove register var declarations
2000-07-06 03:10:34 +00:00
christos
b056680b9b
remove register
...
adjust types to match functions
elide non-portable casts
cast to proper types
2000-07-06 03:06:45 +00:00
christos
6a3d07cc2d
get prototypes from rpc/nettype.h
...
avoid non-portable casts
add explicit casts
2000-07-06 03:05:20 +00:00
christos
3ee90709fb
elide non-portable casts
2000-07-06 03:03:59 +00:00
christos
ea5394abfa
remove unnecessary casts to NULL
2000-07-06 03:03:30 +00:00
msaitoh
f6f00e2615
remove extra period in SEE ALL section
2000-07-05 15:45:28 +00:00
christos
4af2eb7264
PR/10499: IWAMOTO Toshihiro: getnetconfig uses strtok. Applied suggested patch
...
to use strtok_r
2000-07-03 12:08:13 +00:00
fvdl
dc01bcc976
Plug a memory leak.
2000-06-22 11:06:23 +00:00
fvdl
d7fde522ec
Fix 2 items.
2000-06-20 00:53:08 +00:00
assar
598be7b0b7
syslog an error if /etc/netconfig is not found. fixes lib/10275
2000-06-11 16:26:53 +00:00
fvdl
eaee8c445a
Set the error code sanely in a few cases.
...
When connecting to a version 2 portmapper, don't use the "udp" nettype,
since that includes udp on ipv6, but just use the "udp" netconfig entry
directly.
2000-06-07 21:46:01 +00:00
fvdl
737db7ee0a
The two unchanged interfaces (svc_create and clnt_create) resulted
...
in sockets bound to reserved ports in the old code. Since old binaries
will still expect this, always try to bind to a reserved port in
clnt_cli_create and svc_tli_create, unless we're already bound.
2000-06-07 18:27:39 +00:00
simonb
d649f5ebb1
Spell registerrpc properly.
2000-06-07 13:39:43 +00:00
fvdl
5b761cd338
Always do a listen() in the old svctcp_create backward compat code.
2000-06-07 01:45:25 +00:00
fvdl
3f80608ea9
Correct misleading error messages.
2000-06-06 14:44:45 +00:00
thorpej
934426175d
- An initialized variable kept LOCAL_CREDS from being set on
...
the listen socket properly. This caused spurious rpcbind(8)
failures.
- Don't define a "credmsg" structure. Instead, dynamically
allocate a buffer of the correct size of the message with
CMSG_SPACE() and free it when we're done. This gets the
size of the buffer right on LP64 platforms, which has padding
for alignment thrown in.
- Check for non-present or truncated cred messages when recvmsg(2)
returns.
2000-06-05 05:58:46 +00:00
thorpej
c444e0d694
Need <string.h> for LP64 systems.
2000-06-04 04:35:13 +00:00
thorpej
11e5c6cccf
Get <string.h> so this builds on LP64.
2000-06-04 03:55:20 +00:00
fvdl
327cb95a94
Zero out the xprt in makefd_xprt to avoid bad free() calls in some cases.
2000-06-03 20:26:05 +00:00
fvdl
8b656ef91d
Correct prototype for rpcb_unset().
2000-06-03 18:47:28 +00:00
fvdl
67bfc2d3ab
include <string.h> for mem* prototypes.
2000-06-03 14:55:43 +00:00
fvdl
746a942a9c
Add missing weak alias for svcfd_create.
2000-06-03 14:30:11 +00:00
fvdl
a4a23df233
Fix typo in weak alias, causing unresolved externals.
2000-06-03 13:04:14 +00:00
fvdl
8bf1d5a03a
Add missed manual page when updating RPC dode.
2000-06-03 09:29:50 +00:00
fvdl
cfe96f8218
Move rpcb_prot.x to include/rpc.
2000-06-03 02:28:40 +00:00
fvdl
550e62c47a
Move rpcb_prot.x to include/rpc instead.
2000-06-03 02:28:12 +00:00
fvdl
198594fe25
Fix rpcb_prot.h target.
2000-06-03 02:12:00 +00:00
fvdl
cc755ae9f6
Change unix domain socket to rpcbind.sock.
2000-06-03 00:43:21 +00:00
fvdl
7df0ccbadc
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
...
but sockets instead, internally. Old, backward compatible interfaces
maintained.
2000-06-02 23:11:05 +00:00
itojun
1cac955ef7
remove unnecessary _DISGASSERT().
2000-05-15 17:11:29 +00:00
itojun
614637a5f5
use getifaddrs instead of SIOCGIFCONF (do we need to keep old code around?)
...
avoid buffer overrun, when you configure more than 20 IPv4 broadcast addresses
on a node.
2000-05-15 17:06:05 +00:00
bjh21
6c97e2bd78
Initial commit of arm26 port
2000-05-09 21:55:44 +00:00
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
lukem
a40a10e320
use u_int32_t instead of size_t...
1998-02-11 11:52:52 +00:00
lukem
cb9265e7ca
use u_int instead of size_t in clntraw_control (oops!)
1998-02-11 07:50:07 +00:00
lukem
a31739bc01
major cleanup (to sync with changes made in include/rpc/*.h):
...
* use int32_t, size_t, in_port_t instead of long, u_int, u_short as appropriate
* use uid_t and gid_t instead of int
* KNF, fix typos and spellos
* use const as appropriate
* deprecate register
* use memmove instead of bcopy
* use err/warn()
1998-02-10 04:54:22 +00:00
perry
312aca536f
add LIBRARY section to man page
1998-02-05 18:45:17 +00:00
lukem
f44e45ec1a
fix tyop
1998-02-03 22:18:01 +00:00
perry
d6b87acb51
<netdb.h> -> <rpc/rpc.h>
1998-02-02 20:18:46 +00:00
lukem
67569086c4
a memory leak can occur when xdr_replymesg() fails, so XDR_FREE in
...
this case. originally fixed in freebsd in clnt_udp.c, and similar
change to clnt_raw.c made by openbsd.
1998-01-23 14:44:22 +00:00
lukem
bba0660678
* use setsockopt(IP_PORTRANGE_LOW) instead of looping through the
...
address range (from freebsd).
* enhance the man page to be a bit more useful.
1998-01-14 11:04:17 +00:00
perry
b51ed80fd5
RCS Id Police.
1998-01-09 04:11:49 +00:00
mikel
007afd6dda
fix pasto (s/getpwent/getrpcent/); from Tobias Weingartner
1997-12-16 07:48:49 +00:00
mrg
4e252e8c4d
add missing .Nm entries. from spz@serpens.swb.de.
1997-11-14 02:04:36 +00:00
jtc
43fa6fe319
If port provides __weak_alias(), provide an Standard C and POSIX pure
...
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.
This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
1997-07-21 14:06:24 +00:00
christos
c63c52b238
Fix RCSID's
...
Fix gcc warnings.
Add missing prototypes
1997-07-13 20:13:02 +00:00
christos
ee71b4ce7e
Fix bug where RPC_VERSMISMATCH was used instead of RPC_MISMATCH.
...
Fix RCSID's
Fix gcc warnings.
1997-07-13 20:12:12 +00:00
christos
3ec7da00cf
Fix uninitialized variable free on error.
...
Add prototypes
Fix RCSID's
Fix gcc warnings.
1997-07-13 20:09:19 +00:00
christos
b8138fe77b
Fix printf format strings.
...
Fix RCSID's
Fix gcc warnings
Add missing prototypes
1997-07-13 20:08:16 +00:00
christos
1f542a9a8a
Fix incorrect arguments in authunix_validate
...
Add prototypes
Fix gcc warnings
Fix RCSID's
1997-07-13 20:07:36 +00:00
mikel
ba64d71ae7
add missing #; noted by Todd Miller
1997-07-01 06:28:22 +00:00
thorpej
d83d59241e
PowerPC is an IEEE floating point system.
1997-03-29 21:04:08 +00:00
mycroft
13038ab3ee
Make sure /etc/rpc is *closed* when we're done.
1997-03-13 19:47:42 +00:00
mouse
ff44468136
alternate -> alternative, per PR 2643
1997-03-08 13:36:38 +00:00
mycroft
041d00cdf4
It's not necessary to initialize the `revents' field of struct pollfd.
1997-02-08 04:38:02 +00:00
mrg
9cd5492c02
- convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
...
- some KNF.
1997-01-23 14:01:45 +00:00
christos
41b4e57ece
fix previous booboo that broke all rpc services...
1996-12-24 21:49:55 +00:00
cgd
77dab094a0
pull in netdb.h and arpa/inet.h, kill local decls. add interpret() proto
1996-12-20 20:49:47 +00:00
cgd
9fc875ff77
unistd.h for prototypes
1996-12-20 20:48:17 +00:00
cgd
ebd5bdf6d5
string.h for prototypes
1996-12-20 20:47:53 +00:00
cgd
8d3c8a8f7c
string.h for prototypes, replace K&R declarations with __P protos
1996-12-20 20:25:12 +00:00
cgd
e8cd914914
unistd.h for prototypes, fix a couple of bogus casts to select()'s args
1996-12-20 20:24:36 +00:00
cgd
018a568c63
pull in rpc/pmap_clnt.h for protos
1996-12-20 20:23:22 +00:00
cgd
d3b76936e9
pull in unistd.h for prototypes
1996-12-20 20:17:19 +00:00
cgd
30701b75d0
sysconf() definitions are in unistd.h; use it rather than sys/param.h and
...
sys/sysctl.h. (without this, the previous checkin doesn't work.)
1996-12-18 20:57:15 +00:00
mrg
52ae8f7095
oops; use _SC_OPEN_MAX instead of sysctl.
1996-12-18 01:06:37 +00:00
cgd
ac05a6d647
repeat after me: size_t != int, especially when you're taking pointers.
1996-12-17 22:00:39 +00:00
mrg
f6c91ed9ca
use poll() instead of select()
1996-12-17 03:55:20 +00:00
mrg
074bac7fd2
use sysctl() instead of getdtablesize()
1996-12-17 03:27:08 +00:00
jtc
0df251764e
Changed clnt_{s,}p{errno,error,createerror} so that the functions that
...
output emit newlines and those that return a pointer to string do not
append them.
The existing behavior was inherited from RPC4.0, but this seems to have
been corrected sometime before SunOS 4.1.
The documentation has been updated to reflect the new behavior.
1996-06-19 20:38:43 +00:00
jtc
b18369b1bb
Use memset instead of bzero to clear xports array.
...
To be strictly conforming, we should iterate through the array and set
each pointer to NULL. But memset is faster, and can be inlined by the
compiler. If we ever encounter a machine where a NULL ptr != all bits
zero, we'll have to handle this differently.
1996-05-17 00:32:22 +00:00
pk
8afc84d945
Clear `xports' array after allocation (PR#2424, Arne Juul).
1996-05-16 22:52:21 +00:00
jtc
18ec2ba033
Add explict function return types
1996-03-29 23:00:47 +00:00
mark
39f49db401
Define IEEEFP if we are compiling for the arm32.
1996-02-16 21:14:03 +00:00
mycroft
62b296d0eb
Make this work on machines that do not support unaligned memory access.
...
From der Mouse, PR 1116.
1996-02-08 08:06:05 +00:00
pk
560ec18abf
Note return value of get_myaddress().
1996-01-04 20:09:53 +00:00
pk
33880f275d
Return FALSE if get_myaddress() fails.
1996-01-04 20:06:22 +00:00
pk
49ca038962
1) Agree with kernel on format of SIOCGIFCONF results.
...
2) Return non-zero on error, so RPC clients do not die unexpectedly.
1996-01-04 20:05:04 +00:00
pk
6355031191
Fix typo (Der mouse, PR #1115 ).
1995-06-05 11:48:26 +00:00
mycroft
5860921eda
Fill in sin_len.
1995-06-03 22:37:19 +00:00
cgd
2583d406f9
change some of the rpc "on-the-wire" structures' fields to be explicitly-sized
...
types. add xdr_{,u_}int{16,32}_t() functions to convert them.
This is necessary, because things like BPF use the RPC headers to look
at the on-the-wire data, so the headers must accurately represent
what's on the wire, too.
1995-04-29 05:26:31 +00:00
christos
c6284ba067
The typo police "dase" != "case"
1995-04-25 21:41:48 +00:00
jtc
6d97ed4663
Use a switch instead of three if statements in xdr_long() and xdr_u_long(),
...
gcc generates slightly better code on all of the architectures I checked.
Also changed xdr_wrapstring to return the return value of xdr_string
directly.
1995-04-24 23:33:39 +00:00