Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0d9eba0
)
Fixed the destination path check so that it cannot exclude a
author
Wayne Davison
<wayned@samba.org>
Sat, 31 May 2008 21:51:38 +0000
(14:51 -0700)
committer
Wayne Davison
<wayned@samba.org>
Sat, 31 May 2008 21:51:38 +0000
(14:51 -0700)
dot dir.
main.c
patch
|
blob
|
blame
|
history
diff --git
a/main.c
b/main.c
index
5fba5e6
..
6881c8e
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-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 (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;
*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);
rprintf(FERROR, "skipping daemon-excluded destination \"%s\"\n",
dest_path);
exit_cleanup(RERR_FILESELECT);