]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_pas2.c
* Renamed "dynloader" to "serv_extensions" globally. We don't want people
[citadel.git] / citadel / serv_pas2.c
index f5dd1532d9a1100bf845f336c886b47be0d6efdd..bae7fa347d19ef810df7e35e6a1540aac2eb446c 100644 (file)
@@ -6,7 +6,18 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 #include <ctype.h>
 #include <string.h>
 #include <errno.h>
@@ -15,7 +26,7 @@
 #include "server.h"
 #include "citserver.h"
 #include "support.h"
-#include "dynloader.h"
+#include "serv_extensions.h"
 #include "user_ops.h"
 #include "md5.h"
 #include "tools.h"
@@ -23,7 +34,7 @@
 
 void cmd_pas2(char *argbuf)
 {
-       char pw[256];
+       char pw[SIZ];
        char hexstring[MD5_HEXSTRING_SIZE];
        
 
@@ -52,11 +63,11 @@ void cmd_pas2(char *argbuf)
        
        if (strlen(pw) != (MD5_HEXSTRING_SIZE-1))
        {
-               cprintf("%d Auth string of length %d is the wrong length (should be %d).\n", ERROR, strlen(pw), MD5_HEXSTRING_SIZE-1);
+               cprintf("%d Auth string of length %ld is the wrong length (should be %d).\n", ERROR, (long)strlen(pw), MD5_HEXSTRING_SIZE-1);
                return;
        }
        
-       make_apop_string(CC->usersupp.password, CC->cs_nonce, hexstring);
+       make_apop_string(CC->usersupp.password, CC->cs_nonce, hexstring, sizeof hexstring);
        
        if (!strcmp(hexstring, pw))
        {
@@ -74,8 +85,8 @@ void cmd_pas2(char *argbuf)
 
 
 
-char *Dynamic_Module_Init(void)
+char *serv_pas2_init(void)
 {
         CtdlRegisterProtoHook(cmd_pas2, "PAS2", "APOP-based login");
-        return "$(RCSID)";
+        return "$Id$";
 }