Bug 455956 - ksambashare.cpp -- username regex is way too restrictive.
Summary: ksambashare.cpp -- username regex is way too restrictive.
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.95.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-26 14:55 UTC by Claus-Justus Heine
Modified: 2022-06-27 18:40 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Patch fixing the issue. (1.08 KB, patch)
2022-06-26 14:55 UTC, Claus-Justus Heine
Details

Note You need to log in before you can comment on or make changes to this bug.
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.