| Summary: | Crypt() function returns wierd results | ||
|---|---|---|---|
| Product: | Base System | Reporter: | racker75 <racker75> |
| Component: | misc | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 3.3-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
> 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/ 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. |
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.