Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

PICARD-2960: Prevent dir separator replacement being set to dir separator #2541

Merged
merged 2 commits into from
Sep 1, 2024

Conversation

phw
Copy link
Member

@phw phw commented Sep 1, 2024

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

It must not be possible to configure the replacement for directory separators to be a separator itself.

Solution

Add a validator to the dir separator option input to disallow os.sep and os.altsep. Also validate on form close. While theoretically users can no longer configure this it can happen on upgrade and also when moving config from a platform without os.altsep (e.g. Linux) to one with (Windows where altsep is a backslash), or in general if separators differ between platforms.

@phw phw requested a review from zas September 1, 2024 10:51
@phw
Copy link
Member Author

phw commented Sep 1, 2024

I added a config upgrade hook to sanitize the option

Copy link
Collaborator

@zas zas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@phw phw merged commit e69dcb3 into metabrainz:master Sep 1, 2024
44 checks passed
@phw phw added the Bug fix label Sep 1, 2024
@phw phw deleted the fix-dir-separatir-replacement branch September 1, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants