--- flist.c.orig 2006-01-09 12:35:38.000000000 -0600
+++ flist.c 2006-01-09 12:35:51.000000000 -0600
extern struct filter_list_struct filter_list;
extern struct filter_list_struct server_filter_list;
+extern int extended_attributes;
dev_t filesystem_dev; /* used to implement -x */
flist->files[flist->count++] = file;
send_file_entry(file, f, base_flags);
+ /* If the file doesn't begin with "._", and has
+ * either acls or extended attributes, serialize
+ * the data out and add a fake file to the file
+ * list with the "._" prepended to the basename.
+ * of the original source.
+ if (extended_attributes) {
+ if(strncmp(file->basename, "._", 2)
+ && copyfile(fname, NULL, 0,
+ COPYFILE_CHECK | COPYFILE_METADATA)) {
+ struct file_struct *file2 = NULL;
+ rprintf(FINFO, "added synthetic file for: %s\n", fname);
+ alloc_len = file_struct_len
+ + strlen(file->basename) + 1 + 2 // + strlen("._")
+ bp = pool_alloc(flist->file_pool, alloc_len, "receive_metadata_entry");
+ file2 = (struct file_struct *)bp;
+ memcpy(bp, file, file_struct_len);
+ memcpy(bp + 2, file->basename, strlen(file->basename) + 1);
+ file2->basename[0] = '.';
+ file2->basename[1] = '_';
+ file2->mode = S_IFREG | S_IRUSR;