diff options
author | Wayne Davison <wayned@samba.org> | 2008-04-16 09:32:22 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2008-04-16 09:32:22 -0700 |
commit | 311676ed21eb61ec49187b9dd064aef18997d470 (patch) | |
tree | 624827402bcd3b2679ffb64a2f5e368d6fbb60f5 /main.c | |
parent | 4616867b0d16cd6f391c0ba0f79ad3cb18c3dcda (diff) | |
download | rsync-311676ed21eb61ec49187b9dd064aef18997d470.tar.gz |
Fixed a problem with how the daemon filters deal with
a destination directory with a trailing slash.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -507,12 +507,20 @@ static char *get_local_name(struct file_list *flist, char *dest_path) if (!dest_path || list_only) return NULL; - if (daemon_filter_list.head - && (check_filter(&daemon_filter_list, FLOG, dest_path, 0 != 0) < 0 - || check_filter(&daemon_filter_list, FLOG, dest_path, 1 != 0) < 0)) { - rprintf(FERROR, "skipping daemon-excluded destination \"%s\"\n", - dest_path); - exit_cleanup(RERR_FILESELECT); + if (daemon_filter_list.head) { + char *slash = strrchr(dest_path, '/'); + if (slash && slash[1] == '\0') + *slash = '\0'; + else + slash = NULL; + if (check_filter(&daemon_filter_list, FLOG, dest_path, 0) < 0 + || check_filter(&daemon_filter_list, FLOG, dest_path, 1) < 0) { + rprintf(FERROR, "skipping daemon-excluded destination \"%s\"\n", + dest_path); + exit_cleanup(RERR_FILESELECT); + } + if (slash) + *slash = '/'; } /* See what currently exists at the destination. */ |