Subject: Moving a database from one machine to another

From: Darren Loher <[email-masked]>
Date: Sat, 27 Nov 1993 16:13:58 -0800

I have been running MOO-1.7.6 from a SunOS machine for a couple of months 
now.  I just recomplied the server on FreeBSD v1.02.  It works great!  

The problem is I cannot login to the database I copied over from the 
SunOS machine to the FreeBSD machine.  I can create new characters, but I 
cannot use the characters that were created on the SunOS side.  

My guess is that the MOO server uses a system call to do encryption on the
passwords and FreeBSD uses different encryption than SunOS, so passwords 
never match correctly with the old characters.  

Is there a way to fix this?  Since I have no wizard on the new machine 
I'm completely stuck...  Help!

(you can login to the slightly broken databsae at:  ocf.unt.edu 7777 )

--
Darren Loher                           
[email-masked]

---

From: Pavel Curtis <[email-masked]>
Date: Sat, 27 Nov 1993 16:09:41 -0800

> Date:	Sat, 27 Nov 1993 16:13:58 -0800
> From:	Darren Loher <[email-masked]>
> 

Well, it's a library routine, not a system call, but it sounds like you've
probably correctly diagnosed the problem.  It's a shame the makers of FreeBSD
didn't bother to make it compatible in this respect.

Anyhow, there isn't any very nice way to work on this problem (there will be in
1.8.0, where it'll be possible to start up the server in a special mode that
automatically gives you wizard access to the database, precisely for such
emergencies as this one), but there is a nasty way to fix it.

You're going to have to edit the database file by hand.  First, make a safe
copy of it in some other place.  Then, get the original into your favorite text
editor and search forward for the lines

	#2
	Wizard

(Or whatever the name of your original wizard character is.)  Scroll forward
from there looking for some lines like these:

	2
	naW7FGr1S8RCk

(where the `2' will be there, but you'll have some other encrypted string after
it).  Those represent the encrypted value of the wizard's password.  Replace
those lines with

	0
	0

which represents a .password value of the number 0, which means not to insist
on a password.  Save the file and restart the server.  You should be able to
log into the wizard character now without giving a password.  Once you're in,
you'll have to figure out for yourself what to do about resetting the passwords
of all of the other players, but at least you'll be in a position to do so.

Good luck,

	Pavel

---

From: Greg Hudson <[email-masked]>
Date: Sun, 28 Nov 1993 11:05:31 -0800

>> My guess is that the MOO server uses a system call to do encryption
>> on the passwords and FreeBSD uses different encryption than SunOS,
>> so passwords never match correctly with the old characters.

> Well, it's a library routine, not a system call, but it sounds like
> you've probably correctly diagnosed the problem.  It's a shame the
> makers of FreeBSD didn't bother to make it compatible in this respect.

The ITAR restricts the export of the standard crypt() outside of the
US.  This is not a big problem for commercial operating systems, but
free operating systems (which are often developed partially or largely
outside the US) like to be exportable.  I don't know exactly how
FreeBSD deals with this, but Chris Provenzano, who is on the NetBSD
development team (and is playing Netrek on the machine to my left)
tells me that NetBSD distributes a separate crypt library that
contains the real crypt routine; this library is not exportable.  I
assume FreeBSD does something similar.

If you link without -lcrypt, your program will successfully link, but
will get a different crypt which does something trivial enough to be
exportable.

I suggest that, rather than modifying the database, Darren recompile
his MOO with -lcrypt (after obtaining libcrypt, if necessary), since
the encryption routine the MOO is currently using is probably not
useful.

--GBH