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
Avoid a non-writable-by-the-user file when copying xattrs.
[rsync/rsync.git]
/
generator.c
diff --git
a/generator.c
b/generator.c
index
c0bffb2
..
b12087f
100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-567,6
+567,12
@@
static void sum_sizes_sqroot(struct sum_struct *sum, int64 len)
int s2length;
int64 l;
int s2length;
int64 l;
+ if (len < 0) {
+ /* The file length overflowed our int64 var, so we can't process this file. */
+ sum->count = -1; /* indicate overflow error */
+ return;
+ }
+
if (block_size)
blength = block_size;
else if (len <= BLOCK_SIZE * BLOCK_SIZE)
if (block_size)
blength = block_size;
else if (len <= BLOCK_SIZE * BLOCK_SIZE)
@@
-1032,7
+1038,7
@@
static void list_file_entry(struct file_struct *f)
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
rprintf(FINFO, "%s %*s %s %s -> %s\n",
#ifdef SUPPORT_LINKS
if (preserve_links && S_ISLNK(f->mode)) {
rprintf(FINFO, "%s %*s %s %s -> %s\n",
- permbuf, colwidth,
comma
_num(len),
+ permbuf, colwidth,
human
_num(len),
timestring(f->modtime), f_name(f, NULL),
F_SYMLINK(f));
} else
timestring(f->modtime), f_name(f, NULL),
F_SYMLINK(f));
} else
@@
-1043,7
+1049,7
@@
static void list_file_entry(struct file_struct *f)
f_name(f, NULL));
} else {
rprintf(FINFO, "%s %*s %s %s\n",
f_name(f, NULL));
} else {
rprintf(FINFO, "%s %*s %s %s\n",
- permbuf, colwidth,
comma
_num(len),
+ permbuf, colwidth,
human
_num(len),
timestring(f->modtime), f_name(f, NULL));
}
}
timestring(f->modtime), f_name(f, NULL));
}
}
@@
-1354,10
+1360,11
@@
static void recv_generator(char *fname, struct file_struct *file, int ndx,
const char *sl = F_SYMLINK(file);
if (safe_symlinks && unsafe_symlink(sl, fname)) {
if (INFO_GTE(NAME, 1)) {
const char *sl = F_SYMLINK(file);
if (safe_symlinks && unsafe_symlink(sl, fname)) {
if (INFO_GTE(NAME, 1)) {
- if (solo_file)
+ if (solo_file)
{
/* fname contains the destination path, but we
* want to report the source path. */
fname = f_name(file, NULL);
/* fname contains the destination path, but we
* want to report the source path. */
fname = f_name(file, NULL);
+ }
rprintf(FINFO,
"ignoring unsafe symlink \"%s\" -> \"%s\"\n",
fname, sl);
rprintf(FINFO,
"ignoring unsafe symlink \"%s\" -> \"%s\"\n",
fname, sl);