From 09279ada4112e9e8ea3c9d624e50b01e1b26aac0 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Fri, 12 May 2017 13:57:40 -0700 Subject: 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; --- find.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- cgit v1.2.3