Boot into single user mode (enter -s at the boot prompt). The do
something like the following:
# mount -vat ffs
# pwd_mkdb -p /etc/master.passwd
If it is really only /etc/spwd.db that is hosed you could get away
with "pwd_mkdb -s /etc/master.passwd"
- todd