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 8E6731396D9 for ; Mon, 20 Nov 2017 18:44:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E3308E0F54; Mon, 20 Nov 2017 18:44:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 C19E4E0F54 for ; Mon, 20 Nov 2017 18:44:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 D562C33FE7D for ; Mon, 20 Nov 2017 18:44:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 78D349AFF for ; Mon, 20 Nov 2017 18:44:47 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1511203080.b4a444819986e6f4d987ec746dc00508190f1e3c.mgorny@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/manifest.py X-VCS-Directories: pym/portage/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: b4a444819986e6f4d987ec746dc00508190f1e3c X-VCS-Branch: master Date: Mon, 20 Nov 2017 18:44:47 +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: 7b671e47-4501-4cd3-b697-33939cfbc86e X-Archives-Hash: d82263bbf1df9ac49b7415400c69f2a8 commit: b4a444819986e6f4d987ec746dc00508190f1e3c Author: Michał Górny gentoo org> AuthorDate: Sun Nov 19 16:56:50 2017 +0000 Commit: Michał Górny gentoo org> CommitDate: Mon Nov 20 18:38:00 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b4a44481 portage.manifest: Fix mis-parsing Manifests with numerical checksums Fix the regular expression used to parse Manifests not to fail horribly when one of the checksums accidentally happens to be all-digits. The previously used regular expression used to greedily take everything up to the first number as filename. If one of the checksums happened to be purely numeric, this meant that everything up to that checksum was taken as filename, and the checksum itself was taken as file size. It was also capable of accepting an empty filename. The updated regular expression uses '\S+' to match filenames. Therefore, the match is terminated on first whitespace character and filenames can no longer contain spaces. Not that it could ever work reliably. Spotted by Ulrich Müller. Bug: https://bugs.gentoo.org/638148 Reviewed-by: Zac Medico gentoo.org> pym/portage/manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pym/portage/manifest.py b/pym/portage/manifest.py index 4ec20515e..4bca61e86 100644 --- a/pym/portage/manifest.py +++ b/pym/portage/manifest.py @@ -30,7 +30,7 @@ from portage.const import (MANIFEST2_HASH_DEFAULTS, MANIFEST2_IDENTIFIERS) from portage.localization import _ _manifest_re = re.compile( - r'^(' + '|'.join(MANIFEST2_IDENTIFIERS) + r') (.*)( \d+( \S+ \S+)+)$', + r'^(' + '|'.join(MANIFEST2_IDENTIFIERS) + r') (\S+)( \d+( \S+ \S+)+)$', re.UNICODE) if sys.hexversion >= 0x3000000: