*BSD News Article 52713


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!lll-winken.llnl.gov!ames!news.hawaii.edu!adagio.kcc.hawaii.edu!user
From: kchan@leahi.kcc.hawaii.edu (Kenwrick Chan)
Subject: Re: Bad crypt?
X-Nntp-Posting-Host: adagio.kcc.hawaii.edu
Message-ID: <kchan-0810951340130001@adagio.kcc.hawaii.edu>
Sender: news@news.hawaii.edu
Organization: Kapiolani Community College
References: <kchan-0110951556250001@adagio.kcc.hawaii.edu> <44rj41$c76@uriah.heep.sax.de>
Date: Sun, 8 Oct 1995 23:40:13 GMT
Lines: 51

In article <44rj41$c76@uriah.heep.sax.de>, j@uriah.heep.sax.de (J Wunsch) wrote:

> Kenwrick Chan <kchan@leahi.kcc.hawaii.edu> wrote:
> 
> >I'm trying to compile MOO-1.7.8p4 and I finally got it to compile.  It
> >seems to work fine, but I the password function does not seem to work
> >correctly.  I can set a password fine, but it's useless cause it doesn't
> >recognize it once I set it.  I had to use "LIBRARIES = -lm -lcrypt" to
> >compile.
> 
> I dunno what the hell MOO is, but only a process with euid == 0 can
> actually get passwords in FreeBSD.  So you have to make your MOO aware
> of being setuid root.  (Don't simply turn on the suid bit.  Unless the
> program is already designed to be suid-aware, you're most likely going
> to open security holes!)
> -- 

Okay I got it to compile with "LIBRARIES = -lm -lcrypt".  Seems to work
fine except for the things regarding crypt.  Got the following
recommendations from someone from the MOO list.
-- 
Do the following from inside the MOO environment in question:

  ;crypt("some string")

you should get back something along the lines of (this is an example, yours
probably won't be the same string.  Doesn't really matter what you get back):

  => "wOCq7A/q9eOLk"

Now take the first two characters from that response, and run crypt() again
with them as the second arg:

  ;crypt("some string", "wO")

You should get back the same result:

  => "wOCq7A/q9eOLk"

If you don't get back the same result as the first crypt() call, your unix
crypt implementation is broken, and that's your problem.  I don't know much
about FreeBSD, but if you can't figure out how to get its crypt function to
work right, you could try getting the GNU crypt implementation (the GNU Ultra
Fast Crypt library, available from many (particularly non-US) GNU FTP sites)
and try having the MOO use its crypt function instead of the FreeBSD one..
-----

As you can guess, it doesn't work.  Doe FreeBSD use the GNU crypt?

Thanks folks,
Kenwrick