This article is from the MachTen & CodeBuilder FAQ, by Jaime Julca jjulca@tenon.com with numerous contributions by others.
Because Power MachTen is BSD 4.4 compliant, we have moved to the shadow
password suite. As a result, the old databases are no longer compatible. The
following two perl scripts will convert the password files for you. The
first takes your passwd file and outputs what your master.passwd should look
like. Just run it and redirect your output to /etc/master.passwd. You should
also chmod 600 this file so only root can read it. The second modifies your
passwd file so it no longer contains the passwords. You should back up your
passwd file before you try any of this, in case anything goes wrong. If you
don't already have perl, you can get it from our ftp site.
Using the "vipw" command, you should edit the password information. Just
modify it so it will update the database, i.e., change something then change
it back. When you exit vipw, it will build the spwd.db and pwd.db databases.
**** First Script ****
#!/usr/local/bin/perl
open(PASSWD, "/etc/passwd");
while(<PASSWD>){
chop;
($name, $password, $uid, $gid, $realname, $homedir, $shell) = split(/:/);
print
"$name:$password:$uid:$gid::0:0:0:$realname:$homedir:$shell\n" ;
}
**** Second Script ****
#!/usr/local/bin/perl
open(PASSWD, "/etc/passwd");
while(<PASSWD>){
chop;
($name, $password, $uid, $gid, $realname, $homedir, $shell) =
split(/:/);
print "$name:\*:$uid:$gid::$realname:$homedir:$shell\n" ;
}
 
Continue to: