From patchwork Tue Sep 27 11:54:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Bigonville X-Patchwork-Id: 9351747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9B276077B for ; Tue, 27 Sep 2016 11:55:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B742028563 for ; Tue, 27 Sep 2016 11:55:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A73EA28A6A; Tue, 27 Sep 2016 11:55:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (smtp.nsa.gov [8.44.101.8]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 96DE328563 for ; Tue, 27 Sep 2016 11:55:49 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.30,405,1470700800"; d="scan'208";a="17996071" IronPort-PHdr: =?us-ascii?q?9a23=3Af0Gl5xfRq9gw2ZHBl98ixAMwlGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxc6/ZR7h7PlgxGXEQZ/co6odzbGH6ea5BCdcvd6oizMrSNR0TRgLiM?= =?us-ascii?q?EbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3Dwdp?= =?us-ascii?q?POO9QteU1JXtkbnvsMGPKyxzxxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP?= =?us-ascii?q?5Xz247bXianhL7+9vitMU7q3cYhuglv/Jkfe26Ov1gDO8QMDNzKG0x5cv2pTHf?= =?us-ascii?q?XACP4T0aSWxQnR1WUCbf6xSvep7sqCb8qqJX2SadO9P3SbQ5EWCo7qhsTjfkhS?= =?us-ascii?q?0GPjh/93vY3J8jxJlHqQ6s8kQsi7XfZ5uYYb8nJq4=3D?= X-IPAS-Result: =?us-ascii?q?A2EVCQAJXepX/wHyM5BdHBgHDBgHgwkBAQEBAR5XfKM5Cwa?= =?us-ascii?q?XNSMLgXCFcEwBAQEBAQEBAQIBAlsngjIEAxMFBTk7AQEBAQEBASMCDSJEAjcGA?= =?us-ascii?q?QEMIAwCAwkCFwgfAggIAwEtCwofCwUYBIgsBAEJsWSFMAEBBYglARwDBYVtiTI?= =?us-ascii?q?CEQFohRKZe4YniTkKiX2Fb5BmAlSFCHABhCgPF2GBJwEBAQ?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 27 Sep 2016 11:55:46 +0000 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 u8RBssd2021711; Tue, 27 Sep 2016 07:55:05 -0400 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 u8RBsscR269136 for ; Tue, 27 Sep 2016 07:54:54 -0400 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 u8RBsj1N021689 for ; Tue, 27 Sep 2016 07:54:53 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1AFEAAJXepX/2OteVtdHAEXAQYBgzMBAQEBAR5XNUejOQUBAQEBAQEGl1MQh2BMAQIBAQEBAQJeJ4UoAQE4Lx9ONIhRAQmxZIUwAQEFiEIDBYVtiTJ8hRKZe4YniTkKj2yQZgJUgkoMgjJwAYQogi4BAQE X-IPAS-Result: A1AFEAAJXepX/2OteVtdHAEXAQYBgzMBAQEBAR5XNUejOQUBAQEBAQEGl1MQh2BMAQIBAQEBAQJeJ4UoAQE4Lx9ONIhRAQmxZIUwAQEFiEIDBYVtiTJ8hRKZe4YniTkKj2yQZgJUgkoMgjJwAYQogi4BAQE X-IronPort-AV: E=Sophos;i="5.30,405,1470715200"; d="scan'208";a="5730701" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 27 Sep 2016 07:54:51 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3Ab1CfvBMGLSLRPpUZgucl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0KP/9rarrMEGX3/hxlliBBdydsKMezbOL+Py8EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkIt?= =?us-ascii?q?f6KuS9SU1pn8i7z60qaQSj0AvCC6b7J2IUf+hiTqne5Sv7FfLL0swADCuHpCdr?= =?us-ascii?q?ce72ppIVWOg0S0vZ/or9YwuxhX7uks889GTLXSY7UzTbseCi8vdW8y+p7Frx7G?= =?us-ascii?q?GC+G+2ERVHleuBtHBA7b7RX+U9+luCr1sexV1CSQPMTwC7cuVmLxvO9QVBb0hX?= =?us-ascii?q?JfZHYC+2bNh5kogQ=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0FfEQCmXepX/2OteVtdHAEXAQYBCwEBF?= =?us-ascii?q?gEBBQEBBoMBAQEBAQEeVzUCRaM5CwaXUxCBcIVwTAEBAQEBAQEBAgECWyeCMhg?= =?us-ascii?q?MOTsBAQEBAQEBIwINIoEDAQE4Lx9ONIhRAQmxZIUwAQEFiEIDBYVtiTJ8hRKZe?= =?us-ascii?q?4YniTkKj2yQZgJUgkoMgjJwAYQogi4BAQE?= X-IPAS-Result: =?us-ascii?q?A0FfEQCmXepX/2OteVtdHAEXAQYBCwEBFgEBBQEBBoMBAQE?= =?us-ascii?q?BAQEeVzUCRaM5CwaXUxCBcIVwTAEBAQEBAQEBAgECWyeCMhgMOTsBAQEBAQEBI?= =?us-ascii?q?wINIoEDAQE4Lx9ONIhRAQmxZIUwAQEFiEIDBYVtiTJ8hRKZe4YniTkKj2yQZgJ?= =?us-ascii?q?UgkoMgjJwAYQogi4BAQE?= X-IronPort-AV: E=Sophos;i="5.30,405,1470700800"; d="scan'208";a="19575168" Received: from anor.bigon.be ([91.121.173.99]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2016 11:54:33 +0000 Received: from anor.bigon.be (localhost.localdomain [127.0.0.1]) by anor.bigon.be (Postfix) with ESMTP id 975B21A1A8 for ; Tue, 27 Sep 2016 13:54:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bigon.be; h= x-mailer:message-id:date:date:subject:subject:from:from:received :received:received; s=key1; t=1474977267; x=1476791668; bh=s4wQD JNERQqoijlDG4xrutvhZuBgl7LUybpggNNT1Bo=; b=dlc7iEYWn/RqVP/ytHNpD nuT0oyq5zjHXQ4zlMdiMuWmy/U3KnfxwydG792rmoD0S1aIdiOHMD14OPp0lhRJD BWsbCobN5cJjX2sKvWJZS/5N21neGt/uuHEh1R1l1BrGrM9FQntB4C/WgA4GmlV7 wo0tWFTQPVyvzTYKcchWb4= X-Virus-Scanned: Debian amavisd-new at bigon.be Received: from anor.bigon.be ([127.0.0.1]) by anor.bigon.be (anor.bigon.be [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Nzax3PVBu4wi for ; Tue, 27 Sep 2016 13:54:27 +0200 (CEST) Received: from valinor.bigon.be (unknown [193.53.238.201]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bigon) by anor.bigon.be (Postfix) with ESMTPSA id 0AD6C1A06E for ; Tue, 27 Sep 2016 13:54:27 +0200 (CEST) Received: from bigon (uid 1000) (envelope-from bigon@bigon.be) id 5f727 by valinor.bigon.be (DragonFly Mail Agent v0.11); Tue, 27 Sep 2016 13:54:26 +0200 From: Laurent Bigonville To: selinux@tycho.nsa.gov Subject: [Patch v2] sandbox: Use dbus-run-session instead of dbus-launch when available Date: Tue, 27 Sep 2016 13:54:26 +0200 Message-Id: <20160927115426.23097-1-bigon@debian.org> X-Mailer: git-send-email 2.9.3 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-Virus-Scanned: ClamAV using ClamSMTP From: Laurent Bigonville According to dbus upstream: "dbus-launch is fairly horrible code, complicated by the historical need for it to support X11 autolaunching, so the D-Bus maintainers would like to move it out of the critical path and minimize its use." https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836289 Signed-off-by: Laurent Bigonville --- policycoreutils/sandbox/sandbox | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/policycoreutils/sandbox/sandbox b/policycoreutils/sandbox/sandbox index b6bc805..bfb2de3 100644 --- a/policycoreutils/sandbox/sandbox +++ b/policycoreutils/sandbox/sandbox @@ -285,7 +285,11 @@ class Sandbox: # /usr/bin/test -r ~/.xmodmap && /usr/bin/xmodmap ~/.xmodmap %s & WM_PID=$! -dbus-launch --exit-with-session %s +if which dbus-run-session >/dev/null 2>&1; then + dbus-run-session -- %s +else + dbus-launch --exit-with-session %s +fi kill -TERM $WM_PID 2> /dev/null """ % (command, wm, command)) fd.close()