Bug 498428 - Empty Share tab in Dolphin on non-local account
Summary: Empty Share tab in Dolphin on non-local account
Status: RESOLVED DUPLICATE of bug 467176
Alias: None
Product: kdenetwork-filesharing
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-09 13:40 UTC by Matthias Z
Modified: 2025-01-09 19:25 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Z 2025-01-09 13:40:24 UTC
SUMMARY
The "Share" tab in folder properties is empty preventing me from creating a samba share this way using a non-local login user.
When starting dolphin from the console the following error appears when switching to the "Share" tab:
> qrc:/org.kde.filesharing.samba/qml/main.qml:39: TypeError: Cannot read property 'inSamba' of null

To me it looks like the current user has no entry in userManager, which traces to usermanager.cpp::getUsersList() and therein line 47:
>const QStringList userNames = KUser::allUserNames();
not adding all user names, but likely only user names of local users.
Clearly at least the current user should always be part of a users listing (even if this user is non-local (e.g. via LDAP, Kerberos or MS Active Directory).
Which should prevent this bug, but the not listing of the current user in a allUserNames() function could cause problems at other places to.

SUGGESTED FIX:
In samba/filepropertiesplugin/usermanager.cpp::getUsersList()
- const QStringList userNames = KUser::allUserNames();
+ const QString currentUserName = KUser().loginName();
+ QStringList userNames = KUser::allUserNames();
+ if (!userNames.contains(currentUserName))
+   userNames.append(currentUserName);
or fix in KUser::allUserNames() (However, KUser seems to be archived)!
or follow this patch for samba/filepropertiesplugin/usermanager.cpp::load(): https://git.altlinux.org/tasks/archive/done/_295/302164/gears/100/git?p=git;a=blob;f=alt-share-under-domain-user.patch;h=e2baab57b2f2d1f7618c991bc904817a1e2e9f61;hb=b14e583fcde4c7f569f0c8c0de70f8d6e5ff7cbd

STEPS TO REPRODUCE
1. Open Dolphin in a KDE session of *non-local* user
2. Right click on a file or folder & Select "Properties"
3. Switch to tab "Share"

OBSERVED RESULT
The share tab is empty

EXPECTED RESULT
the share tab offers options to share the folder

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04.5
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
I believe this bug is likely the same underlying bug as these reports in differing setups or versions.
https://bugs.kde.org/show_bug.cgi?id=467176
https://bugs.kde.org/show_bug.cgi?id=469318
https://bugzilla-altlinux-org.translate.goog/show_bug.cgi?id=42703&_x_tr_sl=auto&_x_tr_tl=en
Comment 1 Harald Sitter 2025-01-09 14:11:56 UTC
getpwent (which is what this uses under the hood) should still enumerate users from remote resources if implemented correctly. That being said, your version is out of support from KDE so you should probably talk to Ubuntu instead.
Comment 2 Nate Graham 2025-01-09 17:10:51 UTC
*** This bug has been marked as a duplicate of bug 467176 ***
Comment 3 Matthias Z 2025-01-09 19:25:10 UTC
(In reply to Harald Sitter from comment #1)
> getpwent (which is what this uses under the hood) should still enumerate
> users from remote resources if implemented correctly. That being said, your
> version is out of support from KDE so you should probably talk to Ubuntu
> instead.

OK, sad to hear with the out of support since I current change to a newer release, but I understand. Kubuntu points to KDE for bug reports, but thanks.

Maybe as additional infos: 
- using a local user on the same system shows content in the tab as expected (e.g. note to setup samba user password).
- sssd is set to not enumerate (default and common recommendation due to otherwise taking too much time to show/display/fetch/resolve users(uid) and groups(gid) information)
Comment 4 Matthias Z 2025-01-09 19:25:52 UTC
(In reply to Nate Graham from comment #2)
> 
> *** This bug has been marked as a duplicate of bug 467176 ***

I would not have thought this a duplicate, as I am not having a systemd-homed, but a LDAP/Kerberos setup, with non-synced home (i.e.  (local home folder). Maybe an extension of bug 467176, however, I am happy to follow you classification.

Please consider transferring infos (e.g. affected version, generalization, suggestions etc) to the other bug as you see fit.