Bug 16278

Summary: Crypt() function returns wierd results
Product: Base System Reporter: racker75 <racker75>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-RELEASE   
Hardware: Any   
OS: Any   

Description racker75 2000-01-21 20:10:07 UTC
    Using perl, crypt() returns long, unintelligable values.  For example, the perl installed with 3.3-RELEASE produces these results:
     $salt = 'fs';
     $pass = 'heynow';
     $out = crypt($salt, $pass);
     print "$out\n"; 
returns this:
bash-2.03$ perl test3.pl
$1$heynow$0jPK61iCt92vyGs2ciUUa.

I do not know the cause of this, or how it can be fixed, it seems to be dependent on this particular machine.
Comment 1 dhagan 2000-03-08 15:00:08 UTC
> Using perl, crypt() returns long, unintelligable values.  For example,
> the perl installed with 3.3-RELEASE produces these results:
>         $salt = 'fs';
>         $pass = 'heynow';
>         $out = crypt($salt, $pass);
>         print "$out\n"; 
>    returns this:
>    bash-2.03$ perl test3.pl
>    $1$heynow$0jPK61iCt92vyGs2ciUUa.

man crypt(3) shows that crypt expects crypt(password, salt), not
vice-versa.  If you switch the arguments you will probably get the correct
result.  Also, I believe the $1$ at the start indicates that this is a MD5
password, and thus won't necessarily match other crypt() calls (on other
UNIXs).

Daniel

-- 
Daniel Hagan                                             Computer Science CSE
dhagan@cs.vt.edu                                http://www.cs.vt.edu/~dhagan/
Comment 2 nbm freebsd_committer freebsd_triage 2000-06-26 11:39:40 UTC
State Changed
From-To: open->closed

Explanation should be sufficient, and no feedback was received. 
Testing indicates that the current behaviour is correct on both 3.4 and 
4.0.