Capturing ntlm_auth failure reasons in rlm_mschap
    Garber, Neal 
    Neal.Garber at energyeast.com
       
    Fri Oct 13 07:34:45 CEST 2006
    
    
  
Oops!  I pasted the wrong version of the patch in my previous msg.
Please ignore the previous as it had a typo in the if stmt. comparing
for a newline..  
 
--- src/modules/rlm_mschap/rlm_mschap.c.orig    Tue Oct  3 17:46:50 2006
+++ src/modules/rlm_mschap/rlm_mschap.c Thu Oct 12 15:36:04 2006
@@ -786,6 +786,9 @@
        } else {                /* run ntlm_auth */
                int     result;
                char    buffer[256];
+               VALUE_PAIR      *module_fmsg_vp;
+               char    module_fmsg[MAX_STRING_LEN];
+               int             module_fmsg_lastchr = 0;
 
                memset(nthashhash, 0, 16);
 
@@ -798,6 +801,13 @@
                                             NULL, NULL, 1);
                if (result != 0) {
                        DEBUG2("  rlm_mschap: External script failed.");
+                       snprintf(module_fmsg, sizeof(module_fmsg),
"rlm_mschap: %s", buffer);
+                       module_fmsg_lastchr = strlen(module_fmsg)-1;
+                       if (module_fmsg[module_fmsg_lastchr] == '\n') {
+                               module_fmsg[module_fmsg_lastchr] = '\0';
+                       }
+                       module_fmsg_vp =
pairmake("Module-Failure-Message", module_fmsg, T_OP_EQ);
+                       pairadd(&request->packet->vps, module_fmsg_vp);
                        return -1;
                }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20061013/bc2d6058/attachment.html>
    
    
More information about the Freeradius-Devel
mailing list