Przeglądaj źródła

* The -2/-0 doesn't work right, will fix later

svn: 1413
Bryan Drewery 21 lat temu
rodzic
commit
b4190813a8
2 zmienionych plików z 5 dodań i 5 usunięć
  1. 1 3
      src/binary.c
  2. 4 2
      src/main.c

+ 1 - 3
src/binary.c

@@ -313,10 +313,8 @@ check_sum(const char *fname, const char *cfgfile)
       printf("* Wrote settings to binary.\n"); 
       printf("* Wrote settings to binary.\n"); 
     exit(0);
     exit(0);
   } else {
   } else {
-    char *hash = NULL;
+    char *hash = bin_md5(fname, GET_MD5, &ctx);
 
 
-
-    hash = bin_md5(fname, GET_MD5, &ctx);
 /* tellconfig(&settings); */
 /* tellconfig(&settings); */
     edpack(&settings, hash, PACK_DEC);
     edpack(&settings, hash, PACK_DEC);
 /* tellconfig(&settings); */
 /* tellconfig(&settings); */

+ 4 - 2
src/main.c

@@ -364,6 +364,7 @@ static void dtx_arg(int argc, char *argv[])
 
 
         egg_strftime(date, sizeof date, "%c %Z", gmtime(&buildts));
         egg_strftime(date, sizeof date, "%c %Z", gmtime(&buildts));
 	printf("%s\nBuild Date: %s (%lu)\n", version, date, buildts);
 	printf("%s\nBuild Date: %s (%lu)\n", version, date, buildts);
+
         if (settings.uname[0]) {
         if (settings.uname[0]) {
           sdebug++;
           sdebug++;
           bin_to_conf();
           bin_to_conf();
@@ -704,12 +705,13 @@ printf("out: %s\n", out);
   binname = getfullbinname(argv[0]);
   binname = getfullbinname(argv[0]);
 
 
   /* This allows -2/-0 to be used without an initialized binary */
   /* This allows -2/-0 to be used without an initialized binary */
-  if (!(argc == 2 && (!strcmp(argv[1], "-2") || !strcmp(argv[1], "0")))) {
+//  if (!(argc == 2 && (!strcmp(argv[1], "-2") || !strcmp(argv[1], "0")))) {
+//  doesn't work correctly yet, if we don't go in here, our settings stay encrypted
     check_sum(binname, argc >= 3 && !strcmp(argv[1], "-p") ? argv[2] : NULL);
     check_sum(binname, argc >= 3 && !strcmp(argv[1], "-p") ? argv[2] : NULL);
 
 
     if (!checked_bin_buf)
     if (!checked_bin_buf)
       exit(1);
       exit(1);
-  }
+//  }
   /* Now settings struct is filled */
   /* Now settings struct is filled */