Index: sandbox/linux/services/credentials.cc |
diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc |
index cea757c535860c0d1c12d4d7fbb479b848d6bef4..3ce140480f5e590939f953f0b517a3252f5034b4 100644 |
--- a/sandbox/linux/services/credentials.cc |
+++ b/sandbox/linux/services/credentials.cc |
@@ -163,9 +163,13 @@ bool Credentials::HasOpenDirectory(int proc_fd) { |
} else { |
proc_self_fd = openat(AT_FDCWD, "/proc/self/fd", O_DIRECTORY | O_RDONLY); |
if (proc_self_fd < 0) { |
+ // If this process has been chrooted (eg into /proc/self/fdinfo) then |
+ // the new root dir will not have directory listing permissions for us |
+ // (hence EACCES). And if we do have this permission, then /proc won't |
+ // exist anyway (hence ENOENT). |
+ CHECK(errno == EACCES || errno == ENOENT); |
jln (very slow on Chromium)
2013/11/27 21:26:15
Do you want to make this a DPCHECK instead?
DCHEC
Mostyn Bramley-Moore
2013/11/28 09:35:32
Done.
|
+ |
// If not available, guess false. |
- // TODO(mostynb@opera.com): add a CHECK_EQ(ENOENT, errno); Figure out what |
- // other situations are here. http://crbug.com/314985 |
return false; |
} |
} |