Simon Bryan wrote:
> The error I getin the Cache log says 'Read Failure', I know it is not
> permissions as I have the same permissions etc as a file that is working. I
> think it is to do with the 'end of line'. What should be there in this file,
> CR+LF, CR, or LF?
The message is probably a indirect error causes by something else. Is
there any other interesting errors prior to this?
The format of the ncsa_auth password file is : separated with bare NL as
lineending.
userid:encrypted_password[:other:fields:if:wanted]NL
the [] denotes optional data
Quick and dirty perl script to encrypt a list of userids and passwords
separated with mostly any separator (. , : ; " <space> <tab> or any
combination thereof) and line format using bare LF or CRLF.
#!/usr/bin/perl
# Generate a initial salt with two uppercase letters
$salt=pack("cc",65+int rand(25),65+int rand(25));
while(<>) {
# Split the line on mostly any separator
@F=split(/[:,;"\s\r]+/);
shift @F if $F[0] eq "";
# Encrypt the password (second field) using unix crypt()
$crypt=crypt($F[1],$salt);
# Borrow two characters for the next salt
$salt=substr($crypt,2,2);
# Print out the result
print $F[0].":".$crypt.join(":",splice(@F,2))."\n";
}
Received on Fri May 12 2000 - 13:28:31 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:53:29 MST