]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mds/MDSAuthCaps.h
update sources to v12.2.5
[ceph.git] / ceph / src / mds / MDSAuthCaps.h
index bb7d8f661034119999c5c462f17c732cee8eeb29..1061e93329347411dbba7f458f3d5131f3d7b5b4 100644 (file)
 #ifndef MDS_AUTH_CAPS_H
 #define MDS_AUTH_CAPS_H
 
-#include <vector>
-#include <string>
 #include <sstream>
+#include <string>
+#include <boost/utility/string_view.hpp>
+#include <vector>
+
 #include "include/types.h"
 #include "common/debug.h"
 
@@ -91,7 +93,7 @@ struct MDSCapMatch {
   }
 
   // check whether this grant matches against a given file and caller uid:gid
-  bool match(const std::string &target_path,
+  bool match(boost::string_view target_path,
             const int caller_uid,
             const int caller_gid,
             const vector<uint64_t> *caller_gid_list) const;
@@ -102,7 +104,7 @@ struct MDSCapMatch {
    *
    * @param target_path filesystem path without leading '/'
    */
-  bool match_path(const std::string &target_path) const;
+  bool match_path(boost::string_view target_path) const;
 };
 
 struct MDSCapGrant {
@@ -128,14 +130,14 @@ public:
     : cct(NULL), grants(grants_) { }
 
   void set_allow_all();
-  bool parse(CephContext *cct, const std::string &str, std::ostream *err);
+  bool parse(CephContext *cct, boost::string_view str, std::ostream *err);
 
   bool allow_all() const;
-  bool is_capable(const std::string &inode_path,
+  bool is_capable(boost::string_view inode_path,
                  uid_t inode_uid, gid_t inode_gid, unsigned inode_mode,
                  uid_t uid, gid_t gid, const vector<uint64_t> *caller_gid_list,
                  unsigned mask, uid_t new_uid, gid_t new_gid) const;
-  bool path_capable(const std::string &inode_path) const;
+  bool path_capable(boost::string_view inode_path) const;
 
   friend std::ostream &operator<<(std::ostream &out, const MDSAuthCaps &cap);
 };