‘ƒXƒŒƒbƒhƒŠƒXƒg‚֖߂遑 ‘S•” 1- 101- 201- 301- 401- 501- 601- 701- 801- 901- 1001- ΕV50

y½Ϊ―Δށz2‚ƒ‚ˆŒ^ŒfŽ¦”Β ‚»‚Μ7yΜ۰Č^z

469 F„466 F03/03/23 07:35 ID:???
my ($md5datefile, $date, $idnum, $random, $idcrypt);

$md5datefile = './md5.cgi';
$date = substr($DATE, 0, 8);
$idnum = substr($ENV{'REMOTE_ADDR'}, -6) . $FORM{'bbs'} . $date;
#$idnum =~ tr/a-zA-Z0-9_//cd;

if ( open(MD5FILE, '<'.$md5datefile) ) {
@my ($md5date, $md5number) = split(/<>/, <MD5FILE>);
@close(MD5FILE);
@$random = $md5number if ($md5date eq $date);
}

unless ($random) {
@my $data = '';

@sysopen(RANDOM, '/dev/urandom', 'O_READ') or &DispError('/dev/urandom ‚ͺŠJ‚―‚Θ‚’I');
@sysread(RANDOM, $data, 8);
@close(RANDOM);

@open(MD5FILE, '>'.$md5datefile);
@flock(MD5FILE, 2);
@print MD5FILE "$date<>$data";
@close(MD5FILE);
@$random = $data;
}

chmod(0666, $md5datefile);
$idcrypt = substr(crypt($idnum, '$1$' . $random), -8);
$ID = " ID:$idcrypt";

186KB
V’…ƒŒƒX‚Μ•\Ž¦

ƒXƒŒƒbƒhƒŠƒXƒg‚Φ–ί‚ι ‘S•” ‘O100 ŽŸ100 ΕV50

0ch BBS 2004-10-30