Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(691)

Unified Diff: sandbox/linux/services/credentials.cc

Issue 59763014: DPCHECK known conditions when we guess false in CurrentProcessHasOpenDirectories (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trying to work around a rietveld bug(?) Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698