Repository: mesos
Updated Branches:
  refs/heads/master bf65c7426 -> df05e921a


Fixed environment overwrite warning to not leak possibly sensitive data.

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


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

Branch: refs/heads/master
Commit: df05e921a98af42caab7cc144b97700cefa72a31
Parents: bf65c74
Author: Till Toenshoff <[email protected]>
Authored: Fri Mar 24 06:55:46 2017 +0100
Committer: Alexander Rukletsov <[email protected]>
Committed: Fri Mar 24 06:55:46 2017 +0100

----------------------------------------------------------------------
 src/slave/containerizer/mesos/launch.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/df05e921/src/slave/containerizer/mesos/launch.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launch.cpp 
b/src/slave/containerizer/mesos/launch.cpp
index 8658525..715500d 100644
--- a/src/slave/containerizer/mesos/launch.cpp
+++ b/src/slave/containerizer/mesos/launch.cpp
@@ -653,6 +653,10 @@ int MesosContainerizerLaunch::execute()
   // specified, inherit the environment of the current process.
   Option<os::raw::Envp> envp;
   if (launchInfo.has_environment()) {
+    // TODO(tillt): `Environment::Variable` is not a string anymore,
+    // consider cleaning this up with the complete rollout of `Secrets`.
+    // This entire merging should be handled by the solution introduced
+    // by MESOS-7299.
     hashmap<string, string> environment;
 
     foreach (const Environment::Variable& variable,
@@ -660,10 +664,10 @@ int MesosContainerizerLaunch::execute()
       const string& name = variable.name();
       const string& value = variable.value();
 
-      if (environment.contains(name)) {
-        cout << "Overwriting environment variable '" << name
-             << "', original: '" << environment[name]
-             << "', new: '" << value << "'" << endl;
+      // TODO(tillt): Once we have a solution for MESOS-7292, allow
+      // logging of values.
+      if (environment.contains(name) && environment[name] != value) {
+        cout << "Overwriting environment variable '" << name << "'" << endl;
       }
 
       environment[name] = value;

Reply via email to