]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "rgw: Support certain archaic and antiquated distributions"
authorKefu Chai <kchai@redhat.com>
Fri, 8 Dec 2017 05:40:29 +0000 (13:40 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 9 Jan 2018 09:29:08 +0000 (17:29 +0800)
This reverts commit af8d9bdf07ab97b9d9387f68ba0fedccce803073.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/rgw/rgw_iam_policy.cc
src/rgw/rgw_role.cc

index 97aaa3c7745357ef6e8d34bcb4fd7649cb747b4a..828399551cf562dabcfa650c6ff6f963dbae03b7 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <cstring>
 #include <iostream>
+#include <regex>
 #include <sstream>
 #include <stack>
 #include <utility>
@@ -26,7 +27,10 @@ using std::find;
 using std::int64_t;
 using std::move;
 using std::pair;
+using std::regex;
+using std::regex_match;
 using std::size_t;
+using std::smatch;
 using std::string;
 using std::stringstream;
 using std::ostream;
@@ -35,11 +39,11 @@ using std::uint64_t;
 using std::unordered_map;
 
 using boost::container::flat_set;
-using boost::regex;
-using boost::regex_constants::ECMAScript;
-using boost::regex_constants::optimize;
-using boost::regex_match;
-using boost::smatch;
+using std::regex;
+using std::regex_constants::ECMAScript;
+using std::regex_constants::optimize;
+using std::regex_match;
+using std::smatch;
 
 using rapidjson::BaseReaderHandler;
 using rapidjson::UTF8;
@@ -205,15 +209,13 @@ ARN::ARN(const rgw_bucket& b, const string& o)
 }
 
 boost::optional<ARN> ARN::parse(const string& s, bool wildcards) {
-  static const char str_wild[] = "arn:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)";
-  static const regex rx_wild(str_wild,
-                                   sizeof(str_wild) - 1,
-                                   ECMAScript | optimize);
-  static const char str_no_wild[]
-    = "arn:([^:*]*):([^:*]*):([^:*]*):([^:*]*):([^:*]*)";
-  static const regex rx_no_wild(str_no_wild,
-                               sizeof(str_no_wild) - 1,
-                               ECMAScript | optimize);
+  static const regex rx_wild("arn:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)",
+                            std::regex_constants::ECMAScript |
+                            std::regex_constants::optimize);
+  static const regex rx_no_wild(
+    "arn:([^:*]*):([^:*]*):([^:*]*):([^:*]*):([^:*]*)",
+    std::regex_constants::ECMAScript |
+    std::regex_constants::optimize);
 
   smatch match;
 
@@ -738,7 +740,8 @@ static boost::optional<Principal> parse_principal(CephContext* cct, TokenID t,
 
       static const char rx_str[] = "([^/]*)/(.*)";
       static const regex rx(rx_str, sizeof(rx_str) - 1,
-                           ECMAScript | optimize);
+                           std::regex_constants::ECMAScript |
+                           std::regex_constants::optimize);
       smatch match;
       if (regex_match(a->resource, match, rx) && match.size() == 3) {
        if (match[1] == "user") {
index 2b89e4f231d0ad2b76f343b733ed049efd594b9a..61dca85bd04247735f404c8a64b8458207b8830f 100644 (file)
@@ -1,7 +1,6 @@
 #include <errno.h>
 #include <ctime>
-
-#include <boost/regex.hpp>
+#include <regex>
 
 #include "common/errno.h"
 #include "common/Formatter.h"
@@ -377,14 +376,14 @@ bool RGWRole::validate_input()
     return false;
   }
 
-  boost::regex regex_name("[A-Za-z0-9:=,.@-]+");
-  if (! boost::regex_match(name, regex_name)) {
+  std::regex regex_name("[A-Za-z0-9:=,.@-]+");
+  if (! std::regex_match(name, regex_name)) {
     ldout(cct, 0) << "ERROR: Invalid chars in name " << dendl;
     return false;
   }
 
-  boost::regex regex_path("(/[!-~]+/)|(/)");
-  if (! boost::regex_match(path,regex_path)) {
+  std::regex regex_path("(/[!-~]+/)|(/)");
+  if (! std::regex_match(path,regex_path)) {
     ldout(cct, 0) << "ERROR: Invalid chars in path " << dendl;
     return false;
   }