}
}
+ // drop any leading /
+ while (path.length() && path[0] == '/') {
+ path = path.substr(1);
+ }
+
for (auto& s: cap_auths) {
ldout(cct, 20) << __func__ << " auth match path " << s.match.path << " r: " << s.readable
<< " w: " << s.writeable << dendl;
return false;
}
+ // Make sure this function returns path with single leading '/'
+ if (path.length() && path[0] == '/' && path[1] == '/')
+ path = path.substr(1);
+
return true;
}
std::string path;
if (make_absolute_path_string(in, path)) {
ldout(cct, 20) << " absolute path: " << path << dendl;
- if (path.length())
- path = path.substr(1); // drop leading /
res = mds_check_access(path, perms, MAY_WRITE);
if (res) {
goto out;
std::string path;
if (make_absolute_path_string(in, path)) {
ldout(cct, 20) << __func__ << " absolute path: " << path << dendl;
- if (path.length())
- path = path.substr(1); // drop leading /
result = mds_check_access(path, perms, mask);
if (result) {
return result;