Просмотр исходного кода

Merge branch 'remove-salt-generation' into maint

* remove-salt-generation:
  * Don't generate SALTS if missing during initialization

Conflicts:
	doc/UPDATES
Bryan Drewery 17 лет назад
Родитель
Сommit
1d639ba808
2 измененных файлов с 1 добавлено и 19 удалено
  1. 1 0
      doc/UPDATES
  2. 0 19
      src/binary.c

+ 1 - 0
doc/UPDATES

@@ -2,6 +2,7 @@
 * Make errors non-obscure. (Compile with OBSCURE_ERRORS to re-enable)
 * EFnet server list updates
 * Fix uname checking on NetBSD and OpenBSD
+* Binary will no longer generate SALTS if missing from the PackConfig. This was causing too much confusion.
 
 1.2.16 - http://wraith.botpack.net/milestone/1.2.16
 * Add 'set altchars' so that alternative characters used for nicks can be changed. (fixes #418)

+ 0 - 19
src/binary.c

@@ -350,25 +350,6 @@ readcfg(const char *cfgfile)
   }
   if (f)
     fclose(f);
-  if (!settings.salt1[0] || !settings.salt2[0]) {
-    /* Write salts back to the cfgfile */
-    char salt1[SALT1LEN + 1] = "", salt2[SALT2LEN + 1] = "";
-
-    printf(STR("Creating Salts"));
-    if ((f = fopen(cfgfile, "a")) == NULL) {
-      printf(STR("Cannot open cfgfile for appending.. aborting\n"));
-      exit(1);
-    }
-    make_rand_str(salt1, SALT1LEN);
-    make_rand_str(salt2, SALT2LEN);
-    salt1[sizeof salt1 - 1] = salt2[sizeof salt2 - 1] = 0;
-    strlcpy(settings.salt1, salt1, sizeof(settings.salt1));
-    strlcpy(settings.salt2, salt2, sizeof(settings.salt2));
-    fprintf(f, STR("SALT1 %s\n"), salt1);
-    fprintf(f, STR("SALT2 %s\n"), salt2);
-    fflush(f);
-    fclose(f);
-  }
   printf(STR(" Success\n"));
   return 1;
 }