MAY_READ = 4,
};
- int inode_permission(Inode *in, const UserPerm& perms, unsigned want);
int xattr_permission(Inode *in, const char *name, unsigned want,
const UserPerm& perms);
int may_setattr(Inode *in, struct ceph_statx *stx, int mask,
int mksnap(const char *path, const char *name, const UserPerm& perm);
int rmsnap(const char *path, const char *name, const UserPerm& perm);
+ // Inode permission checking
+ int inode_permission(Inode *in, const UserPerm& perms, unsigned want);
+
// expose caps
int get_caps_issued(int fd);
int get_caps_issued(const char *path, const UserPerm& perms);
static void fuse_ll_access(fuse_req_t req, fuse_ino_t ino, int mask)
{
- fuse_reply_err(req, 0);
+ CephFuse::Handle *cfuse = fuse_ll_req_prepare(req);
+ const struct fuse_ctx *ctx = fuse_req_ctx(req);
+ Inode *in = cfuse->iget(ino);
+ UserPerm perms(ctx->uid, ctx->gid);
+ get_fuse_groups(perms, req);
+
+ int r = cfuse->client->inode_permission(in, perms, mask);
+ fuse_reply_err(req, -r);
+ cfuse->iput(in);
}
static void fuse_ll_create(fuse_req_t req, fuse_ino_t parent, const char *name,