Problem:
Homeshares are shown for all users, even if other users do not have ay access.
This is a problem, if there are more then 2000 users with a homeshare and a teacher has a up to 2000 share overview.
Investigation:
Samba [homes] shares differ from regular static shares because they are created dynamically. The [homes] section acts as a template rather than representing all users’ home shares as permanently configured services.
When a user accesses \\server\<username> , Samba creates a corresponding service dynamically from the [homes] template. Consequently, the set of instantiated home-share services can change depending on which home shares are currently or were recently accessed.
Share enumeration operates on the services currently known to Samba. Therefore, dynamically instantiated home shares may become part of the enumeration, while home directories that have not resulted in an instantiated service are not necessarily present.
This explains why:
- The number of visible home shares can vary over time without any configuration or filesystem changes.
- The behavior is specific to
[homes]and is not normally seen with statically configured shares. - The existence of a user’s home directory on the filesystem does not mean that a corresponding Samba share permanently exists.
- Access to a home directory and visibility of its dynamically created share are separate mechanisms.
The varying enumeration results are therefore caused by the dynamic nature of Samba’s [homes] services rather than changes to the underlying home directories or filesystem ACLs.
Solution:
There is no classic solution: There is a but which addresses this issue
See also samba Bug 15658 and 59693