Author: Isomer <isomer@undernet.org>
[ircu2.10.12-pk.git] / ircd / umkpasswd.c
index aa2f7f63f49d0798092d7ac5c3df9babee4d7bcd..d3ef4e5b2fa9e400963109f756ad6fe534628447 100644 (file)
 umkpasswd_conf_t* umkpasswd_conf;
 crypt_mechs_t* crypt_mechs_root;
 int log_inassert = 0;
+time_t CurrentTime;
+
+void sendto_opmask_butone(struct Client *one, unsigned int mask,
+                         const char *pattern, ...)
+{
+  /* only needed with memdebug, which also calls Debug() */
+}
 
 void copyright(void)
 {
@@ -113,7 +120,7 @@ char *make_salt(const char *salts)
 char *tmp = NULL;
 long int n = 0;
 
- /* try and get around them running this time after time in quick sucession */
+ /* try and get around them running this time after time in quick succession */
  sleep(1);
  srandom((unsigned int)time(NULL));
 
@@ -133,12 +140,12 @@ long int n = 0;
 return tmp;
 }
 
-/* our implemenation of ircd_crypt_register_mech() */
+/* our implementation of ircd_crypt_register_mech() */
 int ircd_crypt_register_mech(crypt_mech_t* mechanism)
 {
 crypt_mechs_t* crypt_mech;
 
- Debug((DEBUG_INFO, "ircd_crypt_register_mech: resistering mechanism: %s", mechanism->shortname));
+ Debug((DEBUG_INFO, "ircd_crypt_register_mech: registering mechanism: %s", mechanism->shortname));
 
  /* try to allocate some memory for the new mechanism */
  if ((crypt_mech = (crypt_mechs_t*)MyMalloc(sizeof(crypt_mechs_t))) == NULL)
@@ -168,7 +175,7 @@ crypt_mechs_t* crypt_mech;
  }
 
  /* we're done */
- Debug((DEBUG_INFO, "ircd_crypt_register_mech: resistered mechanism: %s, crypt_function is at 0x%X.", crypt_mech->mech->shortname, &crypt_mech->mech->crypt_function));
+ Debug((DEBUG_INFO, "ircd_crypt_register_mech: registered mechanism: %s, crypt_function is at 0x%X.", crypt_mech->mech->shortname, &crypt_mech->mech->crypt_function));
  Debug((DEBUG_INFO, "ircd_crypt_register_mech: %s: %s", crypt_mech->mech->shortname, crypt_mech->mech->description));
 
 return 0;
@@ -303,7 +310,7 @@ char* salt, *untagged, *tagged;
  salt = make_salt(default_salts);
 
  untagged = (char *)CryptFunc(crypt_mech->mech)(pw, salt);
- tagged = (char *)MyMalloc(strlen(salt)+CryptTokSize(crypt_mech->mech)+1);
+ tagged = (char *)MyMalloc(strlen(untagged)+CryptTokSize(crypt_mech->mech)+1);
  memset(tagged, 0, strlen(untagged)+CryptTokSize(crypt_mech->mech)+1);
  strncpy(tagged, CryptTok(crypt_mech->mech), CryptTokSize(crypt_mech->mech));
  strncpy(tagged+CryptTokSize(crypt_mech->mech), untagged, strlen(untagged));
@@ -349,9 +356,9 @@ const char* options = "a:d:lm:u:y:5:";
    break;
 
    case 'u':
-    if(umkpasswd_conf->flags && ACT_UPDOPER)
+    if(umkpasswd_conf->flags & ACT_ADDOPER)
     {
-     fprintf(stderr, "-a and -u are mutually exclussive.  Use either or neither.\n");
+     fprintf(stderr, "-a and -u are mutually exclusive.  Use either or neither.\n");
      abort(); /* b0rk b0rk b0rk */
     }
 
@@ -380,9 +387,9 @@ const char* options = "a:d:lm:u:y:5:";
    break;
 
    case 'a':
-    if(umkpasswd_conf->flags && ACT_UPDOPER) 
+    if(umkpasswd_conf->flags & ACT_UPDOPER) 
     {
-     fprintf(stderr, "-a and -u are mutually exclussive.  Use either or neither.\n");
+     fprintf(stderr, "-a and -u are mutually exclusive.  Use either or neither.\n");
      abort(); /* b0rk b0rk b0rk */
     }
 
@@ -393,7 +400,7 @@ const char* options = "a:d:lm:u:y:5:";
    default:
     /* unknown option - spit out syntax and b0rk */
     show_help();
-    abort();
+    exit(1);
    break;
   }
  }