summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc
Commit message (Collapse)AuthorAgeFilesLines
* mdoc(7) police: added missing .Os call.ru2000-12-142-0/+2
|
* Upgrade to groff 1.16.1.ru2000-12-061-8/+1
|
* Eliminate groff(1) warnings.ru2000-11-247-49/+77
|
* mdoc(7) police: fixed warning.ru2000-11-201-1/+1
|
* mdoc(7) police: Nm -> Fn where appropriate.ru2000-11-201-1/+1
|
* strtok() -> strsep() (no strtok() in libraries allowed)ache2000-08-292-16/+26
| | | | | | small cleanup in nearby area: pointer 0 -> NULL, according to manpages hardcoded constant -> sizeof(buf)
* Calculate the string length of a u_long at compile-time, instead of using akris2000-08-041-5/+17
| | | | hardcoded value.
* Correct string length bounds checking.kris2000-08-041-3/+5
|
* Don't overflow the internal buffer in clnt_sperror()kris2000-08-041-1/+1
|
* Replace structure copy form ifreq obtained by SIOCGIFADDRshin2000-03-032-2/+2
| | | | | | to memcpy(), to avoid unaligned access trap on alpha. Approved by: jkh
* Remove single-space hard sentence breaks. These degrade the qualitysheldonh2000-03-026-48/+96
| | | | | of the typeset output, tend to make diffs harder to read and provide bad examples for new-comers to mdoc.
* Grammar fix: ``Different than'' should really be ``different from''.chris2000-01-291-1/+1
|
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),jasone2000-01-2715-36/+36
| | | | | | | | | | | | | | | | | just use _foo() <-- foo(). In the case of a libpthread that doesn't do call conversion (such as linuxthreads and our upcoming libpthread), this is adequate. In the case of libc_r, we still need three names, which are now _thread_sys_foo() <-- _foo() <-- foo(). Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(), nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo(). Remove all internal libc usage of: creat(), pause(), sleep(), system(), tcdrain(), wait(), and waitpid(). Make thread cancellation fully POSIX-compliant. Suggested by: deischen
* Fixed wrong includes in synopsis.bde2000-01-271-8/+11
| | | | | | | | | | | Updated date. 1987 was a while ago. Removed trailing comma in NAME section. Uncapitalised Bindresvport and Bindresvport_sa in DESCRIPTION section. Don't use .Nm there either. Added bindresvport_sa() to the RETURN VALUES and ERROR sections.
* bindresvport related changesshin2000-01-263-73/+136
| | | | | | | | | | -changed bindresvport2 to bindresvport_sa -merged the man into bindresvport.3 All discussion between Jean-Luc Richier <Jean-Luc.Richier@imag.fr>, Theo de Raadt <deraadt@cvs.openbsd.org>, itojun, is reflected to this code. (Actually Theo de Raadt write the code simultaneously as the discussion change.)
* libc rcmd update for IPv6.shin2000-01-133-18/+63
| | | | | | | | A new function bindresvport2(), AF independent version of bindresvport() is also added. Reviewed by: sumikawa Obtained from: KAME project
* Add three-tier symbol naming in support of POSIX thread cancellationjasone2000-01-1215-36/+40
| | | | | | points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read().
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-292-4/+9
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* Commented outnik1999-12-141-1/+1
| | | | | | | | | | | | | MAN8+= rstat_svc.8 The file it talks about doesn't exist on FreeBSD, so there's no point in installing the manual page. There was already a comment to this effect in this file, but the entry hadn't been commented out. rstat.1 and rstat_svc.8 can probably actually be removed. PR: docs/13767 Submitted by: Seth <seth@freebie.dp.ny.frb.org>
* For the TCP transport, put the listening socket in non-blockingjdp1999-11-181-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | mode. This addresses a well-known race condition that can cause servers to hang in accept(). The relevant case is when somebody connects to the server and then immediately kills the connection by sending a TCP reset. On the server this causes select to report a ready condition on the socket, after which the accept call blocks because there is no longer any pending connection to accept. In -current there is already a work-around for this in the kernel. It was merged into -stable some time ago, but then David Greenman reverted it because it seemed to be causing a socket leak in some cases. (See uipc_socket.c revision 1.51.2.3.) Hence this userland fix is needed in -stable, and I plan to merge it into that branch soon because it fixes a potential DoS attack. It may also be needed in -current if the suspected socket leak turns out to be real. In any case, after thinking it over I believe the fix belongs in userland. An application shouldn't assume that a ready return from select guarantees that the subsequent I/O operation cannot block. A lot can happen between the select and the accept. A similar fix should most likely be applied to the Unix domain socket transport too. Submitted by: peter Reviewed by: jdp
* Fix a bug in the hack that protects against FTP bounce attacks.jdp1999-11-171-3/+2
| | | | | | | | | It used to loop back up to the accept() call and block there, shutting out all other transports until a new connection came in. Now it returns instead after dropping the connection. That will take it back to the select() loop where all transports can be serviced. I intend to MFC this within a day or two since it fixes a DoS vulnerability.
* $Id$ -> $FreeBSD$peter1999-08-2850-51/+51
|
* Add $Id$, to make it simpler for members of the translation teams tonik1999-07-1212-1/+20
| | | | | | | | | | | | | | | | | track. The $Id$ line is normally at the bottom of the main comment block in the man page, separated from the rest of the manpage by an empty comment, like so; .\" $Id$ .\" If the immediately preceding comment is a @(#) format ID marker than the the $Id$ will line up underneath it with no intervening blank lines. Otherwise, an additional blank line is inserted. Approved by: bde
* Document type for 'req' argument to clnt_control.alex1999-01-311-0/+1
|
* s/yellow pages/NIS/phk1998-09-171-3/+2
| | | | | | PR: 7949 Reviewed by: phk Submitted by: Norihiro Kumagai <kuma@jp.freebsd.org>
* Fixed printf format errors.bde1998-06-302-5/+5
|
* Fixed scanf format errors. The error handling is not quite bug for bugbde1998-06-301-7/+4
| | | | | | compatible. I think small negative uids are handled compatibly but other out of bounds ones are truncated differently for certain sizes of uid_t.
* Fix potential resource leak: when call to des_crypt_1() fails, rememberwpaul1998-06-091-2/+3
| | | | to destroy the RPC CLIENT handle before returning.
* The incorrect select() timeout calculation that I fixed in svc_tcp.cwpaul1998-05-211-2/+2
| | | | | also exists here (the timeout can expire much sooner than it's supposed to).
* Replace the getpublickey() stub with the real thing.wpaul1998-05-181-33/+160
|
* Improve DoS avoidance in RPC stream oriented transports. The TCP transportwpaul1998-05-182-34/+70
| | | | | | | | | | | | | | | | | | | | | | uses readtcp() to gather data from the network; readtcp() uses select(), with a timeout of 35 seconds. The problem with this is that if you connect to a TCP server, send two bytes of data, then just pause, the server will remain blocked in readtcp() for up to 35 seconds, which is sort of a long time. If you keep doing this every 35 seconds, you can keep the server occupied indefinitely. To fix this, I modified readtcp() (and its cousin, readunix() in svc_unix.c) to monitor all service transport handles instead of just the current socket. This allows the server to keep handling new connections that arrive while readtcp() is running. This prevents one client from potentially monopolizing a server. Also, while I was here, I fixed a bug in the timeout calculations. Someone attempted to adjust the timeout so that if select() returned EINTR and the loop was restarted, the timeout would be reduced so that rather than waiting for another 35 seconds, you could never wait for more than 35 seconds total. Unfortunately, the calculation was wrong, and the timeout could expire much sooner than 35 seconds.
* Patch RPC library to avoid possible denial of service attacks as describedwpaul1998-05-152-2/+4
| | | | | | recently in BUGTRAQ. If a stream oriented transport fails to properly decode an RPC message header structure where there should be one, it should mark the stream as dead so that the connection will be dropped.
* Fixed the usual missing dependencies on headers generated by rpcgen.bde1998-05-101-2/+2
|
* Fixed wrong prototypes. Most of the prototypes had missing return types,bde1998-01-161-9/+19
| | | | or missing const's or `short *' instead of `[ug]id_t *' in argument types.
* Convert to mdoc format.charnier1998-01-051-248/+146
|
* In clntudp_call(), it is possible that xdr_replymsg() might failwpaul1997-10-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | partway through its attempt to decode the result structure sent by the server. If this happens, it can leave the result partially populated with dynamically allocated memory. In this event, the xdr_replymsg() failure is detected and RPC_CANTDECODERES is returned, but the memory in the partially populated result struct is not free()d. The end result is that memory is leaked when an RPC_CANTDECODERES error occurs. (This condition can occur if a CLIENT * handle is created using clntudp_bufcreate() with a receive buffer size that is too small to handle the result sent by the server.) Fixed by setting reply_xdrs.x_op to XDR_FREE and calling xdr_replymsg() again to free the memory if an RPC_CANTDECODERES error is detected. I suspect that the clnt_tcp.c, clnt_unix.c and clnt_raw.c modules may ha a similar problem, but I haven't duplicated the condition with those yet. Found by: dbmalloc
* Sorted lists.bde1997-10-211-23/+22
|
* Fix two bugs which caused various RPC programs (mountd, nfsd, ...)jdp1997-10-171-3/+3
| | | | | | | | | | | | | | | to fail under certain circumstances. 1. In one spot, the ifr_flags member was being examined in the wrong structure, thus it contained garbage. On a machine in which only the loopback interface was up, this caused everything that wanted to talk to the portmapper to fail -- a particular problem with laptops, where the pccard ethernet interface is likely to come up long after the attempt to start mountd, nfsd, amd, etc. 2. Compounding the above problem, get_myaddress() returned a successful status even though it failed to find an address that it considered good enough.
* Removed the subdirectory paths from the definitions of MAN[1-9]. Theybde1997-10-151-7/+6
| | | | | were a workaround for limitations in bsd.man.mk that were fixed about 2 years ago.
* Correct a bug in the 'allow arbitrary number of socket descriptors' changeswpaul1997-10-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | made to the RPC code some months ago. The value of __svc_fdsetsize is being calculated incorrectly. Logically, one would assume that __svc_fdsetsize is being used as a substitute for FD_SETSIZE, with the difference being that __svc_fdsetsize can be expanded on the fly to accomodate more descriptors if need be. There are two problems: first, __svc_fdsetsize is not initialized to 0. Second, __svc_fdsetsize is being calculated in svc.c:xprt_registere() as: __svc_fdsetsize = howmany(sock+1, NFDBITS); This is wrong. If we are adding a socket with index value 4 to the descriptor set, then __svc_fdsetsize will be 1 (since fds_bits is an unsigned long, it can support any descriptor from 0 to 31, so we only need one of them). In order for this to make sense with the rest of the code though, it should be: __svc_fdsetsize = howmany(sock+1, NFDBITS) * NFDBITS; Now if sock == 4, __svc_fdsetsize will be 32. This bug causes 2 errors to occur. First, in xprt_register(), it causes the __svc_fdset descriptor array to be freed and reallocated unnecessarily. The code checks if it needs to expand the array using the test: if (sock + 1 > __svc_fdsetsize). The very first time through, __svc_fdsetsize is 0, which is fine: an array has to be allocated the first time out. However __svc_fdsetsize is incorrectly set to 1, so on the second time through, the test (sock + 1 > __svc_fdsetsize) will still succeed, and the __svc_fdset array will be destroyed and reallocated for no reason. Second, the code in svc_run.c:svc_run() can become hopelessly confused. The svc_run() routine malloc()s its own fd_set array using the value of __svc_fdsetsize to decide how much memory to allocate. Once the xprt_register() function expands the __svc_fdset array the first time, the value for __svc_fdsetsize becomes 2, which is too small: the resulting calculation causes the code to allocate an array that's only 32 bits wide when it actually needs 64 bits. It also uses the valuse of __svc_fdsetsize when copying the contents of the __svc_fdset array into the new array. The end result is that all but the first 32 file descriptors get lost. Note: from what I can tell, this bug originated in OpenBSD and was brought over to us when the code was merged. The bug is still there in the OpenBSD source. Total nervous breakdown averted by: Electric Fence 2.0.5
* Make selection logic more strict. Only select AF_INET loopback interfaceswpaul1997-09-211-3/+6
| | | | | that are up on second (loopback only) pass, and only select non-loopback AF_INET interfaces that are up on first pass.
* Add a stub version of getpublickey(), in order to eliminate anjdp1997-08-282-1/+47
| | | | | | | | | | undefined symbol referenced from libc. Without the stub, it is impossible to execute any program using the shared library if LD_BIND_NOW=1 is in the environment. The stub always returns failure, but it can be overridden outside the library when necessary. I don't know whether this is the "correct" fix, but it is intolerable to have any undefined symbols referenced from libc.
* Add to CLEANFILES instead of setting it absolutely. Cleaning of *.S andbde1997-07-211-1/+1
| | | | tags was broken.
* Show the real revision date and not the date that thissteve1997-06-234-4/+4
| | | | manpage is being viewed.
* Hm... wonder how long this has been here.wpaul1997-06-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic in get_myaddress() is broken: it always returns the loopback address due to the following rule: if ((ifreq.ifr_flags & IFF_UP) && ifr->ifr_addr.sa_family == AF_INET && (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK))) { The idea is that we want to select the interface address only if it's up and it's in the AF_INET family. If it turns uout we don't have such an interface available, we make a second pass through the loop, this time settling for the loopback interface. But the logic inadvertently locks out all cases when loopback == 0, so nothing is ever selected until the second pass (when loopback == 1). This is changed to: if (((ifreq.ifr_flags & IFF_UP) && ifr->ifr_addr.sa_family == AF_INET) || (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK))) { which I think does the right thing. This is yet another bogon I discovered during NIS+ testing; I need get_myaddress() to work correctly so that the callback code in the client library will work.
* Remember to zero sockaddr_in struct before calling uaddr_to_sockaddr() towpaul1997-06-151-0/+1
| | | | | populate it. Not doing this can result in a garbage sockaddr_in, which will cause connect() to block inside clnttcp_create().
* getnetid() crashes if no /etc/netid file is present (it tries to fclose()wpaul1997-06-121-1/+2
| | | | a FILE * handle that wasn't really open).
* Fix other small things that got lost in the merge:wpaul1997-05-282-3/+3
| | | | | | | | | | - bde's change to includes section in getrpcent.3 - Lost comment in svc_run.c (the code here was actually the same since I had fixed the 'fds + 1' bug in my stuff at home before mailing Peter about it, but I didn't notce that he'd made a change to the comment right above the changed line). Also pointed out by the ever vigilant: bde
* Resolve conflicts.wpaul1997-05-2833-84/+425
| | | | | | | | | | | This concludes tonight's entertainment. Once I'm sure I haven't destroyed the world with all these changes, I'll import the utilities. Everything should continue to work as before. If it doesn't let me know. Special thanks to Mark Murray for running a test 'make world' for me to shake out the bugs, which, hopefully, I have fixed. (And there was much rejoicing.)
* This commit was generated by cvs2svn to compensate for changes in r26219,wpaul1997-05-2820-0/+4989
| | | | which included commits to RCS files with non-trunk default branches.
OpenPOWER on IntegriCloud