From 4d7a8142eb7e608ba263e86313e9081e83a48c28 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 21 Nov 2006 08:52:10 +0000 Subject: [PATCH 1/1] Fixed failing hunks. --- acls.diff | 19 ++++++++++--------- md5.diff | 31 ++++++++++++++++--------------- threaded-receiver.diff | 18 +++++++++--------- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/acls.diff b/acls.diff index 0794f67..ed6d153 100644 --- a/acls.diff +++ b/acls.diff @@ -1150,7 +1150,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. char *rel = fullpath + backup_dir_len; char *end = rel + strlen(rel); char *p = end; -@@ -126,13 +128,24 @@ static int make_bak_dir(char *fullpath) +@@ -126,15 +128,24 @@ static int make_bak_dir(char *fullpath) if (p >= rel) { /* Try to transfer the directory settings of the * actual dir that the files are coming from. */ @@ -1161,6 +1161,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. full_fname(rel)); } else { - do_lchown(fullpath, st.st_uid, st.st_gid); +-#ifdef HAVE_CHMOD - do_chmod(fullpath, st.st_mode); +#ifdef SUPPORT_ACLS + sx.acc_acl = sx.def_acl = NULL; @@ -1172,13 +1173,13 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. + get_acl(rel, &sx); + cache_acl(file, &sx); + } -+#endif + #endif + set_file_attrs(fullpath, file, NULL, 0); + free(file); } } *p = '/'; -@@ -170,15 +183,18 @@ static int robust_move(char *src, char * +@@ -172,15 +183,18 @@ static int robust_move(char *src, char * * We will move the file to be deleted into a parallel directory tree. */ static int keep_backup(char *fname) { @@ -1199,7 +1200,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. if (!(file = make_file(fname, NULL, NULL, 0, NO_FILTERS))) return 1; /* the file could have disappeared */ -@@ -186,6 +202,13 @@ static int keep_backup(char *fname) +@@ -188,6 +202,13 @@ static int keep_backup(char *fname) if (!(buf = get_backup_name(fname))) return 0; @@ -1213,7 +1214,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. /* Check to see if this is a device file, or link */ if ((am_root && preserve_devices && IS_DEVICE(file->mode)) || (preserve_specials && IS_SPECIAL(file->mode))) { -@@ -254,7 +277,7 @@ static int keep_backup(char *fname) +@@ -256,7 +277,7 @@ static int keep_backup(char *fname) if (robust_move(fname, buf) != 0) { rsyserr(FERROR, errno, "keep_backup failed: %s -> \"%s\"", full_fname(fname), buf); @@ -1224,7 +1225,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. robust_unlink(fname); /* Just in case... */ --- old/configure.in +++ new/configure.in -@@ -515,6 +515,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no +@@ -537,6 +537,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no AC_CHECK_LIB(resolv, strcasecmp) fi @@ -1236,7 +1237,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. dnl At the moment we don't test for a broken memcmp(), because all we dnl need to do is test for equality, not comparison, and it seems that dnl every platform has a memcmp that can do at least that. -@@ -779,6 +784,78 @@ AC_SUBST(OBJ_RESTORE) +@@ -801,6 +806,78 @@ AC_SUBST(OBJ_RESTORE) AC_SUBST(CC_SHOBJ_FLAG) AC_SUBST(BUILD_POPT) @@ -5617,7 +5618,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. +#endif /* SUPPORT_ACLS */ --- old/log.c +++ new/log.c -@@ -611,8 +611,10 @@ static void log_formatted(enum logcode c +@@ -614,8 +614,10 @@ static void log_formatted(enum logcode c c[5] = !(iflags & ITEM_REPORT_PERMS) ? '.' : 'p'; c[6] = !(iflags & ITEM_REPORT_OWNER) ? '.' : 'o'; c[7] = !(iflags & ITEM_REPORT_GROUP) ? '.' : 'g'; @@ -5737,7 +5738,7 @@ latest ACL-enabling patch to send files to an older ACL-enabled rsync. default: /* A large opt value means that set_refuse_options() * turned this option off. */ -@@ -1530,6 +1559,10 @@ void server_options(char **args,int *arg +@@ -1531,6 +1560,10 @@ void server_options(char **args,int *arg if (preserve_hard_links) argstr[x++] = 'H'; diff --git a/md5.diff b/md5.diff index c8d339c..08c85bc 100644 --- a/md5.diff +++ b/md5.diff @@ -87,15 +87,15 @@ To use this patch, run these commands for a successful build: } -@@ -100,6 +115,7 @@ void file_checksum(char *fname,char *sum - int fd; - OFF_T len = size; +@@ -99,6 +114,7 @@ void file_checksum(char *fname,char *sum + OFF_T i, len = size; struct mdfour m; + int32 remainder; + md5_context ctx; + int fd; memset(sum,0,MD4_SUM_LENGTH); - -@@ -109,21 +125,36 @@ void file_checksum(char *fname,char *sum +@@ -109,11 +125,19 @@ void file_checksum(char *fname,char *sum buf = map_file(fd, size, MAX_MAP_SIZE, CSUM_CHUNK); @@ -118,16 +118,17 @@ To use this patch, run these commands for a successful build: } /* Prior to version 27 an incorrect MD4 checksum was computed - * by failing to call mdfour_tail() for block sizes that +@@ -121,10 +145,17 @@ void file_checksum(char *fname,char *sum * are multiples of 64. This is fixed by calling mdfour_update() * even when there are no more bytes. */ -- if (len - i > 0 || protocol_version >= 27) -- mdfour_update(&m, (uchar *)map_ptr(buf, i, len-i), len-i); -+ if (len - i > 0 || protocol_version >= 27) { + remainder = (int32)(len - i); +- if (remainder > 0 || protocol_version >= 27) +- mdfour_update(&m, (uchar *)map_ptr(buf, i, remainder), remainder); ++ if (remainder > 0 || protocol_version >= 27) { + if (use_md5) -+ md5_update(&ctx, (uchar *)map_ptr(buf, i, len-i), len-i); ++ md5_update(&ctx, (uchar *)map_ptr(buf, i, remainder), remainder); + else -+ mdfour_update(&m, (uchar *)map_ptr(buf, i, len-i), len-i); ++ mdfour_update(&m, (uchar *)map_ptr(buf, i, remainder), remainder); + } - mdfour_result(&m, (uchar *)sum); @@ -138,7 +139,7 @@ To use this patch, run these commands for a successful build: close(fd); unmap_file(buf); -@@ -133,11 +164,15 @@ void file_checksum(char *fname,char *sum +@@ -134,11 +165,15 @@ void file_checksum(char *fname,char *sum static int32 sumresidue; static char sumrbuf[CSUM_CHUNK]; static struct mdfour md; @@ -155,7 +156,7 @@ To use this patch, run these commands for a successful build: sumresidue = 0; SIVAL(s, 0, seed); sum_update(s, 4); -@@ -162,13 +197,19 @@ void sum_update(char *p, int32 len) +@@ -163,13 +198,19 @@ void sum_update(const char *p, int32 len if (sumresidue) { int32 i = CSUM_CHUNK - sumresidue; memcpy(sumrbuf + sumresidue, p, i); @@ -177,7 +178,7 @@ To use this patch, run these commands for a successful build: len -= CSUM_CHUNK; p += CSUM_CHUNK; } -@@ -180,8 +221,15 @@ void sum_update(char *p, int32 len) +@@ -181,8 +222,15 @@ void sum_update(const char *p, int32 len void sum_end(char *sum) { @@ -586,7 +587,7 @@ To use this patch, run these commands for a successful build: {"checksum", 'c', POPT_ARG_NONE, &always_checksum, 0, 0, 0 }, {"block-size", 'B', POPT_ARG_LONG, &block_size, 0, 0, 0 }, {"compare-dest", 0, POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 }, -@@ -1642,6 +1645,9 @@ void server_options(char **args,int *arg +@@ -1643,6 +1646,9 @@ void server_options(char **args,int *arg args[ac++] = arg; } diff --git a/threaded-receiver.diff b/threaded-receiver.diff index cb5575e..8129c4d 100644 --- a/threaded-receiver.diff +++ b/threaded-receiver.diff @@ -820,7 +820,7 @@ To use this patch, run these commands for a successful build: return; if (am_daemon) { -@@ -683,12 +693,30 @@ static void do_server_sender(int f_in, i +@@ -684,12 +694,30 @@ static void do_server_sender(int f_in, i exit_cleanup(0); } @@ -854,7 +854,7 @@ To use this patch, run these commands for a successful build: /* The receiving side mustn't obey this, or an existing symlink that * points to an identical file won't be replaced by the referent. */ -@@ -697,70 +725,16 @@ static int do_recv(int f_in,int f_out,st +@@ -698,70 +726,16 @@ static int do_recv(int f_in,int f_out,st if (preserve_hard_links) init_hard_links(); @@ -930,7 +930,7 @@ To use this patch, run these commands for a successful build: generate_files(f_out, flist, local_name); handle_stats(-1); -@@ -771,10 +745,13 @@ static int do_recv(int f_in,int f_out,st +@@ -772,10 +746,13 @@ static int do_recv(int f_in,int f_out,st } io_flush(FULL_FLUSH); @@ -948,7 +948,7 @@ To use this patch, run these commands for a successful build: } -@@ -1176,22 +1153,6 @@ static int start_client(int argc, char * +@@ -1177,22 +1154,6 @@ static int start_client(int argc, char * return ret; } @@ -971,7 +971,7 @@ To use this patch, run these commands for a successful build: RETSIGTYPE remember_children(UNUSED(int val)) { #ifdef WNOHANG -@@ -1283,8 +1244,6 @@ int main(int argc,char *argv[]) +@@ -1284,8 +1245,6 @@ int main(int argc,char *argv[]) # endif sigact.sa_flags = SA_NOCLDSTOP; #endif @@ -1012,7 +1012,7 @@ To use this patch, run these commands for a successful build: @@ -325,7 +325,7 @@ void match_sums(int f, struct sum_struct } if (last_match < s->flength) { - int32 len = s->flength - last_match; + int32 len = (int32)(s->flength - last_match); - if (buf && do_progress) + if (buf && recv_progress) show_progress(last_match, buf->file_size); @@ -1036,7 +1036,7 @@ To use this patch, run these commands for a successful build: int keep_partial = 0; int safe_symlinks = 0; int copy_unsafe_links = 0; -@@ -1306,6 +1306,7 @@ int parse_arguments(int *argc, const cha +@@ -1302,6 +1302,7 @@ int parse_arguments(int *argc, const cha if (do_progress && !verbose && !log_before_transfer && !am_server) verbose = 1; @@ -1087,7 +1087,7 @@ To use this patch, run these commands for a successful build: @@ -165,7 +165,7 @@ static int receive_data(int f_in, char * } if (offset < sum.flength) { - int32 len = sum.flength - offset; + int32 len = (int32)(sum.flength - offset); - if (do_progress) + if (recv_progress) show_progress(offset, total_size); @@ -1171,7 +1171,7 @@ To use this patch, run these commands for a successful build: + if (preserve_hard_links && file->link_u.links) + push_hlink_num(i); } else if (!recv_ok) { - int msgtype = phase || read_batch ? FERROR : FINFO; + enum logcode msgtype = phase || read_batch ? FERROR : FINFO; if (msgtype == FERROR || verbose) { @@ -681,8 +678,8 @@ int recv_files(int f_in, struct file_lis errstr, fname, keptstr, redostr); -- 2.34.1