File dolly_fix_warning_and_hostname_resolution.patch of Package dolly.21740

diff -rau dolly-0.63.1/CHANGELOG dolly-0.63.1.patched/CHANGELOG
--- dolly-0.63.1/CHANGELOG	2021-02-09 16:44:50.000000000 +0100
+++ dolly-0.63.1.patched/CHANGELOG	2021-10-13 15:32:06.153722707 +0200
@@ -7,6 +7,17 @@
 
 History:
 
+V 0.63.6 13-OCT-2021 Antoine Ginies <aginies@suse.com>
+  fix hostname resolution is not done in case of usage
+  of an external configuration file (bsc#1191613)
+  fix -Werror=format-security
+
+V 0.63.5 07-OCT-2021 Antoine Ginies <aginies@suse.com>
+  improve help usage information
+
+V 0.63.4 11-SEP-2019 Christian Goll <cgoll@suse.com>
+  fixed warnings for gcc 11
+
 V 0.60 11-SEP-2019 Christian Goll <cgoll@suse.com>
   Added pure commandline feature, so that there is no need for
   a dolly configuration file. Also output to stdout is now possible.
diff -rau dolly-0.63.1/dolly.c dolly-0.63.1.patched/dolly.c
--- dolly-0.63.1/dolly.c	2021-02-09 16:44:50.000000000 +0100
+++ dolly-0.63.1.patched/dolly.c	2021-10-13 15:29:22.917457252 +0200
@@ -89,10 +89,10 @@
   fprintf(stderr, "using ctrl port %u\n", ctrlport);
   fprintf(stderr, "myhostname = '%s'\n", mydollytab->myhostname);
   if(mydollytab->segsize > 0) {
-    fprintf(stderr, "TCP segment size = %d\n", mydollytab->segsize);
+    fprintf(stderr, "TCP segment size = %u\n", mydollytab->segsize);
   }
   if(mydollytab->add_nr > 0) {
-    fprintf(stderr, "add_nr (extra network interfaces) = %d\n", mydollytab->add_nr);
+    fprintf(stderr, "add_nr (extra network interfaces) = %u\n", mydollytab->add_nr);
     if(mydollytab->add_mode == 1) {
       fprintf(stderr, "Postfixes: ");
     } else if(mydollytab->add_mode == 2) {
@@ -112,12 +112,12 @@
     fprintf(stderr, "%s", mydollytab->add_name[0]);
     fprintf(stderr, "\n");
   }
-  fprintf(stderr, "fanout = %d\n", mydollytab->fanout);
-  fprintf(stderr, "nr_childs = %d\n", mydollytab->nr_childs);
+  fprintf(stderr, "fanout = %u\n", mydollytab->fanout);
+  fprintf(stderr, "nr_childs = %u\n", mydollytab->nr_childs);
   fprintf(stderr, "server = '%s'\n", mydollytab->servername);
   fprintf(stderr, "I'm %sthe server.\n", (mydollytab->meserver ? "" : "not "));
   fprintf(stderr, "I'm %sthe last host.\n", (mydollytab->melast ? "" : "not "));
-  fprintf(stderr, "There are %d hosts in the ring (excluding server):\n",
+  fprintf(stderr, "There are %u hosts in the ring (excluding server):\n",
 	  mydollytab->hostnr);
   for(i = 0; i < mydollytab->hostnr; i++) {
     fprintf(stderr, "\t'%s'\n", mydollytab->hostring[i]);
@@ -173,7 +173,7 @@
 
   if(mydollytab->segsize > 0) {
     /* Attempt to set TCP_MAXSEG */
-    fprintf(stderr, "Set TCP_MAXSEG to %d bytes\n", mydollytab->segsize);
+    fprintf(stderr, "Set TCP_MAXSEG to %u bytes\n", mydollytab->segsize);
     if(setsockopt(datasock, IPPROTO_TCP, TCP_MAXSEG,
 		  &mydollytab->segsize, sizeof(int)) < 0) {
       (void) fprintf(stderr,"setsockopt: TCP_MAXSEG failed! errno=%d\n", errno);
@@ -182,7 +182,7 @@
   }
   
   /* Attempt to set input BUFFER sizes */
-  if(mydollytab->flag_v) { fprintf(stderr, "Buffer size: %d\n", SCKBUFSIZE); }
+  if(mydollytab->flag_v) { fprintf(stderr, "Buffer size: %u\n", SCKBUFSIZE); }
   if(setsockopt(datasock, SOL_SOCKET, SO_RCVBUF, &SCKBUFSIZE,sizeof(SCKBUFSIZE)) < 0) {
     (void) fprintf(stderr, "setsockopt: SO_RCVBUF failed! errno = %d\n",
 		   errno);
@@ -300,9 +300,9 @@
     }
     
     hent = gethostbyname(hn);
-    /*  (void)fprintf(stderr,"DEBUG gethostbyname on >%s<\n",hn); */
+    //(void)fprintf(stderr,"DEBUG gethostbyname on >%s<\n",hn);
     if(hent == NULL) {
-      char str[strlen(hn)];
+      char str[strlen(hn)+34];
       sprintf(str, "gethostbyname for host '%s' error %d",
 	      hn, h_errno);
       herror(str);
@@ -312,9 +312,9 @@
       fprintf(stderr, "Expected h_addrtype of AF_INET, got %d\n",
 	      hent->h_addrtype);
     }
-    
+
     if(mydollytab->flag_v) {
-      fprintf(stderr, "Connecting to host %s... ", hn);
+      fprintf(stderr, "Connecting to host %s...\n", hn);
       fflush(stderr);
     }
     
@@ -346,7 +346,7 @@
 
       if(mydollytab->segsize > 0) {
 	/* Attempt to set TCP_MAXSEG */
-        fprintf(stderr, "Set TCP_MAXSEG to %d bytes\n", mydollytab->segsize);
+        fprintf(stderr, "Set TCP_MAXSEG to %u bytes\n", mydollytab->segsize);
         if(setsockopt(dataout[i], IPPROTO_TCP, TCP_MAXSEG,
 		      &mydollytab->segsize, sizeof(int)) < 0) {
 	  (void) fprintf(stderr, "setsockopt: TCP_MAXSEG failed! errno = %d\n", 
@@ -360,7 +360,7 @@
       }
       getsockopt(dataout[i], SOL_SOCKET, SO_RCVBUF,
            (char *) &send_size, (void *) &sizeofint);
-      fprintf(stderr, "Send buffer %d is %d bytes\n", i, send_size);
+      //fprintf(stderr, "Send buffer %u is %d bytes\n", i, send_size);
 
       ///* Setup data port */
       addrdata.sin_family = hent->h_addrtype;
@@ -594,14 +594,14 @@
             p = info_buf;
             info_buf[ret] = 0;	
             if(mydollytab->flag_v) {
-              fprintf(stderr, info_buf);
+              fprintf(stderr, "%s", info_buf);
             }
             while((p = strstr(p, "ready")) != NULL) {
               ready_mach++;
               p++;
             }
             fprintf(stderr,
-              "Machines left to wait for: %d\n", mydollytab->hostnr - ready_mach);
+              "Machines left to wait for: %u\n", mydollytab->hostnr - ready_mach);
           }
         }
       } /* For all childs */
@@ -635,39 +635,48 @@
 
 static void usage(void) {
   fprintf(stderr, "\n");
+  fprintf(stderr, "Dolly version: %s\n", version_string);
+  fprintf(stderr, "\n");
+  fprintf(stderr, "Dolly is a program to clone disks / partitions / data. It takes same amount of time to copy data to one node or to X nodes.\n");
+  fprintf(stderr, "\n");
   fprintf(stderr,
-	  "Usage: dolly [-hVvSsnYR] [-c <size>] [-b <size>] [-u <size>] [-d] [-f configfile] "
-	  "[-o logfile] [-t time] -I [inputfile] -O [outpufile] -H [hostnames]\n");
+	  "Usage: dolly [-hVvSsnYR] [-c <size>] [-b <size>] [-u <size>] [-f configfile] "
+	  "[-o logfile] [-t time] -I [inputfile] -O [outpufile] -H [node1,node2,node3...]\n");
+  fprintf(stderr, "\n");
+  fprintf(stderr, "\tWithout any -s or -S option dolly will be a client\n");
   fprintf(stderr, "\t-s: this is the server, check hostname\n");
   fprintf(stderr, "\t-S <hostname>: use hostname as server\n");
   fprintf(stderr, "\t-R: resolve the hostnames to ipv4 addresses\n");
   fprintf(stderr, "\t-6: resolve the hostnames to ipv6 addresses\n");
-  fprintf(stderr, "\t-v: verbose\n");
-  fprintf(stderr, "\t-b <size>, where size is the size of block to transfer (default 4096)\n");
-  fprintf(stderr, "\t-u <size>, size of the buffer (multiple of 4K)\n");
-  fprintf(stderr, "\t-c <size>, where size is uncompressed size of "
-	  "compressed inputfile\n\t\t(for statistics only)\n");
-
+  fprintf(stderr, "\t-V: Print version number and exit\n");
+  fprintf(stderr, "\t-h: Print this help and exit\n");
+  fprintf(stderr, "\t-v: Verbose mode\n");
+  fprintf(stderr, "\t-q: Suppresss \"ignored signal\" messages\n");
   fprintf(stderr, "\t-f <configfile>, where <configfile> is the "
 	  "configuration file with all\n\t\tthe required information for "
 	  "this run. Required on server only.\n");
   fprintf(stderr, "\t-o <logfile>: Write some statistical information  "
 	  "in <logfile>\n");
-  fprintf(stderr, "\t-r <n>: Retry to connect to mode n times\n");
   fprintf(stderr, "\t-a <timeout>: Lets dolly terminate if it could not transfer\n\t\tany data after <timeout> seconds.\n");
   fprintf(stderr, "\t-n: Do not sync before exit. Dolly exits sooner.\n");
-  fprintf(stderr, "\t    Data may not make it to disk if power fails soon after dolly exits.\n");
-  fprintf(stderr, "\t-h: Print this help and exit\n");
-  fprintf(stderr, "\t-q: Suppresss \"ignored signal\" messages\n");
-  fprintf(stderr, "\t-V: Print version number and exit\n");
+  fprintf(stderr, "\t    Data may not make it to disk if power fails soon after dolly exits.\n\n");
   fprintf(stderr, "\tFollowing options can be used instead of a dollytab and\n");
-  fprintf(stderr, "\timply the -S or -s option which must me prceeded.\n");
+  fprintf(stderr, "\timply the -S or -s option which must me preceded:\n");
   fprintf(stderr, "\t-H: comma seperated list of the hosts to send to\n");
   fprintf(stderr, "\t-I: input file\n");
-  fprintf(stderr, "\t-O: output file (just - for output to stdout)\n");
-  fprintf(stderr, "version: %s\n",version_string);
-  fprintf(stderr, "\nDolly was part of the ETH Patagonia cluster project, ");
+  fprintf(stderr, "\t-O: output file (just - for output to stdout)\n\n");
+  fprintf(stderr, "\tCustomize network transfer:\n");
+  fprintf(stderr, "\t-b <size>, where size is the size of block to transfer (default 4096)\n");
+  fprintf(stderr, "\t-u <size>, size of the buffer (multiple of 4K)\n");
+  fprintf(stderr, "\t-c <size>, where size is uncompressed size of "
+	  "compressed inputfile\n\t\t(for statistics only)\n");
   fprintf(stderr, "\n");
+  fprintf(stderr, "Example of usage:\n");
+  fprintf(stderr, "On client:\n");
+  fprintf(stderr, "\tdolly -v\n");
+  fprintf(stderr, "\n");
+  fprintf(stderr, "On server:\n");
+  fprintf(stderr, "\tdolly -s -H sle15sp32,sle15sp33,sle15sp34 -I files.tgz -O /tmp/files.tgz\n");
   exit(1);
 }
 
@@ -700,7 +709,7 @@
       flag_f = 1;
       break;
     case 'R':
-      if(mydollytab->resolve != 6 || mydollytab->resolve != 4) {
+      if(mydollytab->resolve != 6 && mydollytab->resolve != 4) {
         mydollytab->resolve = 1;
       }
       break;
@@ -749,12 +758,12 @@
         fprintf(stderr,"'%s' is not a valid servername\n",optarg);
         exit(1);
       }
-      strncpy(mydollytab->servername,optarg,strlen(optarg));
+      memcpy(mydollytab->servername,optarg,strlen(optarg));
       break;
     case 'a':
       i = atoi(optarg);
-      if(i <= 0) {
-        fprintf(stderr, "Timeout of %d doesn't make sense.\n", i);
+      if((int)i <= 0) {
+        fprintf(stderr, "Timeout of %u doesn't make sense.\n", i);
         exit(1);
       }
       timeout = i;
@@ -786,7 +795,7 @@
         fprintf(stderr,"the -S/-s must preceed the -I option\n");
         exit(1);
       }
-      strncpy(mydollytab->infile,optarg,strlen(optarg)); 
+      memcpy(mydollytab->infile,optarg,strlen(optarg));
       flag_cargs = 1;
       break;
 
@@ -799,7 +808,7 @@
         fprintf(stderr,"the -S/-s must preceed the -O option\n");
         exit(1);
       }
-      strncpy(mydollytab->outfile,optarg,strlen(optarg)); 
+      memcpy(mydollytab->outfile,optarg,strlen(optarg));
       flag_cargs = 1;
       break;
 
@@ -833,7 +842,7 @@
            inet_pton(AF_INET,host_str,&(sock_address.sin_addr)) == 1 &&
            inet_pton(AF_INET6,host_str,&(sock_address.sin_addr)) == 1) {
           mydollytab->hostring[nr_hosts] = (char *)malloc(strlen(host_str)+1);
-          strncpy(mydollytab->hostring[nr_hosts], host_str,strlen(host_str));
+          memcpy(mydollytab->hostring[nr_hosts], host_str,strlen(host_str));
         } else { 
           /* get memory for ip address */
           ip_addr = (char*)malloc(sizeof(char)*256);
@@ -892,7 +901,8 @@
       fprintf(stderr, "Unknown option '%c'.\n", c);
       exit(1);
     }
