When a partition mounted to a shared by Samba folder is dismounted, Samba keeps sharing that empty folder. It creates a security hazard, since files can still be saved to that empty folder, and overwritten next time (lost) when the original partition is auto mounted again to the same folder. Its also confusing for most users to browse empty shares - no normal person would understand why they are still there. Is it possible to configure Samba to hide corresponding shares, once the attached drive is dismounted or switched off? If not, is there any reason or logic, why such basic functionality is not offered?
On Sat, Sep 01, 2012 at 03:52:38PM -0400, Sam Bulka wrote:> When a partition mounted to a shared by Samba folder is dismounted, > Samba keeps sharing that empty folder. It creates a security hazard, > since files can still be saved to that empty folder, and overwritten > next time (lost) when the original partition is auto mounted again > to the same folder. Its also confusing for most users to browse > empty shares - no normal person would understand why they are still > there. > > Is it possible to configure Samba to hide corresponding shares, once > the attached drive is dismounted or switched off? If not, is there > any reason or logic, why such basic functionality is not offered?You'll need to script this yourself by issuing removing the share entry from smb.conf and using smbcontrol to close client connections to that share and reload the config file. Samba doesn't have logic to hook into your specific UNIX's method of notifying dismounts (if it even has one). Also, it's not a security hazard, as the admin - don't do that :-). Jeremy.
On 9/1/2012 2:52 PM, Sam Bulka wrote:> When a partition mounted to a shared by Samba folder is dismounted,Mount/unmount is performed on filesystems, not partitions.> Samba keeps sharing that empty folder. It creates a security hazard, > since files can still be saved to that empty folder, and overwritten > next time (lost) when the original partition is auto mounted again to > the same folder. Its also confusing for most users to browse empty > shares - no normal person would understand why they are still there.No "normal person" would dismount a filesystem from underneath a Samba share.> is there any > reason or logic, why such basic functionality is not offered?Samba is not MS Windows. Just because a feature exists in MS Windows does not make it "basic" translated "expected" in other platforms. If you were a long time Samba/*nix user and switched to MS Windows you'd have the same complaint in reverse (though there are few such defections). -- Stan