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
Actually, since the close calls shouldn't fail (now that listener
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
ebb70e4
..
4e0af36
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-531,7
+531,7
@@
void receive_file_entry(struct file_struct **fptr, unsigned short flags,
static uid_t uid;
static gid_t gid;
static char lastname[MAXPATHLEN], *lastdir;
static uid_t uid;
static gid_t gid;
static char lastname[MAXPATHLEN], *lastdir;
- static int lastdir_len = -1;
+ static int lastdir_
depth, lastdir_
len = -1;
char thisname[MAXPATHLEN];
unsigned int l1 = 0, l2 = 0;
int alloc_len, basename_len, dirname_len, linkname_len, sum_len;
char thisname[MAXPATHLEN];
unsigned int l1 = 0, l2 = 0;
int alloc_len, basename_len, dirname_len, linkname_len, sum_len;
@@
-570,10
+570,10
@@
void receive_file_entry(struct file_struct **fptr, unsigned short flags,
strlcpy(lastname, thisname, MAXPATHLEN);
strlcpy(lastname, thisname, MAXPATHLEN);
- clean_fname(thisname);
+ clean_fname(thisname
, 0
);
if (sanitize_paths)
if (sanitize_paths)
- sanitize_path(thisname,
NULL
);
+ sanitize_path(thisname,
thisname, "", 0
);
if ((basename = strrchr(thisname, '/')) != NULL) {
dirname_len = ++basename - thisname; /* counts future '\0' */
if ((basename = strrchr(thisname, '/')) != NULL) {
dirname_len = ++basename - thisname; /* counts future '\0' */
@@
-656,6
+656,8
@@
void receive_file_entry(struct file_struct **fptr, unsigned short flags,
memcpy(bp, dirname, dirname_len - 1);
bp += dirname_len;
bp[-1] = '\0';
memcpy(bp, dirname, dirname_len - 1);
bp += dirname_len;
bp[-1] = '\0';
+ if (sanitize_paths)
+ lastdir_depth = count_dir_elements(lastdir);
} else if (dirname)
file->dirname = dirname;
} else if (dirname)
file->dirname = dirname;
@@
-671,7
+673,7
@@
void receive_file_entry(struct file_struct **fptr, unsigned short flags,
file->u.link = bp;
read_sbuf(f, bp, linkname_len - 1);
if (sanitize_paths)
file->u.link = bp;
read_sbuf(f, bp, linkname_len - 1);
if (sanitize_paths)
- sanitize_path(bp,
lastdir
);
+ sanitize_path(bp,
bp, "", lastdir_depth
);
bp += linkname_len;
}
#endif
bp += linkname_len;
}
#endif
@@
-759,9
+761,9
@@
struct file_struct *make_file(char *fname, struct file_list *flist,
rprintf(FINFO, "skipping overly long name: %s\n", fname);
return NULL;
}
rprintf(FINFO, "skipping overly long name: %s\n", fname);
return NULL;
}
- clean_fname(thisname);
+ clean_fname(thisname
, 0
);
if (sanitize_paths)
if (sanitize_paths)
- sanitize_path(thisname,
NULL
);
+ sanitize_path(thisname,
thisname, "", 0
);
memset(sum, 0, SUM_LENGTH);
memset(sum, 0, SUM_LENGTH);
@@
-1059,7
+1061,7
@@
struct file_list *send_file_list(int f, int argc, char *argv[])
"send_file_list");
if (f != -1) {
"send_file_list");
if (f != -1) {
- io_start_buffering_out(
f
);
+ io_start_buffering_out();
if (filesfrom_fd >= 0) {
if (argv[0] && !push_dir(argv[0])) {
rsyserr(FERROR, errno, "push_dir %s failed",
if (filesfrom_fd >= 0) {
if (argv[0] && !push_dir(argv[0])) {
rsyserr(FERROR, errno, "push_dir %s failed",
@@
-1077,13
+1079,13
@@
struct file_list *send_file_list(int f, int argc, char *argv[])
if (use_ff_fd) {
if (read_filesfrom_line(filesfrom_fd, fname) == 0)
break;
if (use_ff_fd) {
if (read_filesfrom_line(filesfrom_fd, fname) == 0)
break;
- sanitize_path(fname,
NULL
);
+ sanitize_path(fname,
fname, "", 0
);
} else {
if (argc-- == 0)
break;
strlcpy(fname, *argv++, MAXPATHLEN);
if (sanitize_paths)
} else {
if (argc-- == 0)
break;
strlcpy(fname, *argv++, MAXPATHLEN);
if (sanitize_paths)
- sanitize_path(fname,
NULL
);
+ sanitize_path(fname,
fname, "", 0
);
}
l = strlen(fname);
}
l = strlen(fname);