Open FransUrbo opened 11 years ago
sharesmb: Controls whether the file system is shared by using the Solaris CIFS service, and what options are to be used. A file system with the sharesmb property set to off is managed through traditional tools, such as the sharemgr command. Otherwise, the file system is automatically shared and unshared by using the zfs share and zfs unshare commands. If the property is set to on, the sharemgr command is invoked with no options. Otherwise, the sharemgr command is invoked with options that are equivalent to the contents of this property.
How it works on solaris.. Share name & guest access: zfs set sharesmb=name=myshare,guestok=true mydataset Which is same as: sharemgr set -P smb -p guestok=true -r myshare mygroup ACL seems to be native, but samba has it's own...
Since guestok=true actually seems to be sharemgr option, we probably want to allow doing the same thing for usershare options with ZoL (guestok can be alias for compatibility): zfs sharesmb=name=sharename,comment="my cool share",acl="Everyone:F",guest_ok=y pool/fs
What are all the possible options to 'guest_ok'?
Are you asking what "net" accepts or what can it be in zfs set sharesmb?
According to http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html net usershare add sharename path [comment] [acl] [guest_ok=[y|n]]
Solaris/illumos zfs set sharesmb accepts guestok=[true|false] instead (no underscore!).
Handling both guest_ok=y|n and guestok=true|false (translating it to guest_ok=y|n for net usershare) would be a bonus.
I've already made guestok an alias to guest_ok, so that's ok. But I'll support 'true/false' as well as 'y/n'. Maybe should accept 'yes/no' to?
Should I only accept lowercased options, or do I have to do a case insensitive one!?
Some sharesmb options seem not to be working?
sudo zfs set sharesmb=name=photo media/photos
cannot set property for 'media/photos': 'sharesmb' cannot be set to invalid options
(The smb share ends up being named media_photos, but I want it to be photos.)
@satmandu It seems (I could be wrong here, since the zfs docs are woefully over complicated (or perhaps I overestimate my technical ability)), that zfs only allows on/off as the option for sharesmb.
But it's ok, since zfs just defers to sambas net command:
net usershare add sharename path [comment] [acl] [guest_ok=[y|n]]
So you'd do something like:
net usershare add photos "lolcat photos" guest_ok=y
interresting thing, I have a pool that I moved from an omnios host to a zfsonlinux host (Ubuntu 16.04). The dataset had the sharesmb=name=XXXX set on the Omnios, and are shared on the linux host with the correct name while setting a new name throught the zfs command on linux is not possible
Has there been any progress on this issue?
@FransUrbo it seems you have made some significant headway on this in your fork (https://github.com/FransUrbo/zfs/commit/32c1704ea41ab026b3f6f3c8e0cd225290b07231), any plans to mainline this?
I also saw from the OpenZFS Leadership meeting notes back in August 2019 that there has been some discussion on that end, but that was mostly focus on NFS rather than SMB. Not sure if there has been any change on that end either.
After migrating from Solaris 11 (Have been using Zfs on Sol since its release) looking for this functionality as all of my sharenames are out of whack. Yes you can play with the Samba config but having this on the zfs properties is important as they get set up / torn down when importing / export pools etc. With being able to set nfs share properties using zfs set sharenfs="
Split from #1170: I haven't really worked that intimate with solaris for the last ten years so a list of options that zfs on Solaris takes would be nice. With possible options and, if it's not obvious from it's name, what they are supposed to do. Then I'll try to implement them as soon as I can.