summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/svc_vc.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug in the userland rpc library, where it would use armacklem2011-04-101-1/+2
| | | | | | | | | | | | negative return value from write to update its position in a buffer. The patch, courtesy of Andrey Simonenko, also simplifies a conditional by removing the "i != cnt" clause, since it is always true at this point in the code. The bug caused problems for mountd, when it generated a large reply to an exports RPC request. Submitted by: simon at comsys.ntu-kpi.kiev.ua MFC after: 2 weeks
* Add an implementation of the RPCSEC_GSS authentication protocol for RPC. Thisdfr2008-08-061-13/+32
| | | | | | | | is based on an old implementation from the University of Michigan with lots of changes and fixes by me and the addition of a Solaris-compatible API. Sponsored by: Isilon Systems Reviewed by: alfred
* Don't call xdrrec_skiprecord in the non-blocking case. Ifdfr2008-03-301-1/+2
| | | | | | | | | | | __xdrrec_getrec has returned TRUE, then we have a complete request in the buffer - calling xdrrec_skiprecord is not necessary. In particular, if there is another record already buffered on the stream, xdrrec_skiprecord will discard both this request and the next one, causing the call to xdr_callmsg to fail and the stream to be closed. Sponsored by: Isilon Systems
* Sync with NetBSD rev. 1.16 + 1.17mbr2006-09-091-2/+5
| | | | | | | | Coverity CID 2292: Plug memory leak. Coverity CID 2291: Move function call before allocating storage to prevent memory leak on error. MFC after: 1 month
* Staticize a couple of functions.deischen2006-02-271-4/+1
| | | | | | Remove a few unused locks. Remove locks from application namespace.
* Try to bring some sanity to the SCM ID's.obrien2004-10-161-1/+1
| | | | | | + spell LIBC_SCCS consistently + enable builds with LIBC_SCCS defined to not syntax error + minor SCM reformatting to try to have some consistency
* Avoid using void pointers in additive expressions.stefanf2004-08-131-1/+1
| | | | | PR: 56653 (libc/rpc bits) Approved by: alfred
* Kill prototype for __msgwrite too. It is not needed anymore.mbr2003-06-151-1/+0
|
* Replace the old SCM_CREDS cred procedures. They can now bembr2003-06-151-122/+21
| | | | | | | | | replaced just fine with getpeereid() and the whole code gets a lot simpler. We don't break the ABI, since all server programms use __rpc_get_local_uid(), and we just change library internals. Reviewed by: des
* Don't return -1 and abort if msg.msg_controllen is 0. Formbr2003-05-291-2/+1
| | | | | | | | some strange reason recvmsg() never sets errno to EAGAIN on a non-blocking socket and just returns 0. Reviewed by: jhb Approved by: re
* Fix a problem introduced in the last commit. sa and cmmbr2003-05-291-2/+2
| | | | | | | | | are not initialized at this place. Move the initializing before the non-blocking check. Submitted by: Marius Strobl <marius@alchemy.franken.de> Reviewed by: jhb Approved by: re
* If AF_LOCAL is used, we need to use __msgread_withcred() instead ofmbr2003-05-281-1/+6
| | | | | | | | | just read() in non-blocking mode too. The reason is obvious. NetBSD uses a complete different way to get the credentials so this patch only applies to FreeBSD. Reviewed by: rwatson Approved by: re
* Fix namespace pollution introduced in previous commit.mbr2003-01-261-4/+4
| | | | Reviewed by: phk
* Implement non-blocking tcp-connections.mbr2003-01-161-31/+197
| | | | | | Reviewed by: rwatson Obtained from: NetBSD MFC after: 1 day
* Spell void * as void * rather than caddr_t. This is complicated by thedes2002-04-281-18/+18
| | | | | | fact that caddr_t is often misspelled as char *. Sponsored by: DARPA, NAI Labs
* Fix the style of the SCM ID's.obrien2002-03-221-2/+2
| | | | I believe have made all of libc .c's as consistent as possible.
* Remove multi-line __P() usage.obrien2002-03-221-3/+3
|
* Remove __P() usage.obrien2002-03-211-14/+14
|
* Move the AF_LOCAL check to the AF_INET check since portmap protocolalfred2002-02-061-5/+1
| | | | | | v. 2 only needs this. That also makes it shorter and simpler. Submitted by: mbr
* For RPC v2 we need to fill in ret->xp_raddr too. INET_6alfred2002-02-051-1/+1
| | | | | | is not supported in portmap, so we don't have to care about it. Submitted by: mbr
* Fix cc -Wall, fix rcsid warnings, add missing prototypes,alfred2002-02-051-1/+0
| | | | | | | | | change prototypes to be the same as in the original sun tirpc code. Remove ()P macro in a file where the mayority had ()P already removed. Add them if the mayority use ()P macros. Submitted by: mbr Requested by: bde
* style: return(x) -> return (x)alfred2002-02-051-2/+2
| | | | Submitted by: mbr
* Fix the credential handling code.alfred2002-02-051-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In NetBSD, Solaris, xprt->xp_p2 pointed directly to the credentials, in FreeBSD xprt->xp_verf.oa_base was a pointer to a struct cmessage, which is defined as follow: struct cmessage { struct cmsghdr cmsg; struct cmsgcred cmcred; }; The credentials were submitted the right way and xprt->xp_p2 pointed to them. But cb_verf.oa_flavor was still empty. There was an assignment missing in svc_recv() in svc_vc.c: msg->rm_call.cb_verf.oa_flavor = AUTH_UNIX; Also + if (addr.ss_family == AF_LOCAL) { + xprt->xp_raddr = *(struct sockaddr_in *)xprt->xp_rtaddr.buf; + xprt->xp_addrlen = sizeof (struct sockaddr_in); + } was missing. But the first seems not to be needed: I guess in rpc.yppasswdd there was a typo: - transp>xp_verf.oa_flavor != AUTH_UNIX) { + rqstp->rq_cred.oa_flavor != AUTH_UNIX) { This little fix does fix the breakage in rpc.yppasswdd :-) + if (msg.msg_controllen == 0 || + (msg.msg_flags & MSG_CTRUNC) != 0) + return (-1); We cannot set the cb_verf.oa_length in svc_recv() of svc_vc.c, the credentials get overwritten then, and that's bad. Submitted by: mbr
* Hopefully improve control message passing over Unix domain sockets.dwmalone2001-10-041-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Allow the sending of more than one control message at a time over a unix domain socket. This should cover the PR 29499. 2) This requires that unp_{ex,in}ternalize and unp_scan understand mbufs with more than one control message at a time. 3) Internalize and externalize used to work on the mbuf in-place. This made life quite complicated and the code for sizeof(int) < sizeof(file *) could end up doing the wrong thing. The patch always create a new mbuf/cluster now. This resulted in the change of the prototype for the domain externalise function. 4) You can now send SCM_TIMESTAMP messages. 5) Always use CMSG_DATA(cm) to determine the start where the data in unp_{ex,in}ternalize. It was using ((struct cmsghdr *)cm + 1) in some places, which gives the wrong alignment on the alpha. (NetBSD made this fix some time ago). This results in an ABI change for discriptor passing and creds passing on the alpha. (Probably on the IA64 and Spare ports too). 6) Fix userland programs to use CMSG_* macros too. 7) Be more careful about freeing mbufs containing (file *)s. This is made possible by the prototype change of externalise. PR: 29499 MFC after: 6 weeks
* Move the #includes of reentrant.h to after the `#include "namespace.h"',iedowse2001-04-021-1/+1
| | | | | | | | so that the underscored versions of the pthread functions get declared. This removes around 300 lines of 'implicit declaration of XXX' warnings from the output of a libc build with -Wall. Reviewed by: Martin Blapp <mb@imp.ch>, alfred
* Remove struct cmessage from sys/socket.h and reintroduce the privatealfred2001-03-221-2/+4
| | | | | | definitions. Requested by: wollman
* Hopefully fix some of the bugs in passing credentials over UNIX ↵alfred2001-03-221-19/+30
| | | | | | | | | | | | domain sockets. Make struct cmessage visible from socket.h (about 4 places were defining it for themselves which wasn't good) Make __rpc_get_local_uid() useable and give it prototype that's visible. Fix some issues with printing out usernames from rpcbind and keyserv.
* whitespace cleanupalfred2001-03-201-16/+14
|
* Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) andalfred2001-03-191-0/+689
associated changes that had to happen to make this possible as well as bugs fixed along the way. Bring in required TLI library routines to support this. Since we don't support TLI we've essentially copied what NetBSD has done, adding a thin layer to emulate direct the TLI calls into BSD socket calls. This is mostly from Sun's tirpc release that was made in 1994, however some fixes were backported from the 1999 release (supposedly only made available after this porting effort was underway). The submitter has agreed to continue on and bring us up to the 1999 release. Several key features are introduced with this update: Client calls are thread safe. (1999 code has server side thread safe) Updated, a more modern interface. Many userland updates were done to bring the code up to par with the recent RPC API. There is an update to the pthreads library, a function pthread_main_np() was added to emulate a function of Sun's threads library. While we're at it, bring in NetBSD's lockd, it's been far too long of a wait. New rpcbind(8) replaces portmap(8) (supporting communication over an authenticated Unix-domain socket, and by default only allowing set and unset requests over that channel). It's much more secure than the old portmapper. Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded to support TI-RPC and to support IPV6. Umount(8) is also fixed to unmount pathnames longer than 80 chars, which are currently truncated by the Kernel statfs structure. Submitted by: Martin Blapp <mb@imp.ch> Manpage review: ru Secure RPC implemented by: wpaul
OpenPOWER on IntegriCloud