summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormbr <mbr@FreeBSD.org>2003-05-28 09:16:35 +0000
committermbr <mbr@FreeBSD.org>2003-05-28 09:16:35 +0000
commitaa5288f4052f9dea1a815487d1933311df0c1b16 (patch)
tree700c907f368647f8ad0d13f50d0d8eaa1aabd365 /lib
parente1224fa532b4b0230b27667004bd04b652bdaa1f (diff)
downloadFreeBSD-src-aa5288f4052f9dea1a815487d1933311df0c1b16.zip
FreeBSD-src-aa5288f4052f9dea1a815487d1933311df0c1b16.tar.gz
If AF_LOCAL is used, we need to use __msgread_withcred() instead of
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
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/svc_vc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libc/rpc/svc_vc.c b/lib/libc/rpc/svc_vc.c
index 90fb29b..313d93f 100644
--- a/lib/libc/rpc/svc_vc.c
+++ b/lib/libc/rpc/svc_vc.c
@@ -488,7 +488,12 @@ read_vc(xprtp, buf, len)
cfp = (struct cf_conn *)xprt->xp_p1;
if (cfp->nonblock) {
- len = _read(sock, buf, (size_t)len);
+ if (sa->sa_family == AF_LOCAL) {
+ cm = (struct cmessage *)xprt->xp_verf.oa_base;
+ if ((len = __msgread_withcred(sock, buf, len, cm)) > 0)
+ xprt->xp_p2 = &cm->cmcred;
+ } else
+ len = _read(sock, buf, (size_t)len);
if (len < 0) {
if (errno == EAGAIN)
len = 0;
OpenPOWER on IntegriCloud