r23194: cherry pick two fixes from SAMBA_3_0_26