add logic in spwd.c