Apply hikari's pluggable crypt mechanism patch
[ircu2.10.12-pk.git] / ircd / m_oper.c
index 002b36d90a8e937c800bcc408d9b3ae45daa293a..a180c0559f22bc77160a388dba7c19d050f4d10f 100644 (file)
@@ -88,7 +88,7 @@
 #include "ircd_log.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
-#include "ircd_xopen.h"
+#include "ircd_crypt.h"
 #include "msg.h"
 #include "numeric.h"
 #include "numnicks.h"
@@ -114,10 +114,15 @@ int oper_password_match(const char* to_match, const char* passwd)
   if (!to_match || !passwd)
     return 0;
 
-  if (feature_bool(FEAT_CRYPT_OPER_PASSWORD))
-    to_match = ircd_crypt(to_match, passwd);
+  /* we no longer do a CRYPT_OPER_PASSWORD check because a clear 
+     text passwords just handled by a fallback mechanism called 
+     crypt_clear if it's enabled -- hikari */
+  to_match = ircd_crypt(to_match, passwd);
 
-  return (0 == strcmp(to_match, passwd));
+  if (to_match == NULL)
+   return 0;
+  else
+   return (0 == strcmp(to_match, passwd));
 }
 
 /*