Script to Hide empty Samba shares?

Sam Bulka sambul7165 at
Sun Sep 2 08:03:58 MDT 2012

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 by unsuspecting users, 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.  
Instead they ask, why they don't have the right to browse the disk.

Is it possible to add the new Share Config option to Samba to hide a  
corresponding share, once the attached partition is dismounted or USB  
drive switched off? Can someone offer a suitable script for such option?

More information about the samba-technical mailing list