From b5abdf474a67e7cad34f67feaaff2a69a08ec807 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sun, 30 Apr 2006 22:40:58 +0000 Subject: [PATCH] Fixed failing hunks. --- adaptec_acl_mods.diff | 56 +++++++++++++++++++------------------------ early-checksum.diff | 38 ++++++++++++++--------------- 2 files changed, 43 insertions(+), 51 deletions(-) diff --git a/adaptec_acl_mods.diff b/adaptec_acl_mods.diff index 0ae772c..e36ed9d 100644 --- a/adaptec_acl_mods.diff +++ b/adaptec_acl_mods.diff @@ -31,22 +31,7 @@ entry. --- old/acls.c +++ new/acls.c -@@ -84,10 +84,10 @@ static int calc_sacl_entries(const rsync - - static int rsync_acl_get_perms(const rsync_acl *racl) - { -- /* Note that (ACL_NO_ENTRY & 7) is 0. */ -- return ((racl->user_obj & 7) << 6) -- + (((racl->mask != ACL_NO_ENTRY ? racl->mask : racl->group_obj) & 7) << 3) -- + (racl->other & 7); -+ /* Note that (ACL_NO_ENTRY & 077) is 0. */ -+ return ((racl->user_obj & 077) << 6) -+ + (((racl->mask != ACL_NO_ENTRY ? racl->mask : racl->group_obj) & 077) << 3) -+ + (racl->other & 077); - } - - static void rsync_acl_strip_perms(rsync_acl *racl) -@@ -178,6 +178,9 @@ static BOOL unpack_smb_acl(rsync_acl *ra +@@ -325,6 +325,9 @@ static BOOL unpack_smb_acl(rsync_acl *ra } access = (sys_acl_get_perm(permset, SMB_ACL_READ) ? 4 : 0) | (sys_acl_get_perm(permset, SMB_ACL_WRITE) ? 2 : 0) @@ -54,9 +39,9 @@ entry. + | (sys_acl_get_perm(permset, SMB_ACL_CHMOD) ? 16 : 0) + | (sys_acl_get_perm(permset, SMB_ACL_CHOWN) ? 32 : 0) | (sys_acl_get_perm(permset, SMB_ACL_EXECUTE) ? 1 : 0); - /* continue == done with entry; break == store in given idal */ + /* continue == done with entry; break == store in temporary ida list */ switch (tag_type) { -@@ -587,6 +590,12 @@ static int store_access_in_entry(uchar a +@@ -419,6 +422,12 @@ static int store_access_in_entry(uchar a COE( sys_acl_get_permset,(entry, &permset) ); COE( sys_acl_clear_perms,(permset) ); @@ -69,25 +54,34 @@ entry. if (access & 4) COE( sys_acl_add_perm,(permset, SMB_ACL_READ) ); if (access & 2) -@@ -619,7 +628,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ +@@ -452,7 +461,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ COE( sys_acl_create_entry,(smb_acl, &entry) ); COE( sys_acl_set_tag_type,(entry, SMB_ACL_USER_OBJ) ); - COE2( store_access_in_entry,(racl->user_obj & 7, entry) ); + COE2( store_access_in_entry,(racl->user_obj & 077, entry) ); - for (ida = racl->users.idas, count = racl->users.count; - count--; ida++) { -@@ -631,7 +640,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ + for (ida = racl->users.idas, count = racl->users.count; count--; ida++) { + COE( sys_acl_create_entry,(smb_acl, &entry) ); +@@ -463,7 +472,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ COE( sys_acl_create_entry,(smb_acl, &entry) ); COE( sys_acl_set_tag_type,(entry, SMB_ACL_GROUP_OBJ) ); - COE2( store_access_in_entry,(racl->group_obj & 7, entry) ); + COE2( store_access_in_entry,(racl->group_obj & 077, entry) ); - for (ida = racl->groups.idas, count = racl->groups.count; - count--; ida++) { -@@ -652,7 +661,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ + for (ida = racl->groups.idas, count = racl->groups.count; count--; ida++) { + COE( sys_acl_create_entry,(smb_acl, &entry) ); +@@ -473,7 +482,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ + } + + #ifdef ACLS_NEED_MASK +- mask_bits = racl->mask == NO_ENTRY ? racl->group_obj & 7 : racl->mask; ++ mask_bits = racl->mask == NO_ENTRY ? racl->group_obj & 077 : racl->mask; + COE( sys_acl_create_entry,(smb_acl, &entry) ); + COE( sys_acl_set_tag_type,(entry, SMB_ACL_MASK) ); + COE2( store_access_in_entry,(mask_bits, entry) ); +@@ -487,7 +496,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ COE( sys_acl_create_entry,(smb_acl, &entry) ); COE( sys_acl_set_tag_type,(entry, SMB_ACL_OTHER) ); @@ -96,7 +90,7 @@ entry. #ifdef DEBUG if (sys_acl_valid(*smb_acl) < 0) -@@ -761,7 +770,7 @@ static void receive_rsync_acl(rsync_acl +@@ -721,7 +730,7 @@ static void receive_rsync_acl(rsync_acl while (count--) { char tag = read_byte(f); uchar access = read_byte(f); @@ -105,15 +99,15 @@ entry. rprintf(FERROR, "receive_rsync_acl: bogus permset %o\n", access); exit_cleanup(RERR_STREAMIO); -@@ -834,7 +843,7 @@ static void receive_rsync_acl(rsync_acl - } else - #endif - if (racl->mask == ACL_NO_ENTRY) /* Always non-empty when needed. */ +@@ -797,7 +806,7 @@ static void receive_rsync_acl(rsync_acl + racl->mask = NO_ENTRY; + } + } else if (racl->mask == NO_ENTRY) /* Must be non-empty with lists. */ - racl->mask = computed_mask_bits | (racl->group_obj & 7); + racl->mask = computed_mask_bits | (racl->group_obj & 077); } - /* receive and build the rsync_acl_lists */ + /* Receive the ACL info the sender has included for this file-list entry. */ --- old/smb_acls.h +++ new/smb_acls.h @@ -33,6 +33,11 @@ diff --git a/early-checksum.diff b/early-checksum.diff index f64037d..0041db4 100644 --- a/early-checksum.diff +++ b/early-checksum.diff @@ -10,7 +10,7 @@ for a local copy, so the old algorithm is used for local copies. --- old/flist.c +++ new/flist.c -@@ -36,6 +36,7 @@ extern int am_daemon; +@@ -31,6 +31,7 @@ extern int am_daemon; extern int am_sender; extern int do_progress; extern int always_checksum; @@ -18,7 +18,7 @@ for a local copy, so the old algorithm is used for local copies. extern int module_id; extern int ignore_errors; extern int numeric_ids; -@@ -711,6 +712,16 @@ static struct file_struct *receive_file_ +@@ -701,6 +702,16 @@ static struct file_struct *receive_file_ sum = empty_sum; } read_buf(f, sum, checksum_len); @@ -37,7 +37,7 @@ for a local copy, so the old algorithm is used for local copies. return file; --- old/generator.c +++ new/generator.c -@@ -72,6 +72,7 @@ extern int ignore_timeout; +@@ -71,6 +71,7 @@ extern int ignore_timeout; extern int protocol_version; extern int fuzzy_basis; extern int always_checksum; @@ -45,7 +45,7 @@ for a local copy, so the old algorithm is used for local copies. extern int checksum_len; extern char *partial_dir; extern char *basis_dir[]; -@@ -377,7 +378,8 @@ void itemize(struct file_struct *file, i +@@ -374,7 +375,8 @@ void itemize(struct file_struct *file, i /* Perform our quick-check heuristic for determining if a file is unchanged. */ @@ -55,7 +55,7 @@ for a local copy, so the old algorithm is used for local copies. { if (st->st_size != file->length) return 0; -@@ -386,6 +388,8 @@ int unchanged_file(char *fn, struct file +@@ -383,6 +385,8 @@ int unchanged_file(char *fn, struct file of the file time to determine whether to sync */ if (always_checksum && S_ISREG(st->st_mode)) { char sum[MD4_SUM_LENGTH]; @@ -64,7 +64,7 @@ for a local copy, so the old algorithm is used for local copies. file_checksum(fn, sum, st->st_size); return memcmp(sum, file->u.sum, checksum_len) == 0; } -@@ -623,7 +627,7 @@ static int try_dests_reg(struct file_str +@@ -620,7 +624,7 @@ static int try_dests_reg(struct file_str match_level = 1; /* FALL THROUGH */ case 1: @@ -73,7 +73,7 @@ for a local copy, so the old algorithm is used for local copies. continue; best_match = j; match_level = 2; -@@ -1159,7 +1163,7 @@ static void recv_generator(char *fname, +@@ -1182,7 +1186,7 @@ static void recv_generator(char *fname, ; else if (fnamecmp_type == FNAMECMP_FUZZY) ; @@ -84,7 +84,7 @@ for a local copy, so the old algorithm is used for local copies. handle_partial_dir(partialptr, PDIR_DELETE); --- old/hlink.c +++ new/hlink.c -@@ -210,7 +210,7 @@ int hard_link_check(struct file_struct * +@@ -212,7 +212,7 @@ int hard_link_check(struct file_struct * itemizing = code = 0; break; } @@ -95,25 +95,23 @@ for a local copy, so the old algorithm is used for local copies. st = &st3; --- old/main.c +++ new/main.c -@@ -44,6 +44,7 @@ extern int copy_links; +@@ -47,6 +47,7 @@ extern int copy_dirlinks; extern int keep_dirlinks; extern int preserve_hard_links; extern int protocol_version; +extern int always_checksum; extern int recurse; extern int relative_paths; - extern int rsync_port; -@@ -59,7 +60,9 @@ extern char *filesfrom_host; - extern char *rsync_path; - extern char *shell_cmd; - extern char *batch_name; -+extern char curr_dir[MAXPATHLEN]; + extern int sanitize_paths; +@@ -68,6 +69,7 @@ extern char *batch_name; + + extern char curr_dir[MAXPATHLEN]; +int pre_checksum = 0; int local_server = 0; mode_t orig_umask = 0; struct file_list *the_file_list; -@@ -717,6 +720,7 @@ static void do_server_recv(int f_in, int +@@ -736,6 +738,7 @@ static void do_server_recv(int f_in, int struct file_list *flist; char *local_name = NULL; char *dir = NULL; @@ -121,7 +119,7 @@ for a local copy, so the old algorithm is used for local copies. int save_verbose = verbose; if (filesfrom_fd >= 0) { -@@ -760,6 +764,10 @@ static void do_server_recv(int f_in, int +@@ -779,6 +782,10 @@ static void do_server_recv(int f_in, int filesfrom_fd = -1; } @@ -132,7 +130,7 @@ for a local copy, so the old algorithm is used for local copies. flist = recv_file_list(f_in); verbose = save_verbose; if (!flist) { -@@ -768,6 +776,9 @@ static void do_server_recv(int f_in, int +@@ -787,6 +794,9 @@ static void do_server_recv(int f_in, int } the_file_list = flist; @@ -142,7 +140,7 @@ for a local copy, so the old algorithm is used for local copies. if (argc > 0) local_name = get_local_name(flist,argv[0]); -@@ -819,6 +830,7 @@ int client_run(int f_in, int f_out, pid_ +@@ -848,6 +858,7 @@ int client_run(int f_in, int f_out, pid_ { struct file_list *flist = NULL; int exit_code = 0, exit_code2 = 0; @@ -150,7 +148,7 @@ for a local copy, so the old algorithm is used for local copies. char *local_name = NULL; cleanup_child_pid = pid; -@@ -893,11 +905,18 @@ int client_run(int f_in, int f_out, pid_ +@@ -922,11 +933,18 @@ int client_run(int f_in, int f_out, pid_ filesfrom_fd = -1; } -- 2.34.1