From: Wayne Davison Date: Thu, 11 Feb 2010 18:15:21 +0000 (-0800) Subject: Fix alignment issue on 64-bit. Solution from Steve Ortiz. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/4c85a55c419c231b83e024ab2aedfe3abe12f3da Fix alignment issue on 64-bit. Solution from Steve Ortiz. --- diff --git a/crtimes.diff b/crtimes.diff index 70570f3..5766c91 100644 --- a/crtimes.diff +++ b/crtimes.diff @@ -360,7 +360,7 @@ diff --git a/rsync.h b/rsync.h #define ITEM_REPORT_CHANGE (1<<1) #define ITEM_REPORT_SIZE (1<<2) /* regular files only */ #define ITEM_REPORT_TIMEFAIL (1<<2) /* symlinks only */ -@@ -689,6 +691,7 @@ extern int file_extra_cnt; +@@ -693,6 +695,7 @@ extern int file_extra_cnt; extern int inc_recurse; extern int uid_ndx; extern int gid_ndx; @@ -368,7 +368,7 @@ diff --git a/rsync.h b/rsync.h extern int fileflags_ndx; extern int acls_ndx; extern int xattrs_ndx; -@@ -696,6 +699,7 @@ extern int xattrs_ndx; +@@ -700,6 +703,7 @@ extern int xattrs_ndx; #define FILE_STRUCT_LEN (offsetof(struct file_struct, basename)) #define EXTRA_LEN (sizeof (union file_extras)) #define PTR_EXTRA_CNT ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN) @@ -376,7 +376,7 @@ diff --git a/rsync.h b/rsync.h #define DEV_EXTRA_CNT 2 #define DIRNODE_EXTRA_CNT 3 #define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN) -@@ -975,6 +979,7 @@ typedef struct { +@@ -979,6 +983,7 @@ typedef struct { typedef struct { STRUCT_STAT st; @@ -395,7 +395,7 @@ diff --git a/rsync.yo b/rsync.yo --super receiver attempts super-user activities --fake-super store/recover privileged attrs using xattrs -S, --sparse handle sparse files efficiently -@@ -1106,6 +1107,9 @@ it is preserving modification times (see bf(--times)). If NFS is sharing +@@ -1110,6 +1111,9 @@ it is preserving modification times (see bf(--times)). If NFS is sharing the directories on the receiving side, it is a good idea to use bf(-O). This option is inferred if you use bf(--backup) without bf(--backup-dir). @@ -405,7 +405,7 @@ diff --git a/rsync.yo b/rsync.yo dit(bf(--super)) This tells the receiving side to attempt super-user activities even if the receiving rsync wasn't run by the super-user. These activities include: preserving users via the bf(--owner) option, preserving -@@ -1918,7 +1922,7 @@ with older versions of rsync, but that also turns on the output of other +@@ -1922,7 +1926,7 @@ with older versions of rsync, but that also turns on the output of other verbose messages). The "%i" escape has a cryptic output that is 11 letters long. The general @@ -414,7 +414,7 @@ diff --git a/rsync.yo b/rsync.yo type of update being done, bf(X) is replaced by the file-type, and the other letters represent attributes that may be output if they are being modified. -@@ -1977,6 +1981,8 @@ quote(itemization( +@@ -1981,6 +1985,8 @@ quote(itemization( it() The bf(f) means that the fileflags information changed. it() The bf(a) means that the ACL information changed. it() The bf(x) means that the extended attribute information changed. @@ -426,19 +426,22 @@ diff --git a/rsync.yo b/rsync.yo diff --git a/syscall.c b/syscall.c --- a/syscall.c +++ b/syscall.c -@@ -38,6 +38,11 @@ extern int force_change; +@@ -38,6 +38,14 @@ extern int force_change; extern int preserve_perms; extern int preserve_executability; ++#pragma pack(push) ++#pragma pack(4) +struct create_time { + uint32 length; + struct timespec crtime; +}; ++#pragma pack(pop) + #define RETURN_ERROR_IF(x,e) \ do { \ if (x) { \ -@@ -437,3 +442,33 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence) +@@ -439,3 +447,33 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence) return lseek(fd, offset, whence); #endif } diff --git a/fileflags.diff b/fileflags.diff index 4cd9c8a..963fdbe 100644 --- a/fileflags.diff +++ b/fileflags.diff @@ -8,7 +8,7 @@ To use this patch, run these commands for a successful build: ./configure make -based-on: a01e3b490eb36ccf9e704840e1b6683dab867550 +based-on: afccb3d3263b4867eb0a22cf29a3bb75f4cf0d71 diff --git a/Makefile.in b/Makefile.in --- a/Makefile.in +++ b/Makefile.in @@ -309,7 +309,7 @@ diff --git a/generator.c b/generator.c +#endif if (counter >= loopchk_limit) { if (allowed_lull) - maybe_send_keepalive(time(NULL), True); + maybe_send_keepalive(time(NULL), MSK_ALLOW_FLUSH); diff --git a/log.c b/log.c --- a/log.c +++ b/log.c @@ -594,7 +594,7 @@ diff --git a/rsync.h b/rsync.h #define ITEM_BASIS_TYPE_FOLLOWS (1<<11) #define ITEM_XNAME_FOLLOWS (1<<12) #define ITEM_IS_NEW (1<<13) -@@ -494,6 +497,28 @@ typedef unsigned int size_t; +@@ -498,6 +501,28 @@ typedef unsigned int size_t; #endif #endif @@ -623,7 +623,7 @@ diff --git a/rsync.h b/rsync.h /* Find a variable that is either exactly 32-bits or longer. * If some code depends on 32-bit truncation, it will need to * take special action in a "#if SIZEOF_INT32 > 4" section. */ -@@ -664,6 +689,7 @@ extern int file_extra_cnt; +@@ -668,6 +693,7 @@ extern int file_extra_cnt; extern int inc_recurse; extern int uid_ndx; extern int gid_ndx; @@ -631,7 +631,7 @@ diff --git a/rsync.h b/rsync.h extern int acls_ndx; extern int xattrs_ndx; -@@ -705,6 +731,11 @@ extern int xattrs_ndx; +@@ -709,6 +735,11 @@ extern int xattrs_ndx; /* When the associated option is on, all entries will have these present: */ #define F_OWNER(f) REQ_EXTRA(f, uid_ndx)->unum #define F_GROUP(f) REQ_EXTRA(f, gid_ndx)->unum @@ -685,9 +685,9 @@ diff --git a/rsync.yo b/rsync.yo See also bf(--keep-dirlinks) for an analogous option for the receiving side. -@@ -1013,6 +1018,29 @@ super-user copies all namespaces except system.*. A normal user only copies - the user.* namespace. To be able to backup and restore non-user namespaces as - a normal user, see the bf(--fake-super) option. +@@ -1017,6 +1022,29 @@ Note that this option does not copy rsyncs special xattr values (e.g. those + used by bf(--fake-super)) unless you repeat the option (e.g. -XX). This + "copy all xattrs" mode cannot be used with bf(--fake-super). +dit(bf(--fileflags)) This option causes rsync to update the file-flags to be +the same as the source files and directories (if your OS supports the @@ -715,7 +715,7 @@ diff --git a/rsync.yo b/rsync.yo dit(bf(--chmod)) This option tells rsync to apply one or more comma-separated "chmod" strings to the permission of the files in the transfer. The resulting value is treated as though it were the permissions -@@ -1301,12 +1329,13 @@ display as a "*missing" entry in the bf(--list-only) output. +@@ -1305,12 +1333,13 @@ display as a "*missing" entry in the bf(--list-only) output. dit(bf(--ignore-errors)) Tells bf(--delete) to go ahead and delete files even when there are I/O errors. @@ -732,7 +732,7 @@ diff --git a/rsync.yo b/rsync.yo bf(--recursive) option was also enabled. dit(bf(--max-delete=NUM)) This tells rsync not to delete more than NUM -@@ -1889,7 +1918,7 @@ with older versions of rsync, but that also turns on the output of other +@@ -1893,7 +1922,7 @@ with older versions of rsync, but that also turns on the output of other verbose messages). The "%i" escape has a cryptic output that is 11 letters long. The general @@ -741,7 +741,7 @@ diff --git a/rsync.yo b/rsync.yo type of update being done, bf(X) is replaced by the file-type, and the other letters represent attributes that may be output if they are being modified. -@@ -1945,7 +1974,7 @@ quote(itemization( +@@ -1949,7 +1978,7 @@ quote(itemization( sender's value (requires bf(--owner) and super-user privileges). it() A bf(g) means the group is different and is being updated to the sender's value (requires bf(--group) and the authority to set the group). @@ -868,10 +868,10 @@ diff --git a/syscall.c b/syscall.c { int code; if (dry_run) return 0; -@@ -211,17 +266,74 @@ int do_chmod(const char *path, mode_t mode) - #endif +@@ -213,17 +268,74 @@ int do_chmod(const char *path, mode_t mode) } else code = chmod(path, mode & CHMOD_BITS); /* DISCOURAGED FUNCTION */ + #endif /* !HAVE_LCHMOD */ +#ifdef SUPPORT_FORCE_CHANGE + if (code < 0 && force_change && errno == EPERM && !S_ISLNK(mode)) { + if (fileflags == NO_FFLAGS) {