> chmod, and chown bits which Adaptec has added to XFS on their SnapOS NAS
> units. This is nice for backing up files between different NAS units
> and preserving all of the Samba ACLs.
->
+>
> I'm not sure how useful this patch will be because I'm not sure if any
> other NAS vendors have standardized on their extensions to POSIX ACLs to
> support Samba in the same manner that Adaptec has. FWIW, though, this
- set_modtime(fname, file->modtime, file->mode);
+ set_times(fname, file->modtime, file->modtime, file->mode);
}
- if (allowed_lull && !(counter % lull_mod))
- maybe_send_keepalive();
+ if (counter >= loopchk_limit) {
+ if (allowed_lull)
diff --git a/ifuncs.h b/ifuncs.h
--- a/ifuncs.h
+++ b/ifuncs.h
#endif
+static int display_atimes = 0;
-+
++
static void failed(char const *what, char const *where)
{
fprintf(stderr, PROGRAM ": %s %s: %s\n",
int write_batch = 0;
int read_batch = 0;
int backup_dir_len = 0;
-+int backup_dir_dels_len = 0;
++int backup_dir_dels_len = 0;
int backup_suffix_len;
+int backup_suffix_dels_len;
unsigned int backup_dir_remainder;
+ if (strchr(backup_suffix_dels, '/') != NULL) {
+ snprintf(err_buf, sizeof err_buf,
+ "--suffix-dels cannot contain slashes: %s\n",
-+ backup_suffix_dels);
++ backup_suffix_dels);
+ return 0;
+ }
if (backup_dir) {
if (make_backups && !backup_dir) {
omit_dir_times = 0; /* Implied, so avoid -O to sender. */
-@@ -1901,6 +1963,10 @@ void server_options(char **args, int *argc_p)
+@@ -1907,6 +1969,10 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--backup-dir";
args[ac++] = backup_dir;
}
/* Only send --suffix if it specifies a non-default value. */
if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) {
-@@ -1909,7 +1975,14 @@ void server_options(char **args, int *argc_p)
+@@ -1915,7 +1981,14 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}
Igor Yu. Zhbanov wrote:
-> I am using rsync compiled with Cygwin on windows.
+> I am using rsync compiled with Cygwin on windows.
> I must call rsync from the *.bat script (I don't want to use a bash on Windows)
> and I have noticed that in the case when program compiled by Cygwin crashes
> via segmentation fault and default SIGSEGV handler is called, then it
> terminates process with exit status 0 as I see it from my *.bat script.
> (But if I invoke a program from bash (compiled with Cygwin too) I will see
> error code 139 as expected.)
->
+>
> It is a Cygwin's problem, not an rsync's, but to use it on windows and
> to distinguish situations when rsync crashes and when it exits normally,
> I have written signal handler which terminates process with code 50.
> You may use conventional 139. Also signal handler writes corresponding
> message to log file.
->
+>
> By the way. When I terminate rsync in daemon mode by pressing Control-C,
> it writes an error to log. May be this is not an error but info or notice?
if (f >= 0 && recurse && !divert_dirs) {
int i, end = flist->used - 1;
/* send_if_directory() bumps flist->used, so use "end". */
-@@ -2435,6 +2651,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
- }
+@@ -2436,6 +2652,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
} else
flist_eof = 1;
-+
+
+ if (checksum_files & CSF_UPDATE && flist_eof)
+ reset_checksum_cache(0); /* writes any last updates */
-
++
return flist;
}
+
diff --git a/generator.c b/generator.c
--- a/generator.c
+++ b/generator.c
if (itemizing)
itemize(fnamecmp, file, ndx, statret, &sx, 0, 0, NULL);
#ifdef SUPPORT_HARD_LINKS
-@@ -2247,6 +2252,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2250,6 +2255,7 @@ void generate_files(int f_out, const char *local_name)
} else
change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));
}
}
for (i = cur_flist->low; i <= cur_flist->high; i++) {
struct file_struct *file = cur_flist->sorted[i];
-@@ -2327,6 +2333,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2333,6 +2339,9 @@ void generate_files(int f_out, const char *local_name)
wait_for_receiver();
}
continue;
}
-@@ -891,6 +899,39 @@ int del_def_xattr_acl(const char *fname)
+@@ -894,6 +902,39 @@ int del_def_xattr_acl(const char *fname)
}
#endif
+ char buf[256];
+ uint32 file_length, mtime;
+ int len;
-+
++
+ len = sys_lgetxattr(fname, mdattr, buf, sizeof buf);
+ if (len < 0) {
+ if (errno == ENOTSUP || errno == ENOATTR)
{"specials", 0, POPT_ARG_VAL, &preserve_specials, 1, 0, 0 },
{"no-specials", 0, POPT_ARG_VAL, &preserve_specials, 0, 0, 0 },
{"links", 'l', POPT_ARG_VAL, &preserve_links, 1, 0, 0 },
-@@ -2048,6 +2051,9 @@ void server_options(char **args, int *argc_p)
+@@ -2053,6 +2056,9 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
{"one-file-system", 'x', POPT_ARG_NONE, 0, 'x', 0, 0 },
{"no-one-file-system",'x',POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
{"no-x", 'x', POPT_ARG_VAL, &one_file_system, 0, 0, 0 },
-@@ -1953,6 +1956,9 @@ void server_options(char **args, int *argc_p)
+@@ -1959,6 +1962,9 @@ void server_options(char **args, int *argc_p)
}
}
return memcmp(sum, F_SUM(file), checksum_len) == 0;
}
-@@ -2201,6 +2203,9 @@ void generate_files(int f_out, const char *local_name)
+@@ -2204,6 +2206,9 @@ void generate_files(int f_out, const char *local_name)
: "enabled");
}
{"fuzzy", 'y', POPT_ARG_VAL, &fuzzy_basis, 1, 0, 0 },
{"no-fuzzy", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
{"no-y", 0, POPT_ARG_VAL, &fuzzy_basis, 0, 0, 0 },
-@@ -1949,8 +1953,14 @@ void server_options(char **args, int *argc_p)
+@@ -1955,8 +1959,14 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";
rsyserr(FERROR_XFER, stat_errno, "recv_generator: failed to stat %s",
full_fname(fname));
goto cleanup;
-@@ -2182,6 +2340,12 @@ void generate_files(int f_out, const char *local_name)
+@@ -2185,6 +2343,12 @@ void generate_files(int f_out, const char *local_name)
if (verbose > 2)
rprintf(FINFO, "generator starting pid=%ld\n", (long)getpid());
if (delete_before && !solo_file && cur_flist->used > 0)
do_delete_pass();
if (delete_during == 2) {
-@@ -2192,7 +2356,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2195,7 +2359,7 @@ void generate_files(int f_out, const char *local_name)
}
do_progress = 0;
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -2234,7 +2398,7 @@ void generate_files(int f_out, const char *local_name)
+@@ -2237,7 +2401,7 @@ void generate_files(int f_out, const char *local_name)
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
} else
dirdev = MAKEDEV(0, 0);
} else
change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));
}
-@@ -2278,7 +2442,21 @@ void generate_files(int f_out, const char *local_name)
+@@ -2284,7 +2448,21 @@ void generate_files(int f_out, const char *local_name)
} while ((cur_flist = cur_flist->next) != NULL);
if (delete_during)
delay_updates ? "delay-updates" : "partial-dir");
return 0;
}
-@@ -1945,6 +1949,8 @@ void server_options(char **args, int *argc_p)
+@@ -1951,6 +1955,8 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--super";
if (size_only)
args[ac++] = "--size-only";
fnamecmp = fname;
fnamecmp_type = FNAMECMP_FNAME;
-@@ -2092,6 +2100,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2095,6 +2103,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
ignore_existing = -ignore_existing;
ignore_non_existing = -ignore_non_existing;
update_only = -update_only;
always_checksum = -always_checksum;
size_only = -size_only;
append_mode = -append_mode;
-@@ -2117,6 +2126,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
+@@ -2120,6 +2129,7 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
ignore_existing = -ignore_existing;
ignore_non_existing = -ignore_non_existing;
update_only = -update_only;
cheers
tobi
-Changes:
+Changes:
2007-04-23
+ fadv_fd_init_func();
+ fadv_close_buffer_size += pos - fadv_fd_pos[fd];
+ fadv_close_ring[fadv_close_ring_head] = newfd;
-+ fadv_close_ring_head = (fadv_close_ring_head + 1) % fadv_max_fd;
++ fadv_close_ring_head = (fadv_close_ring_head + 1) % fadv_max_fd;
+ fadv_close_ring_size ++;
+ if (fadv_close_ring_size == fadv_max_fd || fadv_close_buffer_size > 1024*1024 ){
+ /* it seems fastest to drop things 'in groups' */
+ fadv_close_all();
-+ }
++ }
+ }
+ return close(fd);
+}
+ if (force_change && F_FFLAGS(file) & force_change)
+ undo_make_mutable(fname, F_FFLAGS(file));
+#endif
- if (allowed_lull && !(counter % lull_mod))
- maybe_send_keepalive();
- else if (!(counter & 0xFF))
+ if (counter >= loopchk_limit) {
+ if (allowed_lull)
+ maybe_send_keepalive();
diff --git a/log.c b/log.c
--- a/log.c
+++ b/log.c
{"ignore-errors", 0, POPT_ARG_VAL, &ignore_errors, 1, 0, 0 },
{"no-ignore-errors", 0, POPT_ARG_VAL, &ignore_errors, 0, 0, 0 },
{"max-delete", 0, POPT_ARG_INT, &max_delete, 0, 0, 0 },
-@@ -1852,6 +1878,9 @@ void server_options(char **args, int *argc_p)
+@@ -1858,6 +1884,9 @@ void server_options(char **args, int *argc_p)
if (xfer_dirs && !recurse && delete_mode && am_sender)
args[ac++] = "--no-r";
if (do_compression && def_compress_level != Z_DEFAULT_COMPRESSION) {
if (asprintf(&arg, "--compress-level=%d", def_compress_level) < 0)
goto oom;
-@@ -1939,6 +1968,16 @@ void server_options(char **args, int *argc_p)
+@@ -1945,6 +1974,16 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--delete-excluded";
if (force_delete)
args[ac++] = "--force";
if (rsync_xal_get(fname, sxp->xattr) < 0) {
free_xattr(sxp);
return -1;
-@@ -861,6 +865,11 @@ int set_xattr(const char *fname, const struct file_struct *file,
+@@ -864,6 +868,11 @@ int set_xattr(const char *fname, const struct file_struct *file,
return -1;
}
ndx = F_XATTR(file);
return rsync_xal_set(fname, lst + ndx, fnamecmp, sxp);
}
-@@ -977,7 +986,7 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
+@@ -980,7 +989,7 @@ int set_stat_xattr(const char *fname, struct file_struct *file, mode_t new_mode)
mode = (fst.st_mode & _S_IFMT) | (fmode & ACCESSPERMS)
| (S_ISDIR(fst.st_mode) ? 0700 : 0600);
if (fst.st_mode != mode)
{"rsh", 'e', POPT_ARG_STRING, &shell_cmd, 0, 0, 0 },
{"rsync-path", 0, POPT_ARG_STRING, &rsync_path, 0, 0, 0 },
{"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 },
-@@ -2003,6 +2006,9 @@ void server_options(char **args, int *argc_p)
+@@ -2009,6 +2012,9 @@ void server_options(char **args, int *argc_p)
args[ac++] = tmpdir;
}
{"files-from", 0, POPT_ARG_STRING, &files_from, 0, 0, 0 },
{"from0", '0', POPT_ARG_VAL, &eol_nulls, 1, 0, 0},
{"no-from0", 0, POPT_ARG_VAL, &eol_nulls, 0, 0, 0},
-@@ -1965,6 +1969,9 @@ void server_options(char **args, int *argc_p)
+@@ -1971,6 +1975,9 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -2023,6 +2041,11 @@ void server_options(char **args, int *argc_p)
+@@ -2028,6 +2046,11 @@ void server_options(char **args, int *argc_p)
} else if (inplace)
args[ac++] = "--inplace";
if (inplace) {
#ifdef HAVE_FTRUNCATE
if (partial_dir) {
-@@ -2067,10 +2141,27 @@ char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
+@@ -2072,10 +2146,27 @@ char *check_for_hostspec(char *s, char **host_ptr, int *port_ptr)
char *p;
int not_host;
int hostlen;
+++ b/ssl.c
@@ -0,0 +1,370 @@
+/* -*- c-file-style: "linux" -*-
-+ * ssl.c: operations for negotiating SSL rsync connections.
++ * ssl.c: operations for negotiating SSL rsync connections.
+ *
+ * Copyright (C) 2003 Casey Marshall <rsdio@metastatic.org>
+ *
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
-+ *
++ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
-+ *
++ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
if (rsync_xal_get(fname, sxp->xattr) < 0) {
free_xattr(sxp);
return -1;
-@@ -861,6 +865,11 @@ int set_xattr(const char *fname, const struct file_struct *file,
+@@ -864,6 +868,11 @@ int set_xattr(const char *fname, const struct file_struct *file,
return -1;
}
{"inplace", 0, POPT_ARG_VAL, &inplace, 1, 0, 0 },
{"no-inplace", 0, POPT_ARG_VAL, &inplace, 0, 0, 0 },
{"append", 0, POPT_ARG_NONE, 0, OPT_APPEND, 0, 0 },
-@@ -2048,6 +2057,9 @@ void server_options(char **args, int *argc_p)
+@@ -2053,6 +2062,9 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
+ "Remote option must start with a dash: %s\n", arg);
+ return 0;
+ }
-+ if (remote_option_cnt+3 > remote_option_alloc) {
++ if (remote_option_cnt+2 >= remote_option_alloc) {
+ remote_option_alloc += 16;
+ remote_options = realloc_array(remote_options,
+ const char *, remote_option_alloc);
case OPT_WRITE_BATCH:
/* batch_name is already set */
write_batch = 1;
-@@ -1826,6 +1852,11 @@ void server_options(char **args, int *argc_p)
- #endif
+@@ -1832,6 +1858,11 @@ void server_options(char **args, int *argc_p)
+
argstr[x] = '\0';
+ if (x > (int)sizeof argstr) { /* Not possible... */
args[ac++] = argstr;
#ifdef ICONV_OPTION
-@@ -2048,6 +2079,21 @@ void server_options(char **args, int *argc_p)
+@@ -2053,6 +2084,21 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";
{"no-backup", 0, POPT_ARG_VAL, &make_backups, 0, 0, 0 },
{"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
{"suffix", 0, POPT_ARG_STRING, &backup_suffix, 0, 0, 0 },
-@@ -1951,6 +1954,8 @@ void server_options(char **args, int *argc_p)
+@@ -1957,6 +1960,8 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}
if (files_from) {
char *h, *p;
int q;
-@@ -1953,6 +1972,25 @@ void server_options(char **args, int *argc_p)
+@@ -1959,6 +1978,25 @@ void server_options(char **args, int *argc_p)
}
}
+{
+ pid_t pid;
+ int pipefds[2];
-+
++
+ if (verbose >= 2)
+ print_child_argv("opening connection using:", command);
+
+pid_t run_filter_on_file(char *command[], int out, int in)
+{
+ pid_t pid;
-+
++
+ if (verbose >= 2)
+ print_child_argv("opening connection using:", command);
+
{"inplace", 0, POPT_ARG_VAL, &inplace, 1, 0, 0 },
{"no-inplace", 0, POPT_ARG_VAL, &inplace, 0, 0, 0 },
{"append", 0, POPT_ARG_NONE, 0, OPT_APPEND, 0, 0 },
-@@ -1885,6 +1888,12 @@ void server_options(char **args, int *argc_p)
+@@ -1891,6 +1894,12 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
default:
/* A large opt value means that set_refuse_options()
* turned this option off. */
-@@ -1897,6 +1932,15 @@ void server_options(char **args, int *argc_p)
+@@ -1903,6 +1938,15 @@ void server_options(char **args, int *argc_p)
args[ac++] = arg;
}
am_starting_up = 0;
return 1;
-@@ -2048,6 +2077,12 @@ void server_options(char **args, int *argc_p)
+@@ -2053,6 +2082,12 @@ void server_options(char **args, int *argc_p)
else if (remove_source_files)
args[ac++] = "--remove-sent-files";