From patchwork Sat Nov 14 07:48:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miroslav Grepl X-Patchwork-Id: 7616741 Return-Path: X-Original-To: patchwork-selinux@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C49A5BF90C for ; Sat, 14 Nov 2015 07:51:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30CF22056D for ; Sat, 14 Nov 2015 07:51:46 +0000 (UTC) Received: from emvm-gh1-uea08.nsa.gov (emvm-gh1-uea08.nsa.gov [63.239.67.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB3D62054D for ; Sat, 14 Nov 2015 07:51:44 +0000 (UTC) X-TM-IMSS-Message-ID: <20d9180e0003bdec@nsa.gov> Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by nsa.gov ([63.239.67.9]) with ESMTP (TREND IMSS SMTP Service 7.1) id 20d9180e0003bdec ; Sat, 14 Nov 2015 02:50:13 -0500 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id tAE7nC2S005576; Sat, 14 Nov 2015 02:49:24 -0500 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id tAE7n9R0268125 for ; Sat, 14 Nov 2015 02:49:09 -0500 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id tAE7n9bi005574 for ; Sat, 14 Nov 2015 02:49:09 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1A8BgAI50ZW/xy3hNFeGQEDAQ4BAQKDCwGBQa8iAUqMQ4QMEoV+gTlMAQEBAQEBhj+BUYguwFiGVIolhBIFlkiNJ45njV5jgUoBC26BQXGFPQEBAQ X-IPAS-Result: A1A8BgAI50ZW/xy3hNFeGQEDAQ4BAQKDCwGBQa8iAUqMQ4QMEoV+gTlMAQEBAQEBhj+BUYguwFiGVIolhBIFlkiNJ45njV5jgUoBC26BQXGFPQEBAQ X-IronPort-AV: E=Sophos;i="5.20,292,1444708800"; d="scan'208";a="4932325" Received: from emvm-gh1-uea09.nsa.gov ([63.239.67.10]) by goalie.tycho.ncsc.mil with ESMTP; 14 Nov 2015 02:48:47 -0500 X-TM-IMSS-Message-ID: <20d100b70003a061@nsa.gov> Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by nsa.gov ([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1; TLSv1/SSLv3 ADH-AES256-SHA (256/256)) id 20d100b70003a061 ; Sat, 14 Nov 2015 02:50:07 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 7D7928F4F1 for ; Sat, 14 Nov 2015 07:48:45 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-200-20.brq.redhat.com [10.40.200.20]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAE7mgkE011539; Sat, 14 Nov 2015 02:48:43 -0500 From: Miroslav Grepl To: selinux@tycho.nsa.gov Subject: [PATCH] policycoreutils/sandbox: Fix sandbox to propagate specified MCS/MLS Security Level. Date: Sat, 14 Nov 2015 08:48:40 +0100 Message-Id: <1447487320-18763-1-git-send-email-mgrepl@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-TM-AS-MML: disable X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If "level" option is used to start sandbox commands, this level is not propagated to specified homedir and tmpdir directories. See rhbz #1279006. Signed-off-by: Miroslav Grepl --- policycoreutils/sandbox/sandbox | 3 --- 1 file changed, 3 deletions(-) diff --git a/policycoreutils/sandbox/sandbox b/policycoreutils/sandbox/sandbox index 5109eca..163afa0 100644 --- a/policycoreutils/sandbox/sandbox +++ b/policycoreutils/sandbox/sandbox @@ -406,9 +406,6 @@ sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [- self.__execcon = "%s:%s:%s:%s" % (con[0], con[1], self.setype, level) self.__filecon = "%s:object_r:sandbox_file_t:%s" % (con[0], level) def __setup_dir(self): - if self.__options.level or self.__options.session: - return - if self.__options.homedir: selinux.chcon(self.__options.homedir, self.__filecon, recursive=True) self.__homedir = self.__options.homedir