Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Issue with special characters #9

Description

@GigiusB

Unfortunately complicated passwords may contain special charcaters that need escaping.

Most of all if the password contains ":" then there regex will fail.

I suggest changing it from PATTERN = re.compile(r'^(.*):(.*):(.*):(.*):(.*)$', re.MULTILINE)
to: PATTERN = re.compile(r'^([^:\n]*):([^:\n]*):([^:\n]*):([^:\n]*):([^\n]*)$', re.MULTILINE)

However in addition to ":" and "" I also found "," that will need escaping.

So I'd suggest to add the following to the _sanitize_str method...
.replace(r',', ',').replace('\\', '\')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions