Samba is missing idmap/ad.so for rfc2307 compatibility. Reproducible: Always When Samba 4 is part of an Active Directory with rfc2307 schema, it won't fetch the User/Group IDs from Active Directory. For this to work it needs /usr/lib64/samba/idmap/ad.so which is compiled when adding --with-shared-modules=idmap_ad to the configure options. As of https://lists.samba.org/archive/samba/2012-July/168350.html it is also needed in the 3.6-Series.
Created attachment 356104 [details, diff] Patch for samba-4.0.8.ebuild
+ 16 Aug 2013; Patrick Lauer <patrick@gentoo.org> +samba-4.0.8-r1.ebuild, + samba-4.1.0_rc2.ebuild: + Fixing USE=ads #481210