mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
make changing credentials opportunistic + per thread setgroups cache
closes #129,#131
This commit is contained in:
parent
b194272e39
commit
3163258a33
31 changed files with 380 additions and 168 deletions
11
src/link.cpp
11
src/link.cpp
|
|
@ -38,6 +38,7 @@
|
|||
using std::string;
|
||||
using std::vector;
|
||||
using mergerfs::Policy;
|
||||
using namespace mergerfs;
|
||||
|
||||
static
|
||||
int
|
||||
|
|
@ -64,7 +65,7 @@ _single_link(Policy::Func::Search searchFunc,
|
|||
return -1;
|
||||
|
||||
{
|
||||
const mergerfs::ugid::SetResetGuard ugid(0,0);
|
||||
const ugid::SetRootGuard ugidGuard;
|
||||
fs::clonepath(foundpath[0],base,newpathdir);
|
||||
}
|
||||
|
||||
|
|
@ -110,10 +111,10 @@ namespace mergerfs
|
|||
link(const char *from,
|
||||
const char *to)
|
||||
{
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const Config &config = Config::get(fc);
|
||||
const ugid::SetResetGuard ugid(fc->uid,fc->gid);
|
||||
const rwlock::ReadGuard readlock(&config.srcmountslock);
|
||||
const fuse_context *fc = fuse_get_context();
|
||||
const Config &config = Config::get(fc);
|
||||
const ugid::Set ugid(fc->uid,fc->gid);
|
||||
const rwlock::ReadGuard readlock(&config.srcmountslock);
|
||||
|
||||
return _link(config.getattr,
|
||||
config.link,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue