When enabling smb sharing, two shares are enabled
shawly opened this issue · comments
When enabling an SMB share, cockpit-zfs-manager enables two shares.
One by executing zfs set sharesmb=on <dataset>
which creates a file in /var/lib/samba/usershares
and one by creating a configuration within /etc/cockpit/zfs/shares.conf
and /etc/cockpit/zfs/shares/
.
The share that gets created via the smb config has the name that is set through the UI, but the share that gets created through zfs set
has the name of the dataset with slashes replaced by underscores.
I skipped through the zfs.js and found that FnFileSystemShareSmbEnable
executes the zfs set
command while FnSambaZfsShareEnable
creates the smb config files.
Why though? I don't get why it's necessary to enable both, can you explain this?
Looking at the original code from @optimans it seems this has been the case for years, maybe they can explain this?
Nevermind, it was explained at the bottom of the README.
Though maybe you could add a feature to disable this?
Setting usershare max shares = 0
does the trick, putting it in the /etc/cockpit/zfs/shares.conf
might make sense or better make it configurable through the UI?
cockpit-file-sharing could also do this maybe, adding some compatibility between cockpit-zfs-manager and that plugin might make the user experience better.