summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a64f19e)
the sender (which would cause it to die with a cryptic error). Instead,
warn the user when the file's size is too large for checksum processing.
- Fixed several places in the code that were not returning the right
errno when a function failed.
- Fixed several places in the code that were not returning the right
errno when a function failed.
+ - Fixed the backing up of a device or special file into a backup dir.
+
- Moved the setting of the socket options prior to the connect().
- If rsync exits in the middle of a --progress output, it now outputs a
- Moved the setting of the socket options prior to the connect().
- If rsync exits in the middle of a --progress output, it now outputs a
- Fixed a problem with how a destination path with a trailing slash was
compared against the daemon excludes.
- Fixed a problem with how a destination path with a trailing slash was
compared against the daemon excludes.
+ - If a file's length is so huge that we overflow a checksum buffer count
+ (i.e. several hundred TB), warn the user and avoid sending an invalid
+ checksum struct over the wire.
+
- Use the overflow_exit() function for overflows, not out_of_memory().
ENHANCEMENTS:
- Use the overflow_exit() function for overflows, not out_of_memory().
ENHANCEMENTS:
{
int32 blength;
int s2length;
{
int32 blength;
int s2length;
if (block_size)
blength = block_size;
if (block_size)
blength = block_size;
blength = BLOCK_SIZE;
else {
int32 c;
blength = BLOCK_SIZE;
else {
int32 c;
int cnt;
for (c = 1, l = len, cnt = 0; l >>= 2; c <<= 1, cnt++) {}
if (cnt >= 31 || c >= MAX_BLOCK_SIZE)
int cnt;
for (c = 1, l = len, cnt = 0; l >>= 2; c <<= 1, cnt++) {}
if (cnt >= 31 || c >= MAX_BLOCK_SIZE)
s2length = SUM_LENGTH;
} else {
int32 c;
s2length = SUM_LENGTH;
} else {
int32 c;
int b = BLOCKSUM_BIAS;
for (l = len; l >>= 1; b += 2) {}
for (c = blength; (c >>= 1) && b; b--) {}
int b = BLOCKSUM_BIAS;
for (l = len; l >>= 1; b += 2) {}
for (c = blength; (c >>= 1) && b; b--) {}
sum->blength = blength;
sum->s2length = s2length;
sum->remainder = (int32)(len % blength);
sum->blength = blength;
sum->s2length = s2length;
sum->remainder = (int32)(len % blength);
- sum->count = (int32)(len / blength) + (sum->remainder != 0);
+ sum->count = (int32)(l = (len / blength) + (sum->remainder != 0));
+
+ if ((int64)sum->count != l)
+ sum->count = -1;
if (sum->count && verbose > 2) {
rprintf(FINFO,
if (sum->count && verbose > 2) {
rprintf(FINFO,
*
* Generate approximately one checksum every block_len bytes.
*/
*
* Generate approximately one checksum every block_len bytes.
*/
-static void generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
+static int generate_and_send_sums(int fd, OFF_T len, int f_out, int f_copy)
{
int32 i;
struct map_struct *mapbuf;
{
int32 i;
struct map_struct *mapbuf;
OFF_T offset = 0;
sum_sizes_sqroot(&sum, len);
OFF_T offset = 0;
sum_sizes_sqroot(&sum, len);
+ if (sum.count < 0)
+ return -1;
write_sum_head(f_out, &sum);
if (append_mode > 0 && f_copy < 0)
write_sum_head(f_out, &sum);
if (append_mode > 0 && f_copy < 0)
if (len > 0)
mapbuf = map_file(fd, len, MAX_MAP_SIZE, sum.blength);
if (len > 0)
mapbuf = map_file(fd, len, MAX_MAP_SIZE, sum.blength);
if (mapbuf)
unmap_file(mapbuf);
if (mapbuf)
unmap_file(mapbuf);
if (read_batch)
goto cleanup;
if (read_batch)
goto cleanup;
- if (statret != 0 || whole_file)
+ if (statret != 0 || whole_file || sx.st.st_size <= 0)
write_sum_head(f_out, NULL);
else {
write_sum_head(f_out, NULL);
else {
- generate_and_send_sums(fd, sx.st.st_size, f_out, f_copy);
+ if (generate_and_send_sums(fd, sx.st.st_size, f_out, f_copy) < 0) {
+ rprintf(FWARNING,
+ "WARNING: file is too large for checksum sending: %s\n",
+ fnamecmp);
+ write_sum_head(f_out, NULL);
+ }