fix
This commit is contained in:
parent
3c001c11ae
commit
bd25904371
@ -79,23 +79,31 @@ auto fuse_drive::chown_impl(std::string api_path, uid_t uid, gid_t gid,
|
|||||||
auto fuse_drive::chown_impl(std::string api_path, uid_t uid, gid_t gid)
|
auto fuse_drive::chown_impl(std::string api_path, uid_t uid, gid_t gid)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
#endif
|
#endif
|
||||||
return check_and_perform(api_path, X_OK,
|
return check_and_perform(
|
||||||
[&](api_meta_map &meta) -> api_error {
|
api_path, X_OK, [&](api_meta_map &meta) -> api_error {
|
||||||
meta.clear();
|
meta.clear();
|
||||||
if (uid != static_cast<uid_t>(-1)) {
|
if (uid != static_cast<uid_t>(-1)) {
|
||||||
meta[META_UID] = std::to_string(uid);
|
if (get_effective_uid() != 0) {
|
||||||
}
|
return api_error::permission_denied;
|
||||||
|
}
|
||||||
|
meta[META_UID] = std::to_string(uid);
|
||||||
|
}
|
||||||
|
|
||||||
if (gid != static_cast<gid_t>(-1)) {
|
if (gid != static_cast<gid_t>(-1)) {
|
||||||
meta[META_GID] = std::to_string(gid);
|
if (get_effective_uid() != 0) {
|
||||||
}
|
if (not utils::is_uid_member_of_group(get_effective_uid(), gid)) {
|
||||||
|
return api_error::permission_denied;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
meta[META_GID] = std::to_string(gid);
|
||||||
|
}
|
||||||
|
|
||||||
if (not meta.empty()) {
|
if (not meta.empty()) {
|
||||||
return provider_.set_item_meta(api_path, meta);
|
return provider_.set_item_meta(api_path, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
return api_error::success;
|
return api_error::success;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive::create_impl(std::string api_path, mode_t mode,
|
auto fuse_drive::create_impl(std::string api_path, mode_t mode,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user