- my $auth_ok;
- open PASSWD, "<$cfg->{gitcvs}->{authdb}" or die $!;
- while(<PASSWD>) {
- if (m{^\Q$user\E:(.*)}) {
- if (crypt($user, $1) eq $1) {
- $auth_ok = 1;
- }
- };
- }
- unless ($auth_ok) {
+
+ my $authdb = $cfg->{gitcvs}->{authdb};
+
+ unless (-e $authdb) {
+ print "E The authentication database specified in [gitcvs.authdb] does not exist\n";
+ print "I HATE YOU\n";
+ exit 1;
+ }
+
+ my $auth_ok;
+ open my $passwd, "<", $authdb or die $!;
+ while (<$passwd>) {
+ if (m{^\Q$user\E:(.*)}) {
+ if (crypt($user, descramble($password)) eq $1) {
+ $auth_ok = 1;
+ }
+ };
+ }
+ close $passwd;
+
+ unless ($auth_ok) {