diff options
author | Wayne Davison <wayned@samba.org> | 2005-05-14 18:44:57 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2005-05-14 18:44:57 +0000 |
commit | a289f89fbe92410d2a875481197a75668bd31656 (patch) | |
tree | 1941d2a23f2d44c12452b20c6cd03dd768caf824 /flist.c | |
parent | ba64001df85b6bfed55ea96b4d73879f7fb26173 (diff) | |
download | rsync-a289f89fbe92410d2a875481197a75668bd31656.tar.gz rsync-a289f89fbe92410d2a875481197a75668bd31656.tar.bz2 rsync-a289f89fbe92410d2a875481197a75668bd31656.zip |
Treat a trailing ".." dir-name as if "../" had been specified so
that we don't use the name in the destination path and save files
into a higher destination directory.
Diffstat (limited to 'flist.c')
-rw-r--r-- | flist.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1127,6 +1127,14 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) fname[l] = '\0'; } is_dot_dir = 1; + } else if (l > 1 && fname[l-1] == '.' && fname[l-2] == '.' + && (l == 2 || fname[l-3] == '/')) { + if (l + 2 >= MAXPATHLEN) + overflow("send_file_list"); + fname[l++] = '/'; + fname[l++] = '.'; + fname[l] = '\0'; + is_dot_dir = 1; } else { is_dot_dir = fname[l-1] == '.' && (l == 1 || fname[l-2] == '/'); |