PERFORCE change 164689 for review

Robert Watson rwatson at FreeBSD.org
Thu Jun 18 22:43:01 UTC 2009


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

Change 164689 by rwatson at rwatson_freebsd_capabilities on 2009/06/18 22:42:30

	When building the 'rescue' environment, don't include sandbox support
	in gzip.  At least, not yet.

Affected files ...

.. //depot/projects/trustedbsd/capabilities/src/usr.bin/gzip/Makefile#5 edit
.. //depot/projects/trustedbsd/capabilities/src/usr.bin/gzip/gzsandbox.c#6 edit

Differences ...

==== //depot/projects/trustedbsd/capabilities/src/usr.bin/gzip/Makefile#5 (text+ko) ====

@@ -19,6 +19,10 @@
 CFLAGS+=	-DNO_BZIP2_SUPPORT
 .endif
 
+.if defined(RESCUE)
+CFLAGS+=	-DNO_SANDBOX_SUPPORT
+.endif
+
 SCRIPTS=	gzexe zdiff zforce zmore znew
 
 MLINKS+=	gzip.1 gunzip.1 \

==== //depot/projects/trustedbsd/capabilities/src/usr.bin/gzip/gzsandbox.c#6 (text+ko) ====

@@ -57,6 +57,8 @@
 
 #define	LC_USR_BIN_GZIP_SANDBOX	"/usr/bin/gzip"
 
+#ifndef NO_SANDBOX_SUPPORT
+
 struct lc_library gzsandbox_libs[] = {
 	{ LC_LIB_LIBZ_SO,		LC_LIBZ_SO,	-1 },
 	{ LC_USR_LIB_LIBBZ2_SO,		LC_LIBBZ2_SO,	-1 },
@@ -330,6 +332,7 @@
 	if (lcs_sendrpc(lchp, opno, seqno, &iov, 1) < 0)
 		err(-1, "lcs_sendrpc");
 }
+
 off_t
 unbzip2_wrapper(int in, int out, char *pre, size_t prelen, off_t *bytes_in)
 {
@@ -396,3 +399,30 @@
 		free(buffer);
 	}
 }
+
+#else /* NO_SANDBOX_SUPPORT */
+
+off_t
+gz_compress_wrapper(int in, int out, off_t *gsizep, const char *origname,
+    uint32_t mtime)
+{
+
+	return (gz_compress(in, out, gsizep, origname, mtime));
+}
+
+off_t
+gz_uncompress_wrapper(int in, int out, char *pre, size_t prelen,
+    off_t *gsizep, const char *filename)
+{
+
+	return (gz_uncompress(in, out, pre, prelen, gsizep, filename));
+}
+
+off_t
+unbzip2_wrapper(int in, int out, char *pre, size_t prelen, off_t *bytes_in)
+{
+
+	return (unbzip2(in, out, pre, prelen, bytes_in));
+}
+
+#endif /* !NO_SANDBOX_SUPPORT */


More information about the p4-projects mailing list