mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-02-08 21:48:26 +00:00
Do not allow renaming to a non-empty directory (#1604)
Found via pjdfstests. References #1589.
This commit is contained in:
parent
9645d57c05
commit
3663082a01
@ -1545,6 +1545,9 @@ static int s3fs_rename(const char* _from, const char* _to)
|
|||||||
if(0 != (result = get_object_attribute(from, &buf, NULL))){
|
if(0 != (result = get_object_attribute(from, &buf, NULL))){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
if(0 != (result = directory_empty(to))){
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// flush pending writes if file is open
|
// flush pending writes if file is open
|
||||||
{ // scope for AutoFdEntity
|
{ // scope for AutoFdEntity
|
||||||
|
Loading…
x
Reference in New Issue
Block a user