Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[FL-3662] Do not remove file when renaming to itself #3193

Merged
merged 9 commits into from
Nov 15, 2023

Conversation

gsurkov
Copy link
Member

@gsurkov gsurkov commented Nov 3, 2023

What's new

  • Enchanced checks for storage_common_remove() function.
  • Add storage_common_equivalent_path() function.
  • Renaming a file to itself always succeeds.
  • Renaming a directory to itself or to a subdirectory of itself always fails.
  • Overwriting a regular file with a directory always fails.
  • Per-storage support for different case behaviour.
  • Update storage.h docs.

Verification

  1. Access Flipper's filesystem via an RPC client.
  2. Try renaming a directory to the name of an already existing file. The operation should fail with FSE_INVALID_NAME error.
  3. Repeat step 2, but change the case of some characters in the name. The result should be the same.
  4. Try renaming a directory to the same name. The operation should fail with FSE_INVALID_NAME error.
  5. Same as step 3, but in relation to step 4.
  6. Try renaming a file to the same name. The operation should succeed.
  7. Same as step 3, but in relation to step 6.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

Copy link

github-actions bot commented Nov 3, 2023

Compiled f7 firmware for commit 3d78e7f0:

@hedger hedger added Bug Core+Services HAL, furi & core system services labels Nov 8, 2023
@gsurkov gsurkov marked this pull request as ready for review November 9, 2023 14:39
@skotopes skotopes merged commit ba07406 into dev Nov 15, 2023
@skotopes skotopes deleted the gsurkov/3662_rename_to_itself branch November 15, 2023 08:56
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug Core+Services HAL, furi & core system services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants