45Drives / cockpit-file-sharing

A Cockpit plugin to easily manage samba and NFS file sharing.
GNU General Public License v3.0
596 stars 32 forks source link

Users and Groups assigned to shares changes after logout / restart #84

Open Jesse-Dur opened 1 year ago

Jesse-Dur commented 1 year ago

Bug Info

Describe the bug After adding a user under the valid users section to a share and hitting confirm, I then log out of cockpit and log back in and the user has switched to that of another share or all users and groups are removed entirely from a share.

To Reproduce Steps to reproduce the behavior: 1) Install cockpit, cockpit file sharing, and cockpit identities onto an ubuntu 20.04LTS machine. 2) Add users & groups. 3) Create multiple samba shares and assign different users and groups to each. 4) Log out of cockpit or restart machine and the users and groups will be shuffled around between shares and incorrect.

Expected behavior Users and Groups assigned to shares save correctly after a restart.

Client Side

Desktop (please complete the following information):

Server Side

Additional context Tried with Ubuntu Server 22.04 LTS with same problem.

adams13x13 commented 1 year ago

I can confirm, cockpit-file-sharing 3.3.4-1focal under Proxmox virtual environment 7.4-17 server, Google Chrome under Linux client.

To better reproduce:

Create 4 shares with different user assignments in the following order: "Share_4", "Share_3", "Share_2", "Share_1". After "page reload" in web browser the user assignments are exchanged.

Share_1 gets users from Share_4, Share_2 gets users from Share_3, Share_3 gets users from Share_2, Share_4 gets users from Share_1.

The same happens if I export configuration to a file on my computer and import it ("page reload" is required to be able to export, see #86).

User assignments in the exported file (cockpit-file-sharing_sambaexported....conf) are correct, however in the reverse order (4-3-2-1).

User assignments in the system (as seen with 'sudo testparm') are correct, however in the reverse order like in the exported file.

If I edit any share and close it with "confirm" without any change, the (wrong) user assignment that was on the screen is saved in the export file and in the result of 'sudo testparm'.

It looks the problem is only that the GUI elements are initialized in the wrong order and than they keep this wrong information. The first share item in the alphabetically sorted list gets the users of the first created share item and so on.

ofotache commented 8 months ago

I can confirm, experiencing it on Raspberry Pi OS bookworm arm64. It can be reproduced by refreshing the page. I've discovered that the user assigned persists, even if it doesn't show up anymore, this can be tested by exporting the config the user is still in conf.

3.3.4-1focal_all.deb

robertnisipeanu commented 3 months ago

I can also confirm.

What is even more bad, is if you switch on Windows ACL you cannot select users/groups in the UI anymore, but they still get shuffled. Took me a few hours to understand why out of a sudden my SMB user couldn't connect anymore to one of the shares...