Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't output a duplicate warning when the daemon-config excludes a
[rsync/rsync.git]
/
generator.c
diff --git
a/generator.c
b/generator.c
index
e4e5635
..
b22d9d6
100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-1202,38
+1202,40
@@
static void recv_generator(char *fname, struct file_struct *file, int ndx,
uchar fnamecmp_type;
int implied_dirs_are_missing = relative_paths && !implied_dirs && protocol_version < 30;
int del_opts = delete_mode || force_delete ? DEL_RECURSE : 0;
uchar fnamecmp_type;
int implied_dirs_are_missing = relative_paths && !implied_dirs && protocol_version < 30;
int del_opts = delete_mode || force_delete ? DEL_RECURSE : 0;
+ int is_dir = !S_ISDIR(file->mode) ? 0
+ : inc_recurse && ndx != cur_flist->ndx_start - 1 ? -1
+ : 1;
if (verbose > 2)
rprintf(FINFO, "recv_generator(%s,%d)\n", fname, ndx);
if (list_only) {
if (verbose > 2)
rprintf(FINFO, "recv_generator(%s,%d)\n", fname, ndx);
if (list_only) {
- if (S_ISDIR(file->mode)
- && ((!implied_dirs && file->flags & FLAG_IMPLIED_DIR)
- || (inc_recurse && ndx != cur_flist->ndx_start - 1)))
+ if (is_dir < 0
+ || (is_dir && !implied_dirs && file->flags & FLAG_IMPLIED_DIR))
return;
list_file_entry(file);
return;
}
if (server_filter_list.head) {
return;
list_file_entry(file);
return;
}
if (server_filter_list.head) {
+ int filtered = check_filter(&server_filter_list, fname, is_dir) < 0;
+ if (is_dir < 0 && filtered)
+ return;
if (excluded_below >= 0) {
if (F_DEPTH(file) > excluded_below
&& (!implied_dirs_are_missing || f_name_has_prefix(file, excluded_dir)))
goto skipping;
excluded_below = -1;
}
if (excluded_below >= 0) {
if (F_DEPTH(file) > excluded_below
&& (!implied_dirs_are_missing || f_name_has_prefix(file, excluded_dir)))
goto skipping;
excluded_below = -1;
}
- if (check_filter(&server_filter_list, fname,
- S_ISDIR(file->mode)) < 0) {
- if (S_ISDIR(file->mode)) {
+ if (filtered) {
+ if (is_dir) {
excluded_below = F_DEPTH(file);
excluded_dir = file;
}
skipping:
excluded_below = F_DEPTH(file);
excluded_dir = file;
}
skipping:
- if (verbose) {
- rprintf(FINFO,
- "skipping server-excluded file \"%s\"\n",
- fname);
- }
+ rprintf(FERROR_XFER,
+ "skipping daemon-excluded file \"%s\"\n",
+ fname);
return;
}
}
return;
}
}
@@
-1245,7
+1247,7
@@
static void recv_generator(char *fname, struct file_struct *file, int ndx,
dry_run--;
missing_below = -1;
} else if (!dry_run) {
dry_run--;
missing_below = -1;
} else if (!dry_run) {
- if (
S_ISDIR(file->mode)
)
+ if (
is_dir
)
file->flags |= FLAG_MISSING_DIR;
return;
}
file->flags |= FLAG_MISSING_DIR;
return;
}
@@
-1293,18
+1295,14
@@
static void recv_generator(char *fname, struct file_struct *file, int ndx,
need_fuzzy_dirlist = 0;
}
need_fuzzy_dirlist = 0;
}
- statret = link_stat(fname, &sx.st,
- keep_dirlinks && S_ISDIR(file->mode));
+ statret = link_stat(fname, &sx.st, keep_dirlinks && is_dir);
stat_errno = errno;
}
if (ignore_non_existing > 0 && statret == -1 && stat_errno == ENOENT) {
stat_errno = errno;
}
if (ignore_non_existing > 0 && statret == -1 && stat_errno == ENOENT) {
- if (verbose > 1) {
- rprintf(FINFO, "not creating new %s \"%s\"\n",
- S_ISDIR(file->mode) ? "directory" : "file",
- fname);
- }
- if (S_ISDIR(file->mode)) {
+ if (is_dir) {
+ if (is_dir < 0)
+ return;
if (missing_below < 0) {
if (dry_run)
dry_run++;
if (missing_below < 0) {
if (dry_run)
dry_run++;
@@
-1313,16
+1311,20
@@
static void recv_generator(char *fname, struct file_struct *file, int ndx,
}
file->flags |= FLAG_MISSING_DIR;
}
}
file->flags |= FLAG_MISSING_DIR;
}
+ if (verbose > 1) {
+ rprintf(FINFO, "not creating new %s \"%s\"\n",
+ is_dir ? "directory" : "file", fname);
+ }
return;
}
if (statret == 0 && sx.st.st_uid == our_uid)
del_opts |= DEL_OWNED_BY_US;
return;
}
if (statret == 0 && sx.st.st_uid == our_uid)
del_opts |= DEL_OWNED_BY_US;
- if (
S_ISDIR(file->mode)
) {
+ if (
is_dir
) {
if (!implied_dirs && file->flags & FLAG_IMPLIED_DIR)
goto cleanup;
if (!implied_dirs && file->flags & FLAG_IMPLIED_DIR)
goto cleanup;
- if (i
nc_recurse && ndx != cur_flist->ndx_start - 1
) {
+ if (i
s_dir < 0
) {
/* In inc_recurse mode we want to make sure any missing
* directories get created while we're still processing
* the parent dir (which allows us to touch the parent
/* In inc_recurse mode we want to make sure any missing
* directories get created while we're still processing
* the parent dir (which allows us to touch the parent