Start using std::filesystem::path for fusepath (#1522)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run

This commit is contained in:
trapexit 2025-09-17 23:51:16 -04:00 • committed by GitHub
parent f64ff9ca1e
commit 8c649d33ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
139 changed files with 1711 additions and 1663 deletions

View file

@ -14,6 +14,8 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "fuse_access.hpp"
#include "config.hpp"
#include "errno.hpp"
#include "fs_eaccess.hpp"
@ -23,48 +25,40 @@
#include <string>
#include <vector>
using std::string;
using std::vector;
namespace l
static
int
_access(const Policy::Search &searchFunc_,
const Branches &branches_,
const fs::path &fusepath_,
const int mask_)
{
static
int
access(const Policy::Search &searchFunc_,
const Branches &branches_,
const char *fusepath_,
const int mask_)
{
int rv;
string fullpath;
StrVec basepaths;
std::vector<Branch*> branches;
rv = searchFunc_(branches_,fusepath_,branches);
if(rv < 0)
return rv;
fullpath = fs::path::make(branches[0]->path,fusepath_);
rv = fs::eaccess(fullpath,mask_);
int rv;
StrVec basepaths;
fs::path fullpath;
std::vector<Branch*> branches;
rv = searchFunc_(branches_,fusepath_,branches);
if(rv < 0)
return rv;
}
fullpath = branches[0]->path / fusepath_;
rv = fs::eaccess(fullpath,mask_);
return rv;
}
namespace FUSE
int
FUSE::access(const char *fusepath_,
int mask_)
{
int
access(const char *fusepath_,
int mask_)
{
const fuse_context *fc = fuse_get_context();
const ugid::Set ugid(fc->uid,fc->gid);
const fs::path fusepath{fusepath_};
const fuse_context *fc = fuse_get_context();
const ugid::Set ugid(fc->uid,fc->gid);
return l::access(cfg.func.access.policy,
cfg.branches,
fusepath_,
mask_);
}
return ::_access(cfg.func.access.policy,
cfg.branches,
fusepath,
mask_);
}