You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2016/07/04 10:52:57 UTC

[1/2] mesos git commit: Used the `char` version of `strings::startsWith` in stout.

Repository: mesos
Updated Branches:
  refs/heads/master 932e6eb0d -> 854d8328f


Used the `char` version of `strings::startsWith` in stout.

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


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

Branch: refs/heads/master
Commit: 52d9ecda110880649b3d10d092514349f5f9a6d2
Parents: 932e6eb
Author: Michael Park <mp...@apache.org>
Authored: Sun Jul 3 19:36:40 2016 +0200
Committer: Michael Park <mp...@apache.org>
Committed: Mon Jul 4 02:36:28 2016 +0200

----------------------------------------------------------------------
 3rdparty/stout/include/stout/path.hpp | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/52d9ecda/3rdparty/stout/include/stout/path.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/path.hpp b/3rdparty/stout/include/stout/path.hpp
index 3d06ca2..d1092f6 100644
--- a/3rdparty/stout/include/stout/path.hpp
+++ b/3rdparty/stout/include/stout/path.hpp
@@ -64,11 +64,7 @@ inline std::string join(const std::vector<std::string>& paths)
 
 inline bool absolute(const std::string& path)
 {
-  if (path.empty() || path[0] != os::PATH_SEPARATOR) {
-    return false;
-  }
-
-  return true;
+  return strings::startsWith(path, os::PATH_SEPARATOR);
 }
 
 } // namespace path {


[2/2] mesos git commit: Used the `char` version of `strings::startsWith` in mesos.

Posted by mp...@apache.org.
Used the `char` version of `strings::startsWith` in mesos.

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


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

Branch: refs/heads/master
Commit: 854d8328fe7ca7cce329806147b0971a038392d3
Parents: 52d9ecd
Author: Michael Park <mp...@apache.org>
Authored: Sun Jul 3 19:37:02 2016 +0200
Committer: Michael Park <mp...@apache.org>
Committed: Mon Jul 4 02:36:48 2016 +0200

----------------------------------------------------------------------
 src/authentication/cram_md5/auxprop.cpp | 6 ++++--
 src/common/roles.cpp                    | 2 +-
 src/slave/containerizer/fetcher.cpp     | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/854d8328/src/authentication/cram_md5/auxprop.cpp
----------------------------------------------------------------------
diff --git a/src/authentication/cram_md5/auxprop.cpp b/src/authentication/cram_md5/auxprop.cpp
index 5912b01..8540341 100644
--- a/src/authentication/cram_md5/auxprop.cpp
+++ b/src/authentication/cram_md5/auxprop.cpp
@@ -18,6 +18,8 @@
 
 #include <mutex>
 
+#include <stout/strings.hpp>
+
 #include "logging/logging.hpp"
 
 // We need to disable the deprecation warnings as Apple has decided
@@ -125,7 +127,7 @@ int InMemoryAuxiliaryPropertyPlugin::initialize(
 
     // Skip properties that don't apply to this lookup given the flags.
     if (flags & SASL_AUXPROP_AUTHZID) {
-      if (name[0] == '*') {
+      if (strings::startsWith(name, '*')) {
         VLOG(1) << "Skipping auxiliary property '" << name
                 << "' since SASL_AUXPROP_AUTHZID == true";
         continue;
@@ -134,7 +136,7 @@ int InMemoryAuxiliaryPropertyPlugin::initialize(
       // Only consider properties that start with '*' if
       // SASL_AUXPROP_AUTHZID is not set but don't include the '*'
       // when looking up the property name.
-      if (name[0] != '*') {
+      if (!strings::startsWith(name, '*')) {
         VLOG(1) << "Skipping auxiliary property '" << name
                 << "' since SASL_AUXPROP_AUTHZID == false "
                 << "but property name starts with '*'";

http://git-wip-us.apache.org/repos/asf/mesos/blob/854d8328/src/common/roles.cpp
----------------------------------------------------------------------
diff --git a/src/common/roles.cpp b/src/common/roles.cpp
index 65c7193..017f8a6 100644
--- a/src/common/roles.cpp
+++ b/src/common/roles.cpp
@@ -65,7 +65,7 @@ Option<Error> validate(const string& role)
     return Error("Role name '.' is invalid");
   } else if (role == *dotdot) {
     return Error("Role name '..' is invalid");
-  } else if (role[0] == '-') {
+  } else if (strings::startsWith(role, '-')) {
     return Error("Role name '" + role + "' is invalid "
                  "because it starts with a dash");
   }

http://git-wip-us.apache.org/repos/asf/mesos/blob/854d8328/src/slave/containerizer/fetcher.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/fetcher.cpp b/src/slave/containerizer/fetcher.cpp
index 15ff61f..8545d98 100644
--- a/src/slave/containerizer/fetcher.cpp
+++ b/src/slave/containerizer/fetcher.cpp
@@ -163,7 +163,7 @@ Try<Nothing> Fetcher::validateOutputFile(const string& path)
 
   // TODO(mrbrowning): Check that the filename's directory component is
   // actually a subdirectory of the sandbox, not just relative to it.
-  if (path.at(0) == '/') {
+  if (strings::startsWith(path, '/')) {
     return Error("URI output file must be within the sandbox directory");
   }