use references to srcmounts rather than copies

This commit is contained in:
Antonio SJ Musumeci 2016-01-29 16:54:39 -05:00
parent f7c37d2974
commit 6086620e23
49 changed files with 1050 additions and 717 deletions

View file

@ -35,19 +35,20 @@ int
_access(Policy::Func::Search searchFunc,
const vector<string> &srcmounts,
const size_t minfreespace,
const string &fusepath,
const char *fusepath,
const int mask)
{
int rv;
string path;
string fullpath;
vector<const string*> basepaths;
rv = searchFunc(srcmounts,fusepath,minfreespace,path);
rv = searchFunc(srcmounts,fusepath,minfreespace,basepaths);
if(rv == -1)
return -errno;
fs::path::append(path,fusepath);
fs::path::make(basepaths[0],fusepath,fullpath);
rv = ::eaccess(path.c_str(),mask);
rv = ::eaccess(fullpath.c_str(),mask);
return ((rv == -1) ? -errno : 0);
}