Index: nfs/nfs_socket.c =================================================================== RCS file: /cvs/src/sys/nfs/nfs_socket.c,v retrieving revision 1.57 diff -u -r1.57 nfs_socket.c --- nfs/nfs_socket.c 6 Jan 2008 17:38:23 -0000 1.57 +++ nfs/nfs_socket.c 21 May 2008 19:52:25 -0000 @@ -172,6 +172,7 @@ if (saddr->sa_family == AF_INET) { struct mbuf *mopt; int *ip; + struct ucred *ocred; MGET(mopt, M_WAIT, MT_SOOPTS); mopt->m_len = sizeof(int); @@ -187,8 +188,16 @@ sin->sin_family = AF_INET; sin->sin_addr.s_addr = INADDR_ANY; sin->sin_port = htons(0); + + /* temporarily become root (ugh; sobind should take cred arg) */ + ocred = curproc->p_ucred; + curproc->p_ucred = crdup(ocred); + curproc->p_ucred->cr_uid = 0; + error = sobind(so, m); m_freem(m); + crfree(curproc->p_ucred); + curproc->p_ucred = ocred; if (error) goto bad; @@ -535,11 +544,6 @@ } } while (error == EWOULDBLOCK); if (!error && auio.uio_resid > 0) { - log(LOG_INFO, - "short receive (%d/%d) from nfs server %s\n", - sizeof(u_int32_t) - auio.uio_resid, - sizeof(u_int32_t), - rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname); error = EPIPE; } if (error) @@ -566,10 +570,6 @@ } while (error == EWOULDBLOCK || error == EINTR || error == ERESTART); if (!error && auio.uio_resid > 0) { - log(LOG_INFO, - "short receive (%d/%d) from nfs server %s\n", - len - auio.uio_resid, len, - rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname); error = EPIPE; } } else {