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

Unified Diff: chrome/browser/zygote_main_linux.cc

Issue 155366: Linux: don't bother passing the chroot directory fd to the zygote. (Closed)
Patch Set: Created 11 years, 5 months 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 | sandbox/linux/suid/sandbox.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/zygote_main_linux.cc
diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc
index 9b8ef98bdc72a35a3283e52be75a258422df94fe..08f730ef8c1e9247c0337e424c38701cc4f39c97 100644
--- a/chrome/browser/zygote_main_linux.cc
+++ b/chrome/browser/zygote_main_linux.cc
@@ -221,29 +221,15 @@ static bool MaybeEnterChroot() {
}
char reply;
- std::vector<int> fds;
- if (!base::RecvMsg(fd, &reply, 1, &fds)) {
+ if (HANDLE_EINTR(read(fd, &reply, 1)) != 1) {
LOG(ERROR) << "Failed to read from chroot pipe: " << errno;
return false;
}
+
if (reply != kChrootMeSuccess) {
LOG(ERROR) << "Error code reply from chroot helper";
- for (size_t i = 0; i < fds.size(); ++i)
- HANDLE_EINTR(close(fds[i]));
- return false;
- }
- if (fds.size() != 1) {
- LOG(ERROR) << "Bad number of file descriptors from chroot helper";
- for (size_t i = 0; i < fds.size(); ++i)
- HANDLE_EINTR(close(fds[i]));
- return false;
- }
- if (fchdir(fds[0]) == -1) {
- LOG(ERROR) << "Failed to chdir to root directory: " << errno;
- HANDLE_EINTR(close(fds[0]));
return false;
}
- HANDLE_EINTR(close(fds[0]));
static const int kMagicSandboxIPCDescriptor = 5;
SkiaFontConfigUseIPCImplementation(kMagicSandboxIPCDescriptor);
« no previous file with comments | « no previous file | sandbox/linux/suid/sandbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698