Make passwd parsing more generic to improve compatibility