Bug 455959 - ksambashare.cpp -- parse() fails on output of "net usershare info"
Summary: ksambashare.cpp -- parse() fails on output of "net usershare info"
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.95.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-26 17:12 UTC by Claus-Justus Heine
Modified: 2022-06-27 18:39 UTC (History)
3 users (show)

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


Attachments
Patch to remove trailing comma of "net usershare info" output (862 bytes, patch)
2022-06-26 17:12 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 17:12:30 UTC
Created attachment 150167 [details]
Patch to remove trailing comma of "net usershare info" output

SUMMARY

At least Samba version >=4.14.12 and <=4.16.2 generate a trailing comma with "net usershare info" like so:

claus@anaxagoras /usr/local/storage/a/samba/public $ net usershare info
[scanbox]
usershare_acl=ANAXAGORAS\claus:R,Everyone:R,ANAXAGORAS\scanner-upload:F,

OTOH, "net usershare add" does not accept a trailing comma as input and generates an error message:

  net usershare add: malformed acl  (missing ':').

STEPS TO REPRODUCE
1. Use the sharing dialog for some local file with an existing share
2. Do something which triggers an error (e.g. use an unsupported user-name like "foo-bar", see #455956 )
3. Try to apply the changes. The error messages of e.g. Dolphin will show something like 
"malformed acl  (missing ':')." and the ACLs are also not updated.

OBSERVED RESULT

Saving ACLs fails.

EXPECTED RESULT

Saving ACLs  works.

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.
Comment 1 Andreas Sturmlechner 2022-06-27 08:03:07 UTC
I'm not sure this isn't something only to be fixed in samba then...

...but, if you want your patch to get looked at, create an MR over at https://invent.kde.org/frameworks/kio instead.