PERFORCE change 164246 for review

Robert Watson rwatson at FreeBSD.org
Sat Jun 13 08:22:51 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=164246

Change 164246 by rwatson at 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;


More information about the p4-projects mailing list