Gossamer Forum
Home : Products : DBMan : Discussions :

Lookup corrupts default.pass file

Quote Reply
Lookup corrupts default.pass file
While the sub routines for setting a new e-mail address and password work fine, the routine 'lookup' results in the password file (with dozens of records) being overwritten with just the last record. I can't see what's wrong - having compared where my script has got to against the original.

Does anyone have any pointers as to what I should check?

--------- EXTRACT --------
open (PASS, ">$auth_pw_file") or &cgierr ("unable to open: $auth_pw_file.\nReason: $!");
if ($db_use_flock) {
flock(PASS, 2) or &cgierr("unable to get exclusive lock on $auth_pw_file.\nReason: $!");
}
print PASS $output;
close PASS;

($userid, $pw, $view, $add, $del, $mod, $admin, $email) = split (/:/, $found);

$password = &generate_password;
srand( time() ^ ($$ + ($$ << 15)) ); # Seed Random Number
my @salt_chars = ('A' .. 'Z', 0 .. 9, 'a' .. 'z', '.', '/');
my $salt = join '', @salt_chars[rand 64, rand 64];
my $encrypted = crypt($password, $salt);

open (PASS, ">>$auth_pw_file") or &cgierr ("unable to open: $auth_pw_file.\nReason: $!");
if ($db_use_flock) {
flock(PASS, 2) or &cgierr("unable to get exclusive lock on $auth_pw_file.\nReason: $!");
}
print PASS "$userid:$encrypted:$view:$add:$del:$mod:$admin:$in{'email'}\n";
close PASS;

Subject Author Views Date
Thread Lookup corrupts default.pass file WYSIWYG 3327 Sep 12, 2000, 8:35 AM
Thread Re: Lookup corrupts default.pass file
AstroBoy 3255 Sep 12, 2000, 5:13 PM
Thread Re: Lookup corrupts default.pass file
WYSIWYG 3252 Sep 13, 2000, 12:36 AM
Thread Re: Lookup corrupts default.pass file
WYSIWYG 3239 Nov 3, 2000, 11:36 AM
Thread Re: Lookup corrupts default.pass file
AstroBoy 3212 Nov 3, 2000, 4:52 PM
Post Re: Lookup corrupts default.pass file
WYSIWYG 3210 Nov 4, 2000, 7:51 AM