Date: Sat, 13 Jun 2009 08:22:50 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 164246 for review Message-ID: <200906130822.n5D8MoWV059789@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=164246 Change 164246 by rwatson@rwatson_freebsd_capabilities on 2009/06/13 08:22:10 Return EPIPE rather than EBADMSG when an EOF is generated by RPC send or receive. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability_sandbox.c#5 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability_sandbox.c#5 (text+ko) ==== @@ -142,6 +142,10 @@ len = lcs_recv(lchp, &req_hdr, sizeof(req_hdr), MSG_WAITALL); if (len < 0) return (-1); + if (len == 0) { + errno = EPIPE; + return (-1); + } if (len != sizeof(req_hdr)) { errno = EBADMSG; return (-1); @@ -177,6 +181,11 @@ free(buffer); return (-1); } + if (len == 0) { + errno = EPIPE; + free(buffer); + return (-1); + } totlen += len; } *bufferp = buffer;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906130822.n5D8MoWV059789>