Bug 463066

Summary: Creating a share via GUI is not possible
Product: [Frameworks and Libraries] kdenetwork-filesharing Reporter: schM0ggi
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: nate, sitter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description schM0ggi 2022-12-15 11:54:19 UTC
Trying to create a share via Dolphin with the help of the kdenetwork-filesharing plugin does not work.

The "Share" tab is visible in the properties of the file/directory and it's asking to create a Samba user/set a Samba password. But setting a Samba password in the following dialogue has no effect and it returns back to that dialogue. 

How it looks:
https://i.imgur.com/E9au5N7.png
https://i.imgur.com/4LXkdcV.png
https://i.imgur.com/wdRONLK.png

STEPS TO REPRODUCE
1. install kdenetwork-filesharing plugin 
2. install samba-usershares package
3. add your user to the group "usershares", which was created via the "samba-usershares" package
4. restart
5. create a directory in your home directory
6. set the right SELinux context for the share
sudo semanage fcontext --add --type "samba_share_t" "/home/my_user_name/name_of_directory(/.*)?"
sudo restorecon -R ~/name_of_directory
7. open properties of the directory. Go to "Share" tab and try to create a share.

OBSERVED RESULT
There is a button to create/set a Samba user/password. After typing in the password in the following dialogue, a sudo privilge dialogue appears. After typing in the user password for sudo, it returns back to the "Set Samba password" dialogue. Nothing further happens. You can close the window but nothing changes.

EXPECTED RESULT
Be able to create a share.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 37 KDE Spin , everything is up to date

ADDITIONAL INFORMATION
As seen here https://bugzilla.redhat.com/show_bug.cgi?id=2096405 and here https://pagure.io/fedora-kde/SIG/issue/109

there exists a "samba-usershares" package in the Fedora repo which creates the directory "/var/lib/samba/usershares" and a "/etc/samba/usershares.conf" file. 

The "/etc/samba/smb.conf" file has the following line:
https://i.imgur.com/93FYiaj.png
which includes, as I understand, the additional configuration from "/etc/samba/usershares.conf", created by the samba-usershares package. The "/etc/samba/usershares.conf" file holds this:
https://i.imgur.com/Sr87uKz.png
Comment 1 Nate Graham 2022-12-25 03:12:43 UTC
Did some investigation. We have this code:

    function userCreated(userCreated)
        {
            enabled = true
            changePassword.busy = false
            if (userCreated) {
                close()
                stackReplace(pendingStack.pop())
            }
        }

If no user was created--because it already existed--then the sheet doesn't get closed and the current page isn't changed. Seems like the issue here is a symptom of Bug 463067; if existing users were noticed earlier, we would never get in the situation in the first place. Marking as a duplicate of Bug 463067 since we should just fix that, and if we do, it will fix this.

*** This bug has been marked as a duplicate of bug 463067 ***