niklasekstrom / a314

A314 is a family of expansions for Amiga computers that lets a Raspberry Pi (RPi) be used as a co-processor to the Amiga
Creative Commons Zero v1.0 Universal
255 stars 32 forks source link

Attempting to move directory into subdirectory of itself should be an error #55

Closed cnilsson closed 3 years ago

cnilsson commented 4 years ago

Using WB 2.1 and a directory structure of a/b/c you can drag a into c without any error message on a314fs. This triggers a 202 object in use error when done on other devices.

Fortunately Linux refuses to do the impossible move on a filesystem level.

It is up to ACTION_RENAME_OBJECT to not allow this:

In particular, the RENAME_OBJECT action allows moving files across directory bounds and as such must ensure that it doesn't create hidden directory loops by renaming a directory into a child of itself.