You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2014/05/21 19:25:36 UTC

git commit: Added file permissions to open() call when O_CREAT is specified.

Repository: mesos
Updated Branches:
  refs/heads/master 6e0eb768c -> d4625174e


Added file permissions to open() call when O_CREAT is specified.

Review: https://reviews.apache.org/r/21778


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d4625174
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d4625174
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d4625174

Branch: refs/heads/master
Commit: d4625174ecf659a3b05976cb357a836951a8cf17
Parents: 6e0eb76
Author: Dominic Hamon <dh...@twopensource.com>
Authored: Wed May 21 10:25:23 2014 -0700
Committer: Vinod Kone <vi...@twitter.com>
Committed: Wed May 21 10:25:24 2014 -0700

----------------------------------------------------------------------
 src/slave/containerizer/mesos_containerizer.cpp | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d4625174/src/slave/containerizer/mesos_containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos_containerizer.cpp b/src/slave/containerizer/mesos_containerizer.cpp
index 9084082..d01d443 100644
--- a/src/slave/containerizer/mesos_containerizer.cpp
+++ b/src/slave/containerizer/mesos_containerizer.cpp
@@ -427,8 +427,11 @@ int execute(
   // when redirection is desired.
   if (redirectIO) {
     int fd;
-    while ((fd = open("stdout", O_CREAT | O_WRONLY | O_APPEND)) == -1 &&
-           errno == EINTR);
+    while ((fd = open(
+        "stdout",
+        O_CREAT | O_WRONLY | O_APPEND,
+        S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH)) == -1 &&
+            errno == EINTR);
     if (fd == -1) {
       ABORT("Failed to open stdout");
     }
@@ -443,8 +446,11 @@ int execute(
       ABORT("Failed to close stdout fd");
     }
 
-    while ((fd = open("stderr", O_CREAT | O_WRONLY | O_APPEND)) == -1 &&
-           errno == EINTR);
+    while ((fd = open(
+        "stderr",
+        O_CREAT | O_WRONLY | O_APPEND,
+        S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH)) == -1 &&
+            errno == EINTR);
     if (fd == -1) {
       ABORT("Failed to open stderr");
     }