SMB Option to add custom dfree command

Problem/Justification

Since the removal of raw SMB options in 25.10, I’m unable to get proper disk usage stats through SMB due to private shares grabbing the disk usage and size of the ZFS dataset they are in, not the entire pool like I want.

For me at the very least “dfree command” should be added, such as:

dfree command =/mnt/truenas-main/smb_disk_usage.sh

On top of other threads mentioning force users/groups and other things, like Add WebUI options for configuring a few SMB Auxiliary Parameters and SMB Share Force User / Force Group WebUI setting.

Impact

SMB auxiliary parameters should have never went away, I agree they should be obscured a bit from the average user pasting in random stuff from the internet, but removing it entirely on non-Legacy shares impacts genuine use-cases. I don’t think I need to go over this, there are enough various feature request threads here already with all sorts of SMB aux options.

User Story

It adds the ability to point SMB to a custom script to gather disk usage metrics instead of providing false readouts from a dataset - this would primarily apply to a NAS shared by a small amount of users with no quotas, so, probably almost every home NAS.

That would help. testparm -s is a quick check after a config change. If dfree command is missing from the generated share config, middleware stripped it before smbd saw it. A per-share field with a warning about executable paths would cover this without bringing back a free-for-all aux box.

Yeah one of my private shares got auto-upgraded to a Private Share instead of being kept in Legacy Share state, so the dfree from that one vanished.

For the record since I didn’t make it super clear in the original post, I’m not calling for the re-addition of “type in anything” aux params, rather that there should be a per-share field where you can navigate to an exe or script (an actual file picker dialog would be welcome over a plain text field, but either works).