From owner-p4-projects@FreeBSD.ORG Thu Jun 18 22:43:00 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 39CC81065674; Thu, 18 Jun 2009 22:43:00 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDC15106566C for ; Thu, 18 Jun 2009 22:42:59 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DA68F8FC08 for ; Thu, 18 Jun 2009 22:42:59 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5IMgxIx010993 for ; Thu, 18 Jun 2009 22:42:59 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5IMgx0D010991 for perforce@freebsd.org; Thu, 18 Jun 2009 22:42:59 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 18 Jun 2009 22:42:59 GMT Message-Id: <200906182242.n5IMgx0D010991@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 164689 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2009 22:43:01 -0000 http://perforce.freebsd.org/chv.cgi?CH=164689 Change 164689 by rwatson@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 */