mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bmah...@apache.org
Subject mesos git commit: Fixed dangerous use of Subprocess::PIPE as default Docker::run IO.
Date Sat, 02 Jul 2016 01:55:43 GMT
Repository: mesos
Updated Branches:
  refs/heads/master 7a56f57b2 -> ac1b43b13


Fixed dangerous use of Subprocess::PIPE as default Docker::run IO.

Docker::run used Subprocess::PIPE as defaults for stdout and stderr,
however the caller cannot obtain the read end of the pipe in order
to read and avoid blocking the child. Also, internally these pipes
are not read. This means the child process can block!

For now, this changes the default to match stdout and stderr from
the parent process. Ideally, we also prevent the caller from using
Subprocess::PIPE since they cannot obtain the read end.

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


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

Branch: refs/heads/master
Commit: ac1b43b13c1c22c9d5d7040466735efa31673db8
Parents: 7a56f57
Author: Benjamin Mahler <bmahler@apache.org>
Authored: Fri Jul 1 17:11:06 2016 -0700
Committer: Benjamin Mahler <bmahler@apache.org>
Committed: Fri Jul 1 18:55:34 2016 -0700

----------------------------------------------------------------------
 src/docker/docker.hpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/ac1b43b1/src/docker/docker.hpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.hpp b/src/docker/docker.hpp
index 4343213..c63db40 100644
--- a/src/docker/docker.hpp
+++ b/src/docker/docker.hpp
@@ -130,8 +130,10 @@ public:
       const std::string& mappedDirectory,
       const Option<mesos::Resources>& resources = None(),
       const Option<std::map<std::string, std::string>>& env = None(),
-      const process::Subprocess::IO& _stdout = process::Subprocess::PIPE(),
-      const process::Subprocess::IO& _stderr = process::Subprocess::PIPE())
+      const process::Subprocess::IO& _stdout =
+        process::Subprocess::FD(STDOUT_FILENO),
+      const process::Subprocess::IO& _stderr =
+        process::Subprocess::FD(STDERR_FILENO))
     const;
 
   // Returns the current docker version.


Mime
View raw message