r19308: Merge samsync fixes from SAMBA_4_0_RELEASE