[LON-CAPA-cvs] cvs: loncom / lond

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 18 Dec 2002 20:43:29 -0000


matthew		Wed Dec 18 15:43:29 2002 EDT

  Modified files:              
    /loncom	lond 
  Log:
  Fixes Bug 1071 (sort of): Added logging of krb4 authentication errors
  other than bad password.
  
  
Index: loncom/lond
diff -u loncom/lond:1.103 loncom/lond:1.104
--- loncom/lond:1.103	Wed Oct 30 09:50:04 2002
+++ loncom/lond	Wed Dec 18 15:43:29 2002
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.103 2002/10/30 14:50:04 www Exp $
+# $Id: lond,v 1.104 2002/12/18 20:43:29 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -721,13 +721,22 @@
 			      }
 			      }
                           } elsif ($howpwd eq 'krb4') {
-                             $null=pack("C",0);
-			     unless ($upass=~/$null/) {
-                              $pwdcorrect=(
-                                 Authen::Krb4::get_pw_in_tkt($uname,"",
-                                        $contentpwd,'krbtgt',$contentpwd,1,
-							     $upass) == 0);
-			     } else { $pwdcorrect=0; }
+                              $null=pack("C",0);
+                              unless ($upass=~/$null/) {
+                                  my $krb4_error = &Authen::Krb4::get_pw_in_tkt
+                                      ($uname,"",$contentpwd,'krbtgt',
+                                       $contentpwd,1,$upass);
+                                  if (!$krb4_error) {
+                                      $pwdcorrect = 1;
+                                  } else { 
+                                      $pwdcorrect=0; 
+                                      # log error if it is not a bad password
+                                      if ($krb4_error != 62) {
+       &logthis('krb4:'.$uname.','.$contentpwd.','.
+                &Authen::Krb4::get_err_txt($Authen::Krb4::error));
+                                      }
+                                  }
+                              }
                           } elsif ($howpwd eq 'krb5') {
 			      $null=pack("C",0);
 			      unless ($upass=~/$null/) {