]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Improve the debug logging for httpd_acl auth attempts.
authorSadie Powell <sadie@witchery.services>
Sat, 17 Apr 2021 17:04:50 +0000 (18:04 +0100)
committerSadie Powell <sadie@witchery.services>
Sat, 17 Apr 2021 17:04:50 +0000 (18:04 +0100)
src/modules/m_httpd_acl.cpp

index 533e3c578807e2acd012668407d50ca05d8ce522..197bf589ef999ac82600ffc7216fe3bf5bebf36d 100644 (file)
@@ -200,20 +200,30 @@ class ModuleHTTPAccessList : public Module, public HTTPACLEventListener
                                                                                return true;
                                                                        }
                                                                        else
+                                                                       {
                                                                                /* Invalid password */
+                                                                               ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "HTTP authorization: password and username do not match");
                                                                                BlockAccess(http, 401, "WWW-Authenticate", "Basic realm=\"Restricted Object\"");
+                                                                       }
                                                                }
                                                                else
+                                                               {
                                                                        /* Malformed user:pass pair */
+                                                                       ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "HTTP authorization: password and username malformed");
                                                                        BlockAccess(http, 401, "WWW-Authenticate", "Basic realm=\"Restricted Object\"");
+                                                               }
                                                        }
                                                        else
+                                                       {
                                                                /* Unsupported authentication type */
+                                                               ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "HTTP authorization: unsupported auth type: %s", authtype.c_str());
                                                                BlockAccess(http, 401, "WWW-Authenticate", "Basic realm=\"Restricted Object\"");
+                                                       }
                                                }
                                                else
                                                {
                                                        /* No password given at all, access denied */
+                                                       ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "HTTP authorization: password and username not sent");
                                                        BlockAccess(http, 401, "WWW-Authenticate", "Basic realm=\"Restricted Object\"");
                                                }
                                                return false;