ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/login.ext
(Generate patch)

Comparing deliantra/server/ext/login.ext (file contents):
Revision 1.115 by root, Sun Jan 23 23:37:55 2011 UTC vs.
Revision 1.118 by root, Thu Nov 8 00:16:07 2012 UTC

3# login handling 3# login handling
4 4
5use Fcntl; 5use Fcntl;
6use Coro::AIO; 6use Coro::AIO;
7 7
8our $MAX_DISCONNECT_TIME = $cf::CFG{max_disconnect_time} || 3600; 8CONF MAX_DISCONNECT_TIME = 3600;
9 9
10# paranoia function to overwrite a string-in-place 10# paranoia function to overwrite a string-in-place
11sub nuke_str { 11sub nuke_str {
12 substr $_[0], 0, (length $_[0]), "x" x length $_[0] 12 substr $_[0], 0, (length $_[0]), "x" x length $_[0]
13} 13}
60 or return; 60 or return;
61 my $x = $ob->x; 61 my $x = $ob->x;
62 my $y = $ob->y; 62 my $y = $ob->y;
63 63
64 # never happens normally, but helps when shell users make mistakes 64 # never happens normally, but helps when shell users make mistakes
65 $m->in_memory == cf::MAP_ACTIVE 65 $m->linkable
66 or return 1; 66 or return 1;
67 67
68# return 0;#d# 68# return 0;#d#
69# warn join ":", $m->at ($x, $y);#d# 69# warn join ":", $m->at ($x, $y);#d#
70# warn "FOO$m { ".scalar ($m->at ($x, $y))." }\n"; 70# warn "FOO$m { ".scalar ($m->at ($x, $y))." }\n";
140} 140}
141 141
142sub compare_password($$) { 142sub compare_password($$) {
143 my ($pass, $token) = @_; 143 my ($pass, $token) = @_;
144 144
145 if ($token =~ /\!(.*)/) { 145 if ($token =~ /!!(.*)/) {
146 return +(substr $pass, 0, 8) eq pack "H*", $1;
147 } elsif ($token =~ /!(.*)/) {
146 return $pass eq pack "H*", $1; 148 return $pass eq pack "H*", $1;
147 } else { 149 } else {
148 return $token eq crypt $pass, $token; 150 return $token eq crypt $pass, $token;
149 } 151 }
150} 152}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines