--- generator.c.orig 2006-01-09 13:04:42.000000000 -0600
+++ generator.c 2006-01-09 13:09:18.000000000 -0600
extern struct file_list *the_file_list;
extern struct filter_list_struct server_filter_list;
+extern int extended_attributes;
static int deletion_count = 0; /* used to implement --max-delete */
+ /* Prevent flooding the syslog when trying to delete the
+ synthetic (= fake) file containing extended attributes. */
+ if (errno == ENOENT && extended_attributes
+ && !strncmp(basename(fname), "._", 2)) {
+ rprintf(FINFO, "synthetic file %s could not be deleted\n",
rsyserr(FERROR, errno, "delete_file: unlink %s failed",
int save_opt_ignore_existing = opt_ignore_existing;
int save_do_progress = do_progress;
int save_make_backups = make_backups;
+ int ea_map[flist->count];
if (protocol_version >= 29) {
* notice that and let us know via the redo pipe (or its closing). */
+ /* APPLE: extended attribute files (._foo) need to be transferred
+ * after the corresponding file (foo). This creates a map the size
+ * of flist with the number of the file that preempts the current
+ * file's delivery. Set to -1 if there's nothing to do.
+ if (extended_attributes) {
+ struct file_struct *file2;
+ struct file_struct *file3;
+ rprintf(FINFO,"initializing extended attribute map\n");
+ for (i = 0; i < flist->count; ++i) {
+ file2 = flist->files[i];
+ if (!file2->basename || strncmp(file2->basename, "._", 2))
+ for (j = i; j < flist->count; ++j) {
+ file3 = flist->files[j];
+ if(!(file2->dirname || file3->dirname)
+ || (file2->dirname && file3->dirname &&
+ !strcmp(file3->dirname, file2->dirname))) {
+ if(!strcmp(file3->basename, file2->basename + 2)) {