From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2FB5D138334 for ; Sun, 15 Dec 2019 23:05:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 70217E0823; Sun, 15 Dec 2019 23:05:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 32B4CE0823 for ; Sun, 15 Dec 2019 23:05:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0B05934D8CC for ; Sun, 15 Dec 2019 23:05:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4FED88A1 for ; Sun, 15 Dec 2019 23:04:59 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1576448483.e385eee1614b7b1e296b0e9560ad2d87ace9ea69.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/process.py X-VCS-Directories: lib/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: e385eee1614b7b1e296b0e9560ad2d87ace9ea69 X-VCS-Branch: master Date: Sun, 15 Dec 2019 23:04:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d5483190-28a5-4048-a53d-0b27975523e2 X-Archives-Hash: 065f4bc9e57dd456d4562ec64b04e3d3 commit: e385eee1614b7b1e296b0e9560ad2d87ace9ea69 Author: Zac Medico gentoo org> AuthorDate: Sun Dec 15 22:11:55 2019 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Dec 15 22:21:23 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e385eee1 process: display relevant FEATURES when unshare fails For example, the message will now look like this: Unable to unshare: EPERM (for FEATURES="ipc-sandbox mount-sandbox network-sandbox pid-sandbox") Bug: https://bugs.gentoo.org/680456 Signed-off-by: Zac Medico gentoo.org> lib/portage/process.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/portage/process.py b/lib/portage/process.py index df63ae72f..c1fc4bcf6 100644 --- a/lib/portage/process.py +++ b/lib/portage/process.py @@ -628,8 +628,19 @@ def _exec(binary, mycommand, opt_name, fd_pipes, if errno_value == 0 and libc.unshare(unshare_flags) != 0: errno_value = ctypes.get_errno() if errno_value != 0: - writemsg("Unable to unshare: %s\n" % ( - errno.errorcode.get(errno_value, '?')), + + involved_features = [] + if unshare_ipc: + involved_features.append('ipc-sandbox') + if unshare_mount: + involved_features.append('mount-sandbox') + if unshare_net: + involved_features.append('network-sandbox') + if unshare_pid: + involved_features.append('pid-sandbox') + + writemsg("Unable to unshare: %s (for FEATURES=\"%s\")\n" % ( + errno.errorcode.get(errno_value, '?'), ' '.join(involved_features)), noiselevel=-1) else: if unshare_pid: