#109 Consider installing kdenetwork-filesharing + deps by default
Opened 2 years ago by ngraham. Modified 6 months ago

This package provides the user-facing UI to create Samba shares. Without it, there's no GUI way to do so, nor an indication that it's possible. I would recommend installing this package and its dependencies by default.


Metadata Update from @ngompa:
- Issue set to the milestone: Fedora 35
- Issue tagged with: experience, meeting

2 years ago

That's what I've been missing in the EPEL kde!
First - I second the motion to add it to the default packages.
Second - I'm adding it to my EPEL kde packages. (And building it right now)

@ngraham Other than kdenetwork-filesharing, are there any other packages we need to add?

Its dependencies:

samba
samba-libs
samba-common-tools

Do we need samba (the Samba filesharing service) or samba-client (the Samba client software)?

EDIT: Oh, this is for creating Samba shares, so yes, we need samba.

@thunderbirdtr reports that just installing this is not enough to make it work, as it throws errors about not having permissions to share folders. We'll investigate it and figure out how make it work, and then preload it.

Metadata Update from @ngompa:
- Issue set to the milestone: Fedora 36 (was: Fedora 35)

2 years ago

Metadata Update from @ngompa:
- Issue untagged with: meeting

2 years ago

Metadata Update from @ngompa:
- Issue assigned to marcdeop

2 years ago

Metadata Update from @ngompa:
- Issue set to the milestone: Plasma 5.23 (was: Fedora 36)

2 years ago

Ah yes. That message means that the user is not in the correct group to be able to manage Samba shares. The code has a UI to add the user to the group if this is listed as possible, but only system I see that the UI does not appear. The code wants the required group for managing Samba shares to NOT be root and to contain the text samba. Does Fedora require root access for this?

I think @gd, @asn, or @abbra would know more here, but I think we don't run the Samba services under a samba user? At least I don't see anything of that nature in the Samba packaging...

Samba runs under root and it is intentionally done so because it needs to switch between root and specific user identity all the time as Samba processes handle multiple connections.

Whatever kdenetwork-filesharing defines, is not really coordinated with Samba Team upstream.

Briefly checked that package on f34 and yes this allows to control usershares which are shares controlled by non-root users. Just by follwing the pre-requisites regarding usershares documented in smb.conf.5 manpage and starting smbd I could perfectly create usershares as non-root user while samba's smbd was started as root initially.

So this is about setting up usershares feature -- it means that users allowed to do it would need a write access to a directory where usershares will be stored. Samba itself does not provide any directory for that (smb.conf(5) example uses /usr/local/samba/lib/usershares but that is just random) and does not really care -- as long as the directory mentioned in usershare path option in smb.conf is writable by the user, it will be good enough to manage those shares.

So I guess this package made own choices on what should be used for the group and where to store those shares. It has nothing to do with samba package decisions and can be defined by yourself.

I would recommend using a name that is clear to point that it is coming from KDE setup. In case we'd use samba group for something more system-specific in Samba, it would not conflict with this use by KDE.

Just to let people know, I mis-understood what this package did. I assumed it was allowing you to SEE samba fileshares, while in reality it allows you to SHARE samba fileshares.
As such, I am not as enthusiastic about it being installed by default.
I'm not against it being installed by default, I'm neutral.
But I have added it to my list of KDE packages in EPEL, and built it for EPEL8 and EPEL8-next.

Yeah for this package to actually be useful if installed by default, the default samba configuration in Fedora would need some tweaks first so the user doesn't need to edit system files. See https://bugzilla.redhat.com/show_bug.cgi?id=2096405

We have two problems:
1. SELinux. All Samba shares must have the correct security context, because SELinux won't allow Samba daemon access without it.
2. Samba configuration file. Only root can change /etc/samba/smb.conf for security reasons.

I see two options for how we can fix this:
1. We can create a special daemon with D-Bus API. It will be able to configure smb.conf and set the correct SELinux context.
2. We can do the same as GNOME: create a new Public directory in $HOME and add it to both /etc/samba/smb.conf and SELinux.

https://bugzilla.redhat.com/show_bug.cgi?id=2096405 was implemented, so now on the KDE SIG side, what we can do is install the new samba-usershare package by default.

So adding samba-usershare and kdenetwork-filesharing by default should do it for this one.
Will try to give it a try to see if this works but if someone gets to it before me then we can add that to the comps group.

Metadata Update from @siosm:
- Issue set to the milestone: None (was: Plasma 5.23)

2 years ago

So adding samba-usershare and kdenetwork-filesharing by default should do it for this one.
Will try to give it a try to see if this works but if someone gets to it before me then we can add that to the comps group.

Note: The package is named samba-usershares

We also will need the SELinux boolean set for this to work, right?

