Skip to content

Relax the username regexp for SMB

Username regexp in src/core/ksambashare.cpp is extremely restrictive, only word characters are accepted which excudes things like firstname.lastname, or foo-bar for first_second.

According to

https://docs.microsoft.com/en-us/previous-versions//cc722458(v=technet.10)?redirectedfrom=MSDN

only " / \ [ ] : ; | = , + * ? < > are disallowed characters.

One probably additionally wants to exclude spaces.

The resulting regexp may look a little bit more complicated than the current \w, however, it really just replaces the \w by a negated character set match.

Merge request reports

Loading