diff options
author | Wayne Davison <wayned@samba.org> | 2008-05-31 14:51:38 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2008-05-31 14:51:38 -0700 |
commit | 164cb66addee693700c70fed63d996872fcc3edb (patch) | |
tree | 8d883da9cbfda6becc81b217cc7b5457d70323dc /main.c | |
parent | 0d9eba0312d01b7c893e74f585b8214845610145 (diff) | |
download | rsync-164cb66addee693700c70fed63d996872fcc3edb.tar.gz rsync-164cb66addee693700c70fed63d996872fcc3edb.tar.bz2 rsync-164cb66addee693700c70fed63d996872fcc3edb.zip |
Fixed the destination path check so that it cannot exclude a
dot dir.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -509,12 +509,13 @@ static char *get_local_name(struct file_list *flist, char *dest_path) if (daemon_filter_list.head) { char *slash = strrchr(dest_path, '/'); - if (slash && slash[1] == '\0') + if (slash && (slash[1] == '\0' || (slash[1] == '.' && slash[2] == '\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) { + if ((*dest_path != '.' || dest_path[1] != '\0') + && (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); |