patch from upstream to fix special case in password checking code