mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-30 03:47:02 -05:00
Rework credential handling to support chroot & idmap (#1595)
Some checks are pending
mkdocs / deploy (push) Waiting to run
Some checks are pending
mkdocs / deploy (push) Waiting to run
Run in an elevated credential mode (root) and let the kernel manage entitlements. Will result in slightly different behavior but should not be noticed by most.
This commit is contained in:
parent
d8918458bf
commit
9b046d9a34
69 changed files with 788 additions and 1066 deletions
33
src/ugid.cpp
33
src/ugid.cpp
|
|
@ -1,33 +1,8 @@
|
|||
/*
|
||||
Copyright (c) 2016, Antonio SJ Musumeci <trapexit@spawn.link>
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "gidcache.hpp"
|
||||
|
||||
#if defined __linux__ and UGID_USE_RWLOCK == 0
|
||||
#include "ugid_linux.icpp"
|
||||
#else
|
||||
#include "ugid_rwlock.icpp"
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
namespace ugid
|
||||
{
|
||||
void
|
||||
initgroups(const uid_t uid_,
|
||||
const gid_t gid_)
|
||||
{
|
||||
GIDCache::initgroups(uid_,gid_);
|
||||
}
|
||||
thread_local uid_t currentuid = 0;
|
||||
thread_local gid_t currentgid = 0;
|
||||
thread_local bool initialized = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue