Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_pass.c
index 2087118d6b2400dddb256f744238d431e75b6ef7..d25d8a93f5ed9264de3a3cb9ff0a55f85aa5fe57 100644 (file)
  *            note:   it is guaranteed that parv[0]..parv[parc-1] are all
  *                    non-NULL pointers.
  */
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
+#include "config.h"
+
 #include "client.h"
+#include "ircd_log.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "send.h"
 
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 
 /*
  * mr_pass - registration message handler
  */
-int m_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
+int mr_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 {
   const char* password = parc > 1 ? parv[1] : 0;
 
@@ -108,31 +103,12 @@ int m_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (EmptyString(password))
     return need_more_params(cptr, "PASS");
 
-  ircd_strncpy(cptr->passwd, password, PASSWDLEN);
-  return 0;
-}
-
+  /* TODO: For protocol negotiation */
 #if 0
-/*
- * m_pass
- *
- * parv[0] = sender prefix
- * parv[1] = password
- */
-int m_pass(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  char *password = parc > 1 ? parv[1] : 0;
-
-  if (EmptyString(password))
-    return need_more_params(cptr, "PASS");
-
-  if (!MyConnect(sptr) || (!IsUnknown(cptr) && !IsHandshake(cptr)))
-  {
-    sendto_one(cptr, err_str(ERR_ALREADYREGISTRED), me.name, parv[0]); /* XXX DEAD */
-    return 0;
+  if (ircd_strcmp(password,"PROT")==0) {
+       /* Do something here */
   }
-  ircd_strncpy(cptr->passwd, password, PASSWDLEN);
+#endif
+  ircd_strncpy(cli_passwd(cptr), password, PASSWDLEN);
   return 0;
 }
-#endif
-