-    if(flag_cargs) {
+ // always do hostname resolution
+ //   if(flag_cargs) {
       /* only use HOST when servername or ip is not explictly set */
       if(strcmp(mydollytab->servername,"") == 0) {
         mnname = getenv("HOST");
@@ -902,12 +912,12 @@
             fprintf(stderr,"Could resolve the server address '%s'\n",mydollytab->servername);
             exit(1);
           }
-          strncpy(mydollytab->myhostname,ip_addr,strlen(ip_addr));
-          strncpy(mydollytab->servername,ip_addr,strlen(ip_addr));
+          memcpy(mydollytab->myhostname,ip_addr,strlen(ip_addr));
+          memcpy(mydollytab->servername,ip_addr,strlen(ip_addr));
           free(ip_addr);
         } else {
-          strncpy(mydollytab->myhostname,mnname,strlen(mnname));
-          strncpy(mydollytab->servername,mnname,strlen(mnname));
+          memcpy(mydollytab->myhostname,mnname,strlen(mnname));
+          memcpy(mydollytab->servername,mnname,strlen(mnname));
         }
       } else {
         /* check if we allready have a valid ip address */
@@ -919,15 +929,15 @@
             fprintf(stderr,"Could resolve the server address '%s'\n",mydollytab->servername);
             exit(1);
           }
