samba: keep needed dirs

Closes #24870.