Browse Source

elevate privileges when calling clonepath. closes #41

pull/42/head
Antonio SJ Musumeci 10 years ago
parent
commit
c2cbb93c25
  1. 3
      src/create.cpp
  2. 4
      src/link.cpp
  3. 3
      src/mkdir.cpp
  4. 3
      src/mknod.cpp

3
src/create.cpp

@ -70,7 +70,10 @@ _create(const fs::SearchFunc searchFunc,
return -errno; return -errno;
if(createpath[0].base != existingpath[0].base) if(createpath[0].base != existingpath[0].base)
{
const mergerfs::ugid::SetResetGuard ugid(0,0);
fs::clonepath(existingpath[0].base,createpath[0].base,dirname); fs::clonepath(existingpath[0].base,createpath[0].base,dirname);
}
path = fs::make_path(createpath[0].base,fusepath); path = fs::make_path(createpath[0].base,fusepath);

4
src/link.cpp

@ -73,7 +73,11 @@ _link(const fs::SearchFunc searchFunc,
fs::find::ffwp(srcmounts,todir,topaths); fs::find::ffwp(srcmounts,todir,topaths);
if(topaths.size() > 0) if(topaths.size() > 0)
{ {
{
const mergerfs::ugid::SetResetGuard ugid(0,0);
fs::clonepath(topaths[0].base,i->base,todir); fs::clonepath(topaths[0].base,i->base,todir);
}
lrv = ::link(pathfrom.c_str(),pathto.c_str()); lrv = ::link(pathfrom.c_str(),pathto.c_str());
} }
} }

3
src/mkdir.cpp

@ -64,7 +64,10 @@ _mkdir(const fs::SearchFunc searchFunc,
rv = createPathFunc(srcmounts,dirname,createpath); rv = createPathFunc(srcmounts,dirname,createpath);
if(createpath[0].base != existingpath[0].base) if(createpath[0].base != existingpath[0].base)
{
const mergerfs::ugid::SetResetGuard ugid(0,0);
fs::clonepath(existingpath[0].base,createpath[0].base,dirname); fs::clonepath(existingpath[0].base,createpath[0].base,dirname);
}
path = fs::make_path(createpath[0].base,fusepath); path = fs::make_path(createpath[0].base,fusepath);

3
src/mknod.cpp

@ -66,7 +66,10 @@ _mknod(const fs::SearchFunc searchFunc,
createPathFunc(srcmounts,dirname,createpath); createPathFunc(srcmounts,dirname,createpath);
if(existingpath[0].base != createpath[0].base) if(existingpath[0].base != createpath[0].base)
{
const mergerfs::ugid::SetResetGuard ugid(0,0);
fs::clonepath(existingpath[0].base,createpath[0].base,dirname); fs::clonepath(existingpath[0].base,createpath[0].base,dirname);
}
path = fs::make_path(createpath[0].base,fusepath); path = fs::make_path(createpath[0].base,fusepath);

Loading…
Cancel
Save