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 01F38138A1A for ; Fri, 13 Feb 2015 18:44:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 609F6E0929; Fri, 13 Feb 2015 18:43:59 +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 F25B6E0929 for ; Fri, 13 Feb 2015 18:43:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0A9413407FF for ; Fri, 13 Feb 2015 18:43:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4B14211AF8 for ; Fri, 13 Feb 2015 18:43:54 +0000 (UTC) From: "Alexander Berntsen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alexander Berntsen" Message-ID: <1423853016.eccdfdfea08de3581b4d6864f560384b97088e50.bernalex@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/main.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: bernalex X-VCS-Committer-Name: Alexander Berntsen X-VCS-Revision: eccdfdfea08de3581b4d6864f560384b97088e50 X-VCS-Branch: master Date: Fri, 13 Feb 2015 18:43:54 +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-Archives-Salt: 85bb7612-c8f1-4b04-8c49-2018883d24e7 X-Archives-Hash: c7a5921440be5385f3b15be5580c53d8 commit: eccdfdfea08de3581b4d6864f560384b97088e50 Author: Alexander Berntsen gentoo org> AuthorDate: Fri Feb 13 17:40:23 2015 +0000 Commit: Alexander Berntsen gentoo org> CommitDate: Fri Feb 13 18:43:36 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=eccdfdfe Add early check for broken /dev/s (bug 538980) Signed-off-by: Alexander Berntsen gentoo.org> Suggested-by: Zac Medico gentoo.org> ACKed-by: Zac Medico gentoo.org> --- pym/_emerge/main.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 5d5e936..f1a9e18 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -1100,6 +1100,20 @@ def emerge_main(args=None): # loading to allow new repos with non-existent directories portage._sync_mode = True + # Verify that /dev/null exists and is a device file as a cheap early + # filter for obviously broken /dev/s. + try: + if os.stat(os.devnull).st_rdev == 0: + writemsg_level("Failed to validate a sane '/dev'.\n" + "'/dev/null' is not a device file.\n", + level=logging.ERROR, noiselevel=-1) + return 1 + except OSError: + writemsg_level("Failed to validate a sane '/dev'.\n" + "'/dev/null' does not exist.\n", + level=logging.ERROR, noiselevel=-1) + return 1 + # Portage needs to ensure a sane umask for the files it creates. os.umask(0o22) emerge_config = load_emerge_config(