-          strncpy(mydollytab->servername,ip_addr,strlen(ip_addr));
-          strncpy(mydollytab->myhostname,ip_addr,strlen(ip_addr));
+          memcpy(mydollytab->servername,ip_addr,strlen(ip_addr));
+          memcpy(mydollytab->myhostname,ip_addr,strlen(ip_addr));
           free(ip_addr);
         } else {
-          strncpy(mydollytab->myhostname,mydollytab->servername,strlen(mydollytab->servername));
+          memcpy(mydollytab->myhostname,mydollytab->servername,strlen(mydollytab->servername));
         }
       }
 
-    }
+//    }
     if(flag_f && !flag_cargs) {
       /* Open the config-file */
       df = fopen(optarg, "r");
@@ -969,7 +979,7 @@
       fprintf(df,"server %s\n",mydollytab->myhostname);
       fprintf(df,"firstclient %s\n",mydollytab->hostring[0]);
       fprintf(df,"lastclient %s\n",mydollytab->hostring[nr_hosts-1]);
-      fprintf(df,"clients %i\n",mydollytab->hostnr);
+      fprintf(df,"clients %u\n",mydollytab->hostnr);
       for(i = 0; i < mydollytab->hostnr; i++) {
         fprintf(df,"%s\n",mydollytab->hostring[i]);
         fprintf(stderr,"writing '%s'\n'",mydollytab->hostring[i]);
@@ -1027,7 +1037,6 @@
   for(i = 0; i < mydollytab->hostnr; i++) {
     free(mydollytab->hostring[i]);
   }
-  free(mydollytab->dollybuf);
   free(mydollytab->hostring);
   free(mydollytab);
  
Only in dolly-0.63.1.patched: dolly_cloning_process.jpg
Only in dolly-0.63.1.patched: dolly_cloning_process.svg
diff -rau dolly-0.63.1/dolly.h dolly-0.63.1.patched/dolly.h
--- dolly-0.63.1/dolly.h	2021-02-09 16:44:50.000000000 +0100
+++ dolly-0.63.1.patched/dolly.h	2021-10-13 15:32:40.313778252 +0200
@@ -1,6 +1,6 @@
 #ifndef DOLLY_H
 #define DOLLY_H
-static const char version_string[] = "0.63, 2-FEB-2020";
+static const char version_string[] = "0.63.6, 13-OCT-2021";
 
 #include <unistd.h>
 #include <stdio.h>
Only in dolly-0.63.1: dolly.html
diff -rau dolly-0.63.1/dollytab.c dolly-0.63.1.patched/dollytab.c
--- dolly-0.63.1/dollytab.c	2021-02-09 16:44:50.000000000 +0100
+++ dolly-0.63.1.patched/dollytab.c	2021-10-07 10:26:38.378378760 +0200
@@ -342,7 +342,7 @@
   }
   mydollytab->hostnr = atoi(str+8);
   if((mydollytab->hostnr < 1) || (mydollytab->hostnr > MAXHOSTS)) {
-    fprintf(stderr, "I think %d numbers of hosts doesn't make much sense.\n",
+    fprintf(stderr, "I think %u numbers of hosts doesn't make much sense.\n",
 	    mydollytab->hostnr);
     exit(1);
   }
@@ -355,7 +355,7 @@
   for(i = 0; i < mydollytab->hostnr; i++) {
     if(fgets(str, 256, df) == NULL) {
       char errstr[256];
-      sprintf(errstr, "gets for host %d", i);
+      sprintf(errstr, "gets for host %u", i);
       perror(errstr);
       exit(1);
     }
diff -rau dolly-0.63.1/files.c dolly-0.63.1.patched/files.c
--- dolly-0.63.1/files.c	2021-02-09 16:44:50.000000000 +0100
+++ dolly-0.63.1.patched/files.c	2021-10-07 10:26:38.382378768 +0200
@@ -16,7 +16,7 @@
     }
   }
   if(mydollytab->input_split != 0) {
-    sprintf(name, "%s_%d", mydollytab->infile, input_nr);
+    sprintf(name, "%s_%u", mydollytab->infile, input_nr);
   } else {
     strcpy(name, mydollytab->infile);
   }
@@ -27,7 +27,7 @@
     input = open(name, O_RDONLY);
     if(input == -1) {
       if(try_hard == 1) {
-        char str[strlen(name)];
+        char str[strlen(name)+18];
         sprintf(str, "open inputfile '%s'", name);
         perror(str);
         exit(1);
@@ -39,7 +39,7 @@
     /* Input should be compressed first. */
     if(access(name, R_OK) == -1) {
       if(try_hard == 1) {
-        char str[strlen(name)];
+        char str[strlen(name)+18];
         sprintf(str, "open inputfile '%s'", name);
         perror(str);
         exit(1);
@@ -57,13 +57,13 @@
       /* Here's the child. */
       close(id[0]);
       close(1);
-      dup(id[1]);
+      (void) !dup(id[1]);
       close(id[1]);
       if((fd = open(name, O_RDONLY)) == -1) {
         exit(1);
       }
       close(0);
-      dup(fd);
+      (void) !dup(fd);
       close(fd);
       if(execl("/usr/bin/gzip", "gzip", "-cf", NULL) == -1) {
         perror("execl for gzip in child");
@@ -90,7 +90,7 @@
     }
   }
   if(mydollytab->output_split != 0) {
-    sprintf(name, "%s_%d", mydollytab->outfile, output_nr);
+    sprintf(name, "%s_%u", mydollytab->outfile, output_nr);
   } else {
     strcpy(name, mydollytab->outfile);
   }
@@ -117,7 +117,7 @@
       output = open(name, O_WRONLY | O_CREAT | O_EXCL, 0644);
     }
     if(output == -1) {
-      char str[strlen(name)];
+      char str[strlen(name)+19];
       sprintf(str, "open outputfile '%s'", name);
       perror(str);
       exit(1);
@@ -125,7 +125,7 @@
   } else { /* Compressed_In */
     if(access(name, W_OK) == -1) {
       if(try_hard == 1) {
-        char str[strlen(name)];
+        char str[strlen(name)+19];
         sprintf(str, "open outputfile '%s'", name);
         perror(str);
         exit(1);
@@ -144,7 +144,7 @@
       /* Here's the child! */
       close(pd[1]);
       close(0);      /* Close stdin */
-      dup(pd[0]);    /* Duplicate pipe on stdin */
+      (void) !dup(pd[0]);    /* Duplicate pipe on stdin */
       close(pd[0]);  /* Close the unused end of the pipe */
       if((fd = open(name, O_WRONLY)) == -1) {
         if(errno == ENOENT) {
@@ -154,7 +154,7 @@
         exit(1);
       }
       close(1);
-      dup(fd);
+      (void) !dup(fd);
       close(fd);
       /* Now stdout is redirected to our file */
       if(execl("/usr/bin/gunzip", "gunzip", "-c", NULL) == -1) {
diff -rau dolly-0.63.1/Makefile dolly-0.63.1.patched/Makefile
--- dolly-0.63.1/Makefile	2021-02-09 16:44:50.000000000 +0100
+++ dolly-0.63.1.patched/Makefile	2021-10-13 15:29:38.137482002 +0200
@@ -1,7 +1,7 @@
 CXX = g++
 CC = gcc
-CFLAGS += -std=gnu11 -s -O -fPIE
-WARNINGS = -Werror -Wall -Wextra -pedantic-errors 
+CFLAGS += -std=gnu11 -s -O -fPIE $(RPM_OPT_FLAGS)
+WARNINGS = -Werror -Wall -Wextra -pedantic-errors
 LDFLAGS =
 LIBRARIES =
 BUILD_DIR = ./build
@@ -10,12 +10,19 @@
 DEPS = $(SOURCES:%.c=$(BUILD_DIR)/%.d)
 # Can 
 DEBUGFLAGS=-ggdb
+VERSION=0.63.6
 
 
 EXECUTABLE = dolly
 
 all: $(EXECUTABLE)
 
+tar: clean
+	mkdir $(EXECUTABLE)-$(VERSION)
+	find . -maxdepth 1 -type f -exec cp -a {} $(EXECUTABLE)-$(VERSION) \;
+	tar cfj $(EXECUTABLE)-$(VERSION).tar.bz2 $(EXECUTABLE)-$(VERSION)
+	rm -rf $(EXECUTABLE)-$(VERSION)
+
 $(BUILD_DIR)/%.d: %.c
 	@mkdir -p $(dir $@)
 	$(CC) $< -MT $(BUILD_DIR)/$*.o -MM -MF $(BUILD_DIR)/$*.d
@@ -32,5 +39,6 @@
 
 clean:
 	rm -rf $(EXECUTABLE) $(OBJECTS) $(DEPS)
+	rm -rf $(EXECUTABLE)-$(VERSION) $(EXECUTABLE)-$(VERSION).tar.bz2
 
 -include $(DEPS)
diff -rau dolly-0.63.1/README.md dolly-0.63.1.patched/README.md
--- dolly-0.63.1/README.md	2021-02-09 16:44:50.000000000 +0100
+++ dolly-0.63.1.patched/README.md	2021-10-07 10:26:38.378378760 +0200
@@ -1,19 +1,16 @@
-%DOLLY(1) Version 0.60 | Dolly file transfer
-
 DOLLY
 =====
-A program to clone disks / partitions
+A program to clone disks / partitions / data.
+Take same amount of time to copy data to one node or to X nodes.
 
 SYNOPSIS
 ========
 
-|dolly| \[**-f** config\]
-  or
-|dolly| \[**-I** infile\] \[**-O** outfile\|-\] \[**-H** hostlist\] 
-
+dolly \[**-f** config\]
 
-11 Sept 2019
+dolly \[**-I** infile\] \[**-O** outfile\|-\] \[**-H** hostlist\] 
 
+dolly **-v** **-r** 40 **-S** SERVERIP **-H** IPNODE1,IPNODE2,IPNODE3 **-I** /dev/vdd **-O** /dev/vdd
 
 DESCRIPTION
 ===========
@@ -24,63 +21,68 @@
 drives. As it forms a "virtual TCP ring" to distribute data, it works
 best with fast switched networks.
 
-As dolly clones whole partitions block-wise it works for most
-boot setups).
+As dolly clones whole partitions block-wise.
 
 OPTIONS
 =======
 If used without a configuration file following three commanline options must be
 set:
 
--I FILE : FILE is used as input file.
+**-I** FILE : FILE is used as input file.
 
--O FILE\|- : FILE will be used as output file, if '-' is used as FILE, the
+**-O** FILE\|- : FILE will be used as output file, if '-' is used as FILE, the
 output will printed to stdout.
 
--H HOSTLIST: A comma seperated hostlist, where then the first host of the list
+**-H** HOSTLIST: A comma seperated hostlist, where then the first host of the list
 is used as firstclient and the last host  as lastclient, like in the
 configuration file.
 
 Following other options are:
 
-  -h
+  **-h**
  :   Prints a short help and exits.
 
-  -V
+  **-V**
  :   Prints the version number as well as the date of that version and exits.
 
-  -v
+  **-v**
  :  This switches to verbose mode in which dolly prints out a little
     bit more information. This option is recommended if you want to
     know what's going on during cloning and it might be helpful during
     debugging.
 
-  -s
+  **-s**
  :  This option specifies the server machine and should only be used
     on the master. Dolly will warn you if the config file specifies
     another master than the machine on which this option is set.
     This option must be secified before the "-f" option!
 
-  -S
+  **-S**
  :  Same as "-s", but dolly will not warn you if the server's hostname
     and the name specified in the config file do not match.
 
-  -q
+ **-R**
+ :  resolve the hostnames to ipv4 addresses
+
+ **-6**
+ :  resolve the hostnames to ipv6 addresses
+
+  **-q**
  :  Usually dolly will print a warning when the select() system call
     is interrupted by a signal. This option suppresses these warnings.
 
-  -c
+  **-c**
  :  With this option it is possible to specify the uncompressed size
     of a compressed file. It's only needed for performance statistics
     at the end of a cloning process and not important if you are not
     interested in the statistics.
 
-  -d
+  **-d**
  :  The "Dummy" option disables all disk accesses. It can be used to
     benchmark the throughput of your system (computers, network,
     switches). This option must be specified before the "-f" option!
 
-  -t <seconds>
+  **-t** <seconds>
  :  When in dummy mode, this option allows to specify how long the
     testrun should approximately take. Since the dummy mode is mostly
     used for benchmarking purposes and single runs might result in
@@ -89,12 +91,12 @@
     the run-lenght in seconds, as the benchmark-time becomes more
     predictable.
     
-  -f <config file>
+  **-f** <config file>
  :  This option is used to select the config file for this cloning
     process. This option makes only sense on the master machine and
     the configuration file must exist on the master.
 
-  -o <logfile>
+  **-o** <logfile>
  :  This option specifies the logfile. Dolly will write some
     statistical information into the logfile. it is mostly
     used when benchmarking switches. The format of the lines in the
@@ -102,7 +104,7 @@
     Trans. data  Segsize Clients Time      Dataflow  Agg. dataflow
     [MB]         [Byte]  [#]     [s]       [MB/s]    [MB/s]
 
-  -a <timeout>
+  **-a** <timeout>
  :  Sometimes it might be useful if Dolly would terminate instead of
     waiting indefinitely in case something goes wrong. This option
     lets you specify this timeout. If dolly could not transfer any
@@ -112,19 +114,20 @@
     you don't want to have dolly-processes hang around if a machine
     hangs.
 
-  -n
+  **-n**
  :  Do not sync() before exit. Thus, dolly will exit sooner, but data
     may not make it to disk if power fails soon after dolly exits.
 
-  -u <size>
+  **-u** <size>
  :  Specify the size of buffers for TCP sockets. Should be a Multiple
     of 4K.
 
-  -b <size>
- :  option to specify the TRANSFER_BLOCK_SIZE. Should be a multiple of
+  **-b** <size>
+ :  Option to specify the TRANSFER_BLOCK_SIZE. Should be a multiple of
     the size of buffers for TCP sockets.
 
-
+ **-r** <n>
+ :  Retry to connect to mode <n> times
 
 
 Configuration file
@@ -279,7 +282,7 @@
    EG: endconfig
 
 
-Note on nodes' hostnames
+Note on nodes hostnames
 ------------------------
 
 On some machines (e.g. with very small maintenance installations),
@@ -384,100 +387,8 @@
 
 CHANGES 
 =======
-version 0.2
-------------------
-
-We applied some changes to Dolly since version 0.2. Most of them are
-not very important.
-
-- Dolly as a benchmarking tool.
-  Dolly can now be used to benchmark your network. In the dummy mode,
-  Dolly will not access the hard disk, neither for reading nor for
-  writing. It just transfers data between your machines. This might be
-  useful for testing the throughput of your switch. The running time
-  for such a run can be specified with the "-t" option on the command
-  line. With the "-o" option you can specify a logfile where Dolly
-  will write some statistical information.
-
-- Using extra network interfaces.
-  It's now possible to use multiple network interfaces for the data
-  transfer. This is mostly useful if you have multiple network
-  interfaces with similar speeds, e.g. two fast ethernet networks (one
-  for administration/logins and the other for your applications
-  communication). For example: If your machines are connected with two
-  fast ethernet links, then you should be able to increase the
-  thourghput of the cloning process from 10 to 20 MB/s, therefore
-  cutting the cloning-time by half.
-  You need the "add" option in the config file to use this feature.
-  WARNING: This feature has only been tested with the linear network
-  topology (no fanout option or "fanout 1" option in the config file).
-
-- Different networking topologies.
-  We tried different topologies (binary trees, ternary trees, ...) to
-  get somre more results in a paper, but the initial multi-drop chain
-  (virtual TCP ring) is still the best. You will most likely not need
-  this feature.
-
-
-version 0.57
-------------
-
-Besides some bug-files and smaller improvements, it's now possible to
-split an image in multiple files for archival and send the
-multiple-file image to the clients. This allows to story arbitrary
-long partitions on file systems with a file size limit. For details
-and examples, see the section about the configuration file below
-(parameters infile and outfile).
-
-
-version 0.58
-------------
-
-Thanks to David Mathog, dolly is now able to read or write data from
-its standard input or to its standard output. That means that you can
-e.g. pipe a tar stream through dolly. Whether that feature is useful
-or not depends on your situation. By using tar (instead of cloning the
-whole partition) your disks' reads and writes will be slower, but you
-only transfer the data that is actually needed. This feature might be
-most useful in situations where e.g. your disks/partitions are mostly
-empty or have different sizes/geometries.
-
-Please note that version 0.58 has not yet been thoroughly tested (I'm
-no longer working with clusters). E.g. it is not yet clear what
-happens when somebody tries to reach you with the "write", "talk" or
-"wall" commands while dolly is running (which might potentially
-interfere with with your stdin/stdout, see below).
-
-Note also, that since all of dolly's output is now written to stderr
-(instead of stdout as before), some third-party scripts might no
-longer work.
-
-To use the feature, you should specify /dev/stdin as your infile
-and/or /dev/stdout as your outfile.
-
-
-version 0.58C
--------------
-
-Again, thanks to David Mathog, dolly can now be run without explicit
-sync() at the end of the cloning process (option "-n"). This can speed
-up dolly's runtime considerably when cloning smaller files, but there
-is no garantuee that the data actually made it to the disk if there is
-e.g. a power loss right after dolly finished.
-
-version 0.59
-------------
-
-Some output improvments and add some options to deal with socket and 
-buffer size to experiment some parameter on the fly. Done some cleanup
-in the C code to get less warning in building with recent GCC7.
-
-version 0.60
-------------
-
-Added pure commandline feature, so that there is no need for
-a dolly configuration file. Also output to stdout is now possible.
 
+See CHANGELOG file
 
 EXAMPLE
 =======
@@ -486,28 +397,31 @@
 node0..node15. We want to clone the partition sda5 from node0 to all
 other nodes. The configuration file (let's name it dollytab.cfg)
 should then look as follows:
-  infile /dev/sda5
-  outfile /dev/sda5
-  server node0
-  firstclient node1
-  lastclient node15
-  clients 15
-  node1
-  node2
-  node3
-  node4
-  node5
-  node6
-  node7
-  node8
-  node9
-  node10
-  node11
-  node12
-  node13
-  node14
-  node15
-  endconfig
+```
+infile /dev/sda5
+outfile /dev/sda5
+server node0
+firstclient node1
+lastclient node15
+clients 15
+node1
+node2
+node3
+node4
+node5
+node6
+node7
+node8
+node9
+node10
+node11
+node12
+node13
+node14
+node15
+endconfig
+```
+
 Next, we start Dolly on all the clients. No options are required for
 the clients (but you might want to add the "-v" option for verbose
 progress reports). Finally, Dolly is started on the server as follows:
@@ -527,7 +441,8 @@
 http://www.cs.inf.ethz.ch/~rauch/
 Felix Rauch <rauch@inf.ethz.ch>
 
-AUTHORS
-=======
-Antione Agienies <agienes@suse.com>
+AUTHORS / CONTRIBUTORS
+=======================
+Felix Rauch <rauch@inf.ethz.ch>
+Antoine Ginies <aginies@suse.com>
 Christian Goll <cgoll@suse.com>
diff -rau dolly-0.63.1/transmit.c dolly-0.63.1.patched/transmit.c
--- dolly-0.63.1/transmit.c	2021-02-09 16:44:50.000000000 +0100
+++ dolly-0.63.1.patched/transmit.c	2021-10-07 10:26:38.382378768 +0200
@@ -84,13 +84,13 @@
           }
           if(mydollytab->add_nr == 0) {
             for(i = 0; i < mydollytab->nr_childs; i++) {
-              (void)fprintf(stderr, "Writing maxbytes = %lld to ctrlout\n",
+              (void)fprintf(stderr, "Writing maxbytes = %llu to ctrlout\n",
                 maxbytes);
               movebytes(ctrlout[i], WRITE, (char *)&maxbytes, 8,mydollytab);
               shutdown(dataout[i], 2);
             }
           } else {
-            (void)fprintf(stderr, "Writing maxbytes = %lld to ctrlout\n",
+            (void)fprintf(stderr, "Writing maxbytes = %llu to ctrlout\n",
               maxbytes);
             movebytes(ctrlout[0], WRITE, (char *)&maxbytes, 8,mydollytab);
             for(i = 0; i <= mydollytab->add_nr; i++) {
@@ -238,15 +238,15 @@
 	      for(i = 0;(int) i < maxsetnr; i++) {
 		if(FD_ISSET(i, &cur_set)) {
 		  unsigned int j;
-		  fprintf(stderr, "  file descriptor %d is set.\n", i);
+		  fprintf(stderr, "  file descriptor %u is set.\n", i);
 		  for(j = 0; j < mydollytab->nr_childs; j++) {
 		    if(FD_ISSET(ctrlout[j], &cur_set)) {
-		      fprintf(stderr, "  (fd %d = ctrlout[%d])\n", i, j);
+		      fprintf(stderr, "  (fd %u = ctrlout[%u])\n", i, j);
 		    }
 		  }
 		  for(j = 0; j <= mydollytab->add_nr; j++) {
 		    if(FD_ISSET(datain[j], &cur_set)) {
-		      fprintf(stderr, "  (fd %d = datain[%d])\n", i, j);
+		      fprintf(stderr, "  (fd %u = datain[%u])\n", i, j);
 		    }
 		  }
 		}
@@ -292,7 +292,7 @@
       fprintf(logfd, "outfile = '%s'\n", mydollytab->outfile);
       if(mydollytab->flag_v) {
         if(mydollytab->segsize > 0) {
-          fprintf(logfd, "TCP segment size : %d Byte (%d Byte eth)\n", 
+          fprintf(logfd, "TCP segment size : %u Byte (%u Byte eth)\n", 
             mydollytab->segsize,mydollytab->segsize+54);
         } else {
           fprintf(logfd,
@@ -300,7 +300,7 @@
         }
       } else {
         if(mydollytab->segsize > 0) {
-          fprintf(logfd, " %8d", mydollytab->segsize);
+          fprintf(logfd, " %8u", mydollytab->segsize);
         } else {
           fprintf(logfd, " %8d", 1460);
         }
@@ -308,11 +308,11 @@
       
       if(mydollytab->flag_v) {
         fprintf(logfd, "Server : '%s'\n", mydollytab->myhostname);
-        fprintf(logfd, "Fanout = %d\n", mydollytab->fanout);
-        fprintf(logfd, "Nr of childs = %d\n", mydollytab->nr_childs);
-        fprintf(logfd, "Nr of hosts = %d\n", mydollytab->hostnr);
+        fprintf(logfd, "Fanout = %u\n", mydollytab->fanout);
+        fprintf(logfd, "Nr of childs = %u\n", mydollytab->nr_childs);
+        fprintf(logfd, "Nr of hosts = %u\n", mydollytab->hostnr);
       } else {
-        fprintf(logfd, " %8d", mydollytab->hostnr);
+        fprintf(logfd, " %8u", mydollytab->hostnr);
       }
     }
   } else {
@@ -331,12 +331,12 @@
   if(mydollytab->meserver) {
     for(i = 0; i < mydollytab->nr_childs; i++) {
       if(mydollytab->flag_v) {
-        fprintf(stderr, "Waiting for child %d.\n",i);
+        fprintf(stderr, "Waiting for child %u.\n",i);
       }
       ret = movebytes(ctrlout[i], READ, buf, 8,mydollytab);
       if(ret != 8) {
         fprintf(stderr,
-          "Server got only %d bytes back from client %d instead of 8\n",
+          "Server got only %d bytes back from client %u instead of 8\n",
           ret, i);
       }
     }
openSUSE Build Service is sponsored by