aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2017-05-12 13:57:40 -0700
committerDan Willemsen <dwillemsen@google.com>2017-05-12 14:02:00 -0700
commit09279ada4112e9e8ea3c9d624e50b01e1b26aac0 (patch)
treed92879f42ee8529ed4bba6c70439680d93b683f9
parentc76b9f146a7307cff56fc40269c030d473901b2f (diff)
Ignore EACCES during find emulator opendir
In addition to the race conditions that led me to whitelist ENOENT when we're initializing the find emulator, also whitelist EACCES. The reported usecase was when two users are using the same source directory, but compiling into two out directories under the same source directory. The permissions were set up so that they didn't have access to each others out directories, so kati would get permission denied errors. Test: mkdir -p out2/a; sudo chown nobody:nobody out2/a; <run>
-rw-r--r--find.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/find.cc b/find.cc
index c6a4155..6712923 100644
--- a/find.cc
+++ b/find.cc
@@ -918,7 +918,7 @@ class FindEmulatorImpl : public FindEmulator {
DirentNode* ConstructDirectoryTree(const string& path) {
DIR* dir = opendir(path.empty() ? "." : path.c_str());
if (!dir) {
- if (errno == ENOENT) {
+ if (errno == ENOENT || errno == EACCES) {
LOG("opendir failed: %s", path.c_str());
return NULL;
} else {