+ if (dry_run <= 1)
+ return;
+
+ slash = strrchr(curr_dir, '/');
+
+ for (dir = basis_dir; *dir; dir++) {
+ if (**dir == '/')
+ continue;
+ len = curr_dir_len + 1 + strlen(*dir) + 1;
+ if (!(new = new_array(char, len)))
+ out_of_memory("fix_basis_dirs");
+ if (slash && strncmp(*dir, "../", 3) == 0) {
+ /* We want to remove only one leading "../" prefix for
+ * the directory we couldn't create in dry-run mode:
+ * this ensures that any other ".." references get
+ * evaluated the same as they would for a live copy. */
+ *slash = '\0';
+ pathjoin(new, len, curr_dir, *dir + 3);
+ *slash = '/';
+ } else
+ pathjoin(new, len, curr_dir, *dir);
+ *dir = new;
+ }
+}
+
+/* This is only called by the sender. */
+static void read_final_goodbye(int f_in, int f_out)
+{
+ int i, iflags, xlen;
+ uchar fnamecmp_type;
+ char xname[MAXPATHLEN];
+
+ if (protocol_version < 29)
+ i = read_int(f_in);
+ else {
+ i = read_ndx_and_attrs(f_in, f_out, &iflags,
+ &fnamecmp_type, xname, &xlen);
+ }
+
+ if (i != NDX_DONE) {
+ rprintf(FERROR, "Invalid packet at end of run (%d) [%s]\n",
+ i, who_am_i());
+ exit_cleanup(RERR_PROTOCOL);
+ }
+}
+
+static void do_server_sender(int f_in, int f_out, int argc, char *argv[])