Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When enabling smb sharing, two shares are enabled #19

Open
shawly opened this issue Jan 25, 2023 · 3 comments
Open

When enabling smb sharing, two shares are enabled #19

shawly opened this issue Jan 25, 2023 · 3 comments

Comments

@shawly
Copy link

shawly commented Jan 25, 2023

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?

@shawly
Copy link
Author

shawly commented Jan 25, 2023

Looking at the original code from @optimans it seems this has been the case for years, maybe they can explain this?

@shawly
Copy link
Author

shawly commented Jan 25, 2023

Nevermind, it was explained at the bottom of the README.

@shawly shawly closed this as completed Jan 25, 2023
@shawly
Copy link
Author

shawly commented Jan 25, 2023

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.

@shawly shawly reopened this Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant