diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-02-02 18:31:38 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-02-02 18:31:38 +0100 |
commit | 7d8518f0af961cbfdcfa22c9e35a9233965ecd0a (patch) | |
tree | d034c43377b5875575f2a787c8bffa263557ecc1 | |
parent | edf36c5acd59b7059588efc10828ed420ba203a7 (diff) | |
download | gemato-7d8518f0af961cbfdcfa22c9e35a9233965ecd0a.tar.gz |
recursiveloader: Do not recur into directories when file was expected
When verifying, do not let os.walk() recur into a directory for which we
have an entry requesting it to be a file. The verification is going
to fail on the directory entry anyway, so there is no point in seeking
matches further and this could have currently resulted in crossing
filesystem boundaries (since the cross-fs test is deferred to verifying
thread).
-rw-r--r-- | gemato/recursiveloader.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gemato/recursiveloader.py b/gemato/recursiveloader.py index 6dd456c..815afbb 100644 --- a/gemato/recursiveloader.py +++ b/gemato/recursiveloader.py @@ -1,6 +1,6 @@ # gemato: Recursive loader for Manifests # vim:fileencoding=utf-8 -# (c) 2017 Michał Górny +# (c) 2017-2018 Michał Górny # Licensed under the terms of 2-clause BSD license import errno @@ -615,8 +615,11 @@ class ManifestRecursiveLoader(object): raise gemato.exceptions.ManifestCrossDevice(syspath) continue + # if we have an entry for the directory, it's either + # ignored, or is supposed to be a file -- in both + # cases, we want not to recur + skip_dirs.append(d) if de.tag == 'IGNORE': - skip_dirs.append(d) del dirdict[d] # skip scanning ignored directories |