SELinux changes (https://fedoraproject.org/wiki/SELinux/samba) should only be needed when you're mounting your whole directory from a remote samba share, which is not the goal of this addition here as it is only about sharing some folders via Dolphin.

Metadata Update from @siosm:
- Issue marked as blocking: #112
- Issue set to the milestone: Fedora Linux 38

a year ago

Metadata Update from @siosm:
- Issue assigned to siosm (was: marcdeop)

a year ago

Metadata Update from @siosm:
- Issue tagged with: kinoite

a year ago

Metadata Update from @siosm:
- Issue marked as blocking: #112

a year ago

Hi,

sorry if this is the wrong place to post it, I came here through this thread which I was pointed to somewhere else after asking about help to get the kdenetwork-filesharing plugin to work:
https://ask.fedoraproject.org/t/samba-file-sharing-on-fedora-kde-36/23625

I want to report that the solution described here (install kdenetwork-filesharing plugin and samba-usershares package) does NOT work.

The result is the following:
https://i.imgur.com/E9au5N7.png

Clicking on "Create Samba password" opens a "Set Samba password dialogue".
https://i.imgur.com/4LXkdcV.png

Which is confusing because I already have a Samba user for my Linux user.
Anyway, typing in a password, doesn't matter if it is the already present password for the samba user or a new password, there is no error and a new dialogue appears, asking for sudo confirmation:
https://i.imgur.com/wdRONLK.png

After typing in the user password (not samba) for sudo privilige, there is no error but it returns back to the "Set Samba password" dialogue and nothing happens further. You can close the window but nothing changes.

I'm trying to get this working on a fresh Fedora 37 KDE Spin. System is up to date.
Things I did and/or already tried but didn't help:

  • add my user to the created group "usershares"
  • sudo setsebool -P samba_enable_home_dirs=1
  • deleting my Samba user and trying to let the dialogue create a new one

Furthermore, I want to add that it's a really terrible user experience to actually get to this point, especially for a relatively new Linux user like me. Just to give you a different perspective.
Only installing the kdenetwork-filesharing plugin, which is what I did in the first place because I didn't know better, give me only this.
https://i.imgur.com/pL4Uyoi.png

I had to ask on several places to get the information I have now. This could and should be simpler. It would already help so much, if there would be an official documentation to actually get this thing working and/or, what packages/things are further needed beside the actual plugin.

Again, sorry, if this is the wrong place for this.

Those would be bugs in the KDE code; this thread is about Fedora packaging and installing it. Please file bug reports at https://bugs.kde.org/enter_bug.cgi?product=kdenetwork-filesharing.

The whole point of this wizard is to make it easier for new users, and believe it or not, it used to be much worse than it was before. So your experience is valuable, and I would like to see those bug reports! And, please file do file one bug report per bug, issue, or awkward UI you find. No mega bug reports please. :)

Like, "Which is confusing because I already have a Samba user for my Linux user." would be one bug, that it doesn't detect your existing samba user but it should.

And "there is no error but it returns back to the "Set Samba password" dialogue and nothing happens further." would be another bug.

Hi,

wow, thanks for the fast response and the friendly direction. I've created 2 bug reports, like you suggested, 1 for not recognizing an already present Samba user and 2 for the plugin not working like expected. I hope someone can reproduce this and it gets resolved.

For anyone who may stumble by chance into the same problem or just may be intereseted in:

https://bugs.kde.org/show_bug.cgi?id=463067
https://bugs.kde.org/show_bug.cgi?id=463066

Thank you!

Cool, I'll follow up there.

i hope im in the correct place, but the group that needs to be created is "sambashares" and not "usershares" as sussed out in this bug report: https://bugs.kde.org/show_bug.cgi?id=466786#c14

ref: https://wiki.archlinux.org/title/samba#Enable_Usershares

From what I understood, anything that contains admin, root or doesn't contain samba will not work.

Not very important I guess. sambashares should work. I personally would rather use sambausershares though ;-)

That would be fine too.

does "Milestone Fedora Linux 38" mean these should have been included? im on a fresh install of f38 kde and they are not:

Operating System: Fedora Linux 38
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10
Kernel Version: 6.3.8-200.fc38.x86_64 (64-bit)
Graphics Platform: Wayland

@kinghat that means it was the goal to have it done by then. Clearly, it slipped a bit.

On getting this moving forward again, it seems the package samba-usershares should perhaps create the sambashares user account and it should own /var/lib/samba/usershares.

Metadata Update from @siosm:
- Issue set to the milestone: Fedora Linux 39 (was: Fedora Linux 38)

9 months ago

Metadata Update from @siosm:
- Issue set to the milestone: Fedora Linux 40 (was: Fedora Linux 39)

6 months ago

Metadata Update from @siosm:
- Assignee reset

6 months ago

Login to comment on this ticket.

Metadata
Boards 1
Kinoite Status: Triaged