diff options
author | Matthew White <mehw.is.me@inventati.org> | 2018-01-07 07:10:01 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2018-01-08 13:32:27 +0100 |
commit | 604df91aa544b65a6630b281b8a91d811c24e3f6 (patch) | |
tree | 2e80563caa29e9efe5f0a493ac36533d31cce7ef | |
parent | README: mention the configure alternative (diff) | |
download | portage-utils-604df91aa544b65a6630b281b8a91d811c24e3f6.tar.gz portage-utils-604df91aa544b65a6630b281b8a91d811c24e3f6.tar.bz2 portage-utils-604df91aa544b65a6630b281b8a91d811c24e3f6.zip |
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 <grobian@gentoo.org>
-rw-r--r-- | main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 && |