OK...finally.
I got this right before seeing anomie's post.
But after restoring /etc/master.passwd you need to do the following:
Code:
pwd_mkdb -C /etc/master.passwd
pwd_mkdb -p /etc/master.passwd
pwd_mkdb /etc/master.passwd
this rebuilds /etc/passwd and /etc/pwd.db
after that, I could passwd root to set the password!