From 13b2ee6f7a815a2d6e3d4585995c5cd3a4677a71 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 16 Apr 2025 10:35:16 -0500 Subject: [PATCH] [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47 --- .../src/drives/fuse/remotefuse/remote_server.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp b/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp index d49f547e..07dbba36 100644 --- a/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp +++ b/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp @@ -1757,10 +1757,10 @@ auto remote_server::update_to_windows_format(const std::string &root_api_path, auto attributes = utils::string::to_uint32( item[JSON_META][META_ATTRIBUTES].get()); - if (item[JSON_DIRECTORY].get()) { + if (utils::string::to_bool(item[JSON_DIRECTORY].get())) { if ((attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) { attributes |= FILE_ATTRIBUTE_DIRECTORY; - attributes &= (~FILE_ATTRIBUTE_ARCHIVE); + attributes &= static_cast(~FILE_ATTRIBUTE_ARCHIVE); item[JSON_META][META_ATTRIBUTES] = std::to_string(attributes); update_meta = true; } @@ -1768,7 +1768,7 @@ auto remote_server::update_to_windows_format(const std::string &root_api_path, FILE_ATTRIBUTE_DIRECTORY || attributes == 0U) { attributes |= FILE_ATTRIBUTE_ARCHIVE; - attributes &= (~FILE_ATTRIBUTE_DIRECTORY); + attributes &= static_cast(~FILE_ATTRIBUTE_DIRECTORY); item[JSON_META][META_ATTRIBUTES] = std::to_string(attributes); update_meta = true; }