#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"
}
// 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;
*
* @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 {
: 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);
};