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 EAF7A138332 for ; Tue, 9 Jan 2018 02:00:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 53CDCE08EF; Tue, 9 Jan 2018 02:00:04 +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 31240E08EF for ; Tue, 9 Jan 2018 02:00:04 +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 46ECA341065 for ; Mon, 8 Jan 2018 12:33:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9131F1AB for ; Mon, 8 Jan 2018 12:33:34 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1515414747.604df91aa544b65a6630b281b8a91d811c24e3f6.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: main.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 604df91aa544b65a6630b281b8a91d811c24e3f6 X-VCS-Branch: master Date: Mon, 8 Jan 2018 12:33:34 +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: 8a37cccb-bd55-4d2b-b050-a1d177ab340d X-Archives-Hash: 0d61af26ff1dff7a239419b2eba41a32 commit: 604df91aa544b65a6630b281b8a91d811c24e3f6 Author: Matthew White inventati org> AuthorDate: Sun Jan 7 06:10:01 2018 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Mon Jan 8 12:32:27 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=604df91a read_repos_conf: reject ~ postfixed files (aka backup files) * main.c (read_repos_conf): Exclude backup files (aka files with ~ as postfix) from processing when reading the repos_conf directory. The old behaviour was to process any file found in repos_conf (i.e. /etc/portage/repos.conf/*), except those beginning with '.'. This meant that '.', '..', and '.file' are rejected, but 'file.conf~' is accepted. Since 'file.conf~' is a backup file, by default it should rather not be processed. Bug: https://bugs.gentoo.org/643820 Signed-off-by: Fabian Groffen gentoo.org> main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.c b/main.c index b118ab8..b11fe83 100644 --- a/main.c +++ b/main.c @@ -513,6 +513,10 @@ read_repos_conf(const char *configroot, const char *repos_conf) if (name[0] == '.') continue; + /* Exclude backup files (aka files with ~ as postfix). */ + if (name[0] != '\0' && name[strlen(name) - 1] == '~') + continue; + #ifdef DT_UNKNOWN if (confs[i]->d_type != DT_UNKNOWN && confs[i]->d_type != DT_REG &&