req->dentry_unless = CEPH_CAP_FILE_EXCL;
bufferlist xattrs_bl;
- int res = _posix_acl_create(dir, &mode, xattrs_bl, perms.uid(), perms.gid());
+ int res = _posix_acl_create(dir, &mode, xattrs_bl, perms);
if (res < 0)
goto fail;
req->head.args.mknod.mode = mode;
mode |= S_IFREG;
bufferlist xattrs_bl;
- int res = _posix_acl_create(dir, &mode, xattrs_bl, perms.uid(), perms.gid());
+ int res = _posix_acl_create(dir, &mode, xattrs_bl, perms);
if (res < 0)
goto fail;
req->head.args.open.mode = mode;
mode |= S_IFDIR;
bufferlist xattrs_bl;
- int res = _posix_acl_create(dir, &mode, xattrs_bl, perm.uid(), perm.gid());
+ int res = _posix_acl_create(dir, &mode, xattrs_bl, perm);
if (res < 0)
goto fail;
req->head.args.mkdir.mode = mode;
}
int Client::_posix_acl_create(Inode *dir, mode_t *mode, bufferlist& xattrs_bl,
- int uid, int gid)
+ const UserPerm& perms)
{
if (acl_type == NO_ACL)
return 0;
if (S_ISLNK(*mode))
return 0;
- int r = _getattr(dir, CEPH_STAT_CAP_XATTR, uid, gid, dir->xattr_version == 0);
+ int r = _getattr(dir, CEPH_STAT_CAP_XATTR, perms.uid(), perms.gid(), dir->xattr_version == 0);
if (r < 0)
goto out;
void _release_filelocks(Fh *fh);
void _update_lock_state(struct flock *fl, uint64_t owner, ceph_lock_state_t *lock_state);
- int _posix_acl_create(Inode *dir, mode_t *mode, bufferlist& xattrs_bl, int uid, int gid);
+ int _posix_acl_create(Inode *dir, mode_t *mode, bufferlist& xattrs_bl,
+ const UserPerm& perms);
int _posix_acl_chmod(Inode *in, mode_t mode, const UserPerm& perms);
int _posix_acl_permission(Inode *in, uid_t uid, UserGroups& groups, unsigned want);