From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 80D23138247 for ; Wed, 22 Jan 2014 05:59:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EDD2AE0E25; Wed, 22 Jan 2014 05:59:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 91F3AE0E25 for ; Wed, 22 Jan 2014 05:59:48 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id B41D833FAB9 for ; Wed, 22 Jan 2014 05:59:47 +0000 (UTC) From: Mike Frysinger To: gentoo-releng@lists.gentoo.org Subject: [gentoo-releng] [PATCH] catalyst-auto: run in a mount namespace Date: Wed, 22 Jan 2014 00:59:51 -0500 Message-Id: <1390370391-9799-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.8.4.3 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-releng@lists.gentoo.org Reply-to: gentoo-releng@lists.gentoo.org X-Archives-Salt: b15900e1-73b0-4a2e-a62f-d81fffb39a5f X-Archives-Hash: b3df8d9ac65294360b7ef8843eb5a869 This way if things crash, we don't leak mounts that need cleaning up. --- tools/catalyst-auto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/catalyst-auto b/tools/catalyst-auto index c4c6aa6..c4796a1 100755 --- a/tools/catalyst-auto +++ b/tools/catalyst-auto @@ -1,5 +1,13 @@ #!/bin/bash +# First let's get our own mount namespace to avoid leaking crap. +if [[ -z ${UNSHARE} ]] ; then + if type -P unshare >&/dev/null ; then + UNSHARE=true exec unshare -m -- "$0" "$@" + fi +fi +unset UNSHARE + PID=$$ config_file= -- 1.8.4.3