| 9242 | } |
| 9243 | |
| 9244 | int Client::fchmod(int fd, mode_t mode, const UserPerm& perms) |
| 9245 | { |
| 9246 | RWRef_t mref_reader(mount_state, CLIENT_MOUNTING); |
| 9247 | if (!mref_reader.is_state_satisfied()) |
| 9248 | return -ENOTCONN; |
| 9249 | |
| 9250 | tout(cct) << __func__ << std::endl; |
| 9251 | tout(cct) << fd << std::endl; |
| 9252 | tout(cct) << mode << std::endl; |
| 9253 | |
| 9254 | std::scoped_lock lock(client_lock); |
| 9255 | Fh *f = get_filehandle(fd); |
| 9256 | if (!f) |
| 9257 | return -EBADF; |
| 9258 | #if defined(__linux__) && defined(O_PATH) |
| 9259 | if (f->flags & O_PATH) |
| 9260 | return -EBADF; |
| 9261 | #endif |
| 9262 | struct stat attr; |
| 9263 | attr.st_mode = mode; |
| 9264 | return _setattr(f->inode, &attr, CEPH_SETATTR_MODE, perms); |
| 9265 | } |
| 9266 | |
| 9267 | int Client::chmodat(int dirfd, const char *relpath, mode_t mode, int flags, |
| 9268 | const UserPerm& perms) { |