diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2009-02-22 07:47:23 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2009-02-22 07:47:23 +0000 |
commit | daea31b785b4497a3bb956c142810504edb37eb0 (patch) | |
tree | a05c75f977789463f27bbbf079e67e9e9b15738d /sys/nfs/nfs_socket.c | |
parent | 5a1b1a963a64a8b6b5ce84deb42c189f50859cd7 (diff) |
fix PR 6082: do not create more fd's than will fit in the message on
the receiving side when passing fd's. ok deraadt@ kettenis@
Diffstat (limited to 'sys/nfs/nfs_socket.c')
-rw-r--r-- | sys/nfs/nfs_socket.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index 8fef3976f97..eec72e213c4 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_socket.c,v 1.77 2009/01/24 23:35:47 thib Exp $ */ +/* $OpenBSD: nfs_socket.c,v 1.78 2009/02/22 07:47:22 otto Exp $ */ /* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */ /* @@ -517,7 +517,8 @@ tryagain: do { rcvflg = MSG_WAITALL; error = soreceive(so, (struct mbuf **)0, &auio, - (struct mbuf **)0, (struct mbuf **)0, &rcvflg); + (struct mbuf **)0, (struct mbuf **)0, &rcvflg, + 0); if (error == EWOULDBLOCK && rep) { if (rep->r_flags & R_SOFTTERM) return (EINTR); @@ -561,7 +562,7 @@ tryagain: do { rcvflg = MSG_WAITALL; error = soreceive(so, (struct mbuf **)0, - &auio, mp, (struct mbuf **)0, &rcvflg); + &auio, mp, (struct mbuf **)0, &rcvflg, 0); } while (error == EWOULDBLOCK || error == EINTR || error == ERESTART); if (!error && auio.uio_resid > 0) { @@ -585,7 +586,7 @@ tryagain: do { rcvflg = 0; error = soreceive(so, (struct mbuf **)0, - &auio, mp, &control, &rcvflg); + &auio, mp, &control, &rcvflg, 0); if (control) m_freem(control); if (error == EWOULDBLOCK && rep) { @@ -629,7 +630,7 @@ errout: do { rcvflg = 0; error = soreceive(so, getnam, &auio, mp, - (struct mbuf **)0, &rcvflg); + (struct mbuf **)0, &rcvflg, 0); if (error == EWOULDBLOCK && (rep->r_flags & R_SOFTTERM)) return (EINTR); @@ -1644,7 +1645,8 @@ nfsrv_rcv(so, arg, waitflag) */ auio.uio_resid = 1000000000; flags = MSG_DONTWAIT; - error = soreceive(so, &nam, &auio, &mp, (struct mbuf **)0, &flags); + error = soreceive(so, &nam, &auio, &mp, (struct mbuf **)0, + &flags, 0); if (error || mp == (struct mbuf *)0) { if (error == EWOULDBLOCK) slp->ns_flag |= SLP_NEEDQ; @@ -1679,7 +1681,7 @@ nfsrv_rcv(so, arg, waitflag) auio.uio_resid = 1000000000; flags = MSG_DONTWAIT; error = soreceive(so, &nam, &auio, &mp, - (struct mbuf **)0, &flags); + (struct mbuf **)0, &flags, 0); if (mp) { if (nam) { m = nam; |