Bug 455956

Summary: ksambashare.cpp -- username regex is way too restrictive.
Product: [Frameworks and Libraries] frameworks-kio Reporter: Claus-Justus Heine <himself>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null, nate
Priority: NOR    
Version First Reported In: 5.95.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Patch fixing the issue.

Description Claus-Justus Heine 2022-06-26 14:55:53 UTC
Created attachment 150163 [details]
Patch fixing the issue.

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

According

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

only " / \ [ ] : ; | = , + * ? < > are disallowed characters. The attached patch tries to fix this.

STEPS TO REPRODUCE
1. Add a user to the system and Samba with a "special" character, like foo.bar
2. Try to create a Samba-share in e.g. Dolphin
3. This will fail, as the generated regexp does not pass KSambaSharePrivate::isAclValid()

OBSERVED RESULT

Share is not updated 

EXPECTED RESULT

Share is updated

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo / X11
KDE Plasma Version:  5.25.1
KDE Frameworks Version:  5.95.0
Qt Version:  5.18.6

ADDITIONAL INFORMATION
The bug is  still present in the master branch.