[bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty #47
This commit is contained in:
parent
2ca2002423
commit
d09210d9c4
@ -39,16 +39,21 @@ auto directory_iterator::fill_buffer(const remote::file_offset &offset,
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
auto next_offset{offset + 1U};
|
||||||
|
|
||||||
std::string item_name;
|
std::string item_name;
|
||||||
struct stat st{};
|
struct stat st{};
|
||||||
struct stat *pst = nullptr;
|
struct stat *pst{nullptr};
|
||||||
|
|
||||||
switch (offset) {
|
switch (offset) {
|
||||||
case 0: {
|
case 0: {
|
||||||
item_name = ".";
|
item_name = ".";
|
||||||
|
next_offset = 0U;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 1: {
|
case 1: {
|
||||||
item_name = "..";
|
item_name = "..";
|
||||||
|
next_offset = 0U;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
@ -61,11 +66,11 @@ auto directory_iterator::fill_buffer(const remote::file_offset &offset,
|
|||||||
|
|
||||||
#if FUSE_USE_VERSION >= 30
|
#if FUSE_USE_VERSION >= 30
|
||||||
if (filler_function(buffer, item_name.data(), pst,
|
if (filler_function(buffer, item_name.data(), pst,
|
||||||
static_cast<off_t>(offset + 1),
|
static_cast<off_t>(next_offset),
|
||||||
FUSE_FILL_DIR_PLUS) != 0)
|
FUSE_FILL_DIR_PLUS) != 0)
|
||||||
#else // FUSE_USE_VERSION < 30
|
#else // FUSE_USE_VERSION < 30
|
||||||
if (filler_function(buffer, item_name.data(), pst,
|
if (filler_function(buffer, item_name.data(), pst,
|
||||||
static_cast<off_t>(offset + 1)) != 0)
|
static_cast<off_t>(next_offset)) != 0)
|
||||||
#endif // FUSE_USE_VERSION >= 30
|
#endif // FUSE_USE_VERSION >= 30
|
||||||
{
|
{
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
|
@ -1790,4 +1790,5 @@ auto remote_server::update_to_windows_format(const std::string &root_api_path,
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
} // namespace repertory::remote_fuse
|
} // namespace repertory::remote_fuse
|
||||||
|
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user