search for: sum_end

Displaying 20 results from an estimated 20 matches for "sum_end".

2003 May 08
5
MD4 bug-fix for protocol version 27
...-------- Index: checksum.c =================================================================== RCS file: /cvsroot/rsync/checksum.c,v retrieving revision 1.25 diff -u -r1.25 checksum.c --- checksum.c 10 Apr 2003 01:50:12 -0000 1.25 +++ checksum.c 7 May 2003 14:27:06 -0000 @@ -184,7 +184,7 @@ void sum_end(char *sum) { - if (sumresidue) { + if (sumresidue || remote_version >= 27) { mdfour_update(&md, (uchar *)sumrbuf, sumresidue); }
2002 Jan 13
0
rsynd-2.5.1 / checksum.c patches
...te(s,4); } -void sum_update(char *p,int len) +void sum_update(void *p1,int len) { +unsigned char * p; + p = (unsigned char *)p1; int i; if (len + sumresidue < CSUM_CHUNK) { memcpy(sumrbuf+sumresidue, p, len); @@ -170,7 +173,7 @@ } } -void sum_end(char *sum) +void sum_end(void *sum) { if (sumresidue) { mdfour_update(&md, (uchar *)sumrbuf, sumresidue);
2006 Jan 12
1
Checksum of a file
Hi all, With reference to the mail subjected : IO Timeout Error in file less than 3 MB, thanks to Wayne Davison and Tony for having suggested the changes to be done. I have moved to rsync version 2.6.6 from the 2.4 series. As per my project requirement, i need to know the checksum of the file being synced. For this purpose i tried debugging the code. I understand that rsync breaks the
2003 Mar 22
2
[RFC] protocol version
I'm in the midst of coding a patch set for consideration that will bump the protocol version and have a couple of observations. The current minimum backwards-compatible protocol is 15 but we have code that checks for protocol versions as old as 12. If someone else doesn't beat me to it i'm considering cleaning out the pre-15 compatibility code. A backwards compatibility patch could
2003 Jul 24
0
(no subject)
...argv[argc-1]; } diff -E -B -c -r rsync-2.5.6/proto.h rsync-2.5.6-remotebatch/proto.h *** rsync-2.5.6/proto.h Mon Jan 27 03:35:09 2003 --- rsync-2.5.6-remotebatch/proto.h Wed Jul 23 11:27:53 2003 *************** *** 31,37 **** void sum_init(void); void sum_update(char *p, int len); void sum_end(char *sum); ! void close_all(void); void _exit_cleanup(int code, const char *file, int line); void cleanup_disable(void); void cleanup_set(char *fnametmp, char *fname, struct file_struct *file, --- 31,37 ---- void sum_init(void); void sum_update(char *p, int len); void sum_end(char *sum...
2003 May 20
0
patch for better handling of write failures (disk full)
...offset += len; } @@ -278,7 +283,9 @@ if (fd != -1 && offset > 0 && sparse_end(fd) != 0) { rprintf(FERROR,"write failed on %s : %s\n", fname,strerror(errno)); - exit_cleanup(RERR_FILEIO); + discard = 1; + fd = -1; + // exit_cleanup(RERR_FILEIO); } sum_end(file_sum1); @@ -293,6 +300,8 @@ return 0; } } + if (discard) + return 2; return 1; } @@ -458,6 +467,16 @@ close(fd1); } close(fd2); + + /* + * This means a write error occured, and the file is discarded + */ + if (recv_ok == 2) { + if (verbose > 2) +...
2004 Apr 27
1
rsync-2.6.1 close() fixes
...-268,6 +269,12 @@ static int receive_data(int f_in,struct exit_cleanup(RERR_FILEIO); } + if (do_fsync && (fd != -1) && (fsync(fd) != 0)) { + rprintf(FERROR, "fsync failed on %s: %s\n", + full_fname(fname), strerror(errno)); + exit_cleanup(RERR_FILEIO); + } + sum_end(file_sum1); read_buf(f_in,file_sum2,MD4_SUM_LENGTH); @@ -458,7 +465,11 @@ int recv_files(int f_in,struct file_list if (fd1 != -1) { close(fd1); } - close(fd2); + if (close(fd2) != 0) { + rprintf(FERROR, "close failed on %s: %s\n", + full_fname(fnametmp), strerror(errn...
2003 May 23
1
PATCH: better handling for write failures (disk full)
...offset += len; } @@ -278,7 +283,9 @@ if (fd != -1 && offset > 0 && sparse_end(fd) != 0) { rprintf(FERROR,"write failed on %s : %s\n", fname,strerror(errno)); - exit_cleanup(RERR_FILEIO); + discard = 1; + fd = -1; + // exit_cleanup(RERR_FILEIO); } sum_end(file_sum1); @@ -293,6 +300,8 @@ return 0; } } + if (discard) + return 2; return 1; } @@ -458,6 +467,16 @@ close(fd1); } close(fd2); + + /* + * This means a write error occured, and the file is discarded + */ + if (recv_ok == 2) { + if (verbose > 2) +...
2002 Aug 05
5
[patch] read-devices
...attempt. This is a protocol change! + It would be better to allow checksum lengths to differ between files. #ET# XXX */ + else + csum_length = 2; + } else + csum_length = SUM_LENGTH; + rprintf(FINFO, "#ET# csum_length=%d\n", csum_length); } @@ -171,9 +176,9 @@ } void sum_end(char *sum) { - if (sumresidue) { + if (sumresidue) { /* remove the test to address http://lists.samba.org/pipermail/rsync/2002-August/008011.html */ mdfour_update(&md, (uchar *)sumrbuf, sumresidue); } mdfour_result(&md, (uchar *)sum); Only in rsync-patched: config.h diff -r -u4 rs...
2004 May 10
2
read error produces null-byte-filled destination file
I've run into a bug in the IO handling when reading a file. Suppose I have a file that lives on an NFS filesystem. That filesystem is NOT being exported with auth=0 permissions. So, if I try to access a file as root, it successfully opens the file, but subsequent reads fail with EACCES. This produces a destination file full of null bytes. I noticed this with 2.5.7, but checked 2.6.2 as
2003 Oct 05
2
Possible security hole
Maybe security related mails should be sent elsewhere? I didn't notice any so here it goes: sender.c:receive_sums() s->count = read_int(f); .. s->sums = (struct sum_buf *)malloc(sizeof(s->sums[0])*s->count); if (!s->sums) out_of_memory("receive_sums"); for (i=0; i < (int) s->count;i++) { s->sums[i].sum1 = read_int(f);
2003 Oct 18
0
Added functionality --compare-file and --compare-auto
...der) { + args[ac++] = "--compare-auto"; + } *argc = ac; } diff -aur rsync-2.5.6/proto.h rsync-arh/proto.h --- rsync-2.5.6/proto.h Mon Jan 27 03:35:09 2003 +++ rsync-arh/proto.h Fri Oct 17 08:26:52 2003 @@ -31,7 +31,7 @@ void sum_init(void); void sum_update(char *p, int len); void sum_end(char *sum); -void close_all(void); +void close_all(); void _exit_cleanup(int code, const char *file, int line); void cleanup_disable(void); void cleanup_set(char *fnametmp, char *fname, struct file_struct *file, @@ -93,6 +93,7 @@ char *f_name(struct file_struct *f); void recv_generator(char *f...
2004 Feb 09
1
[patch] Add `--link-by-hash' option.
...i) { rprintf(FERROR, "write failed on %s: %s\n", @@ -296,6 +301,8 @@ see_token(map, len); sum_update(map,len); + if (md4) + mdfour_update(&mdfour_data,map,len); } if (fd != -1 && write_file(fd,map,len) != (int) len) { @@ -316,6 +323,9 @@ } sum_end(file_sum1); + if (md4) { + mdfour_result(&mdfour_data, (unsigned char*)md4); + } read_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) { @@ -351,6 +361,7 @@ extern int preserve_perms; extern int delete_after; extern int orig_umask; + extern char *link_by_hash_dir; struct s...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 4).
...!= i) { rprintf(FERROR, "write failed on %s: %s\n", @@ -243,6 +248,8 @@ see_token(map, len); sum_update(map,len); + if (md4) + mdfour_update(&mdfour_data,map,len); } if (fd != -1 && write_file(fd,map,len) != (int) len) { @@ -265,6 +272,8 @@ } sum_end(file_sum1); + if (md4) + mdfour_result(&mdfour_data, (unsigned char*)md4); read_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) { @@ -299,6 +308,7 @@ extern int preserve_perms; extern int delete_after; extern int orig_umask; + extern char *link_by_hash_dir; struct stats i...
2004 Feb 17
0
[patch] Add `--link-by-hash' option (rev 3).
...!= i) { rprintf(FERROR, "write failed on %s: %s\n", @@ -243,6 +248,8 @@ see_token(map, len); sum_update(map,len); + if (md4) + mdfour_update(&mdfour_data,map,len); } if (fd != -1 && write_file(fd,map,len) != (int) len) { @@ -265,6 +272,8 @@ } sum_end(file_sum1); + if (md4) + mdfour_result(&mdfour_data, (unsigned char*)md4); read_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) { @@ -299,6 +308,7 @@ extern int preserve_perms; extern int delete_after; extern int orig_umask; + extern char *link_by_hash_dir; struct stats i...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 5).
...!= i) { rprintf(FERROR, "write failed on %s: %s\n", @@ -243,6 +248,8 @@ see_token(map, len); sum_update(map,len); + if (md4) + mdfour_update(&mdfour_data,map,len); } if (fd != -1 && write_file(fd,map,len) != (int) len) { @@ -265,6 +272,8 @@ } sum_end(file_sum1); + if (md4) + mdfour_result(&mdfour_data, (unsigned char*)md4); read_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) { @@ -299,6 +308,7 @@ extern int preserve_perms; extern int delete_after; extern int orig_umask; + extern char *link_by_hash_dir; struct stats i...
2004 Feb 16
1
[patch] Add `--link-by-hash' option (rev 2).
...!= i) { rprintf(FERROR, "write failed on %s: %s\n", @@ -243,6 +248,8 @@ see_token(map, len); sum_update(map,len); + if (md4) + mdfour_update(&mdfour_data,map,len); } if (fd != -1 && write_file(fd,map,len) != (int) len) { @@ -265,6 +272,8 @@ } sum_end(file_sum1); + if (md4) + mdfour_result(&mdfour_data, (unsigned char*)md4); read_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) { @@ -299,6 +308,7 @@ extern int preserve_perms; extern int delete_after; extern int orig_umask; + extern char *link_by_hash_dir; struct stats i...
2004 Jun 17
1
[PATCH] make write_batch local
...b/receiver.c 17 Jun 2004 04:01:58 -0000 *************** *** 46,51 **** --- 46,52 ---- extern int module_id; extern int ignore_errors; extern int orig_umask; + extern int write_batch; extern int keep_partial; extern int checksum_seed; *************** *** 279,284 **** --- 280,287 ---- sum_end(file_sum1); read_buf(f_in,file_sum2,MD4_SUM_LENGTH); + if (write_batch) + write_batch_delta_file(file_sum2, MD4_SUM_LENGTH); if (verbose > 2) { rprintf(FINFO,"got file_sum\n"); } *************** *** 334,339 **** --- 337,345 ---- continue; } + if (write_...
2001 Aug 06
1
merge rsync+ into rsync (was Re: rsync-2.4.7 NEWS file)
> Just curious: what about the rsync+ patch? Thanks for the reminder. I've just committed Jos's rsync+ patch onto the "branch_mbp_rsyncplus_merge" branch. If it works OK and nobody screams I will move it across onto the main tree tomorrow or Wednesday. I see the patch doesn't add documentation about the new options to the man page, so we should fix that in the future.
2020 Feb 09
2
[RFC PATCH] Add SHA1 support
...switch (cursum_type) { + case CSUM_SHA1: case CSUM_MD5: - md5_update(&md, (uchar *)p, len); + if (!mdlib_update(md_sum, (void *)p, len)) + openssl_failure(__func__); break; case CSUM_MD4: case CSUM_MD4_OLD: @@ -342,8 +418,10 @@ void sum_update(const char *p, int32 len) int sum_end(char *sum) { switch (cursum_type) { + case CSUM_SHA1: case CSUM_MD5: - md5_result(&md, (uchar *)sum); + if (!mdlib_finalize(md_sum, (void *)sum)) + openssl_failure(__func__); break; case CSUM_MD4: case CSUM_MD4_OLD: diff --git a/configure.ac b/configure.ac index 12db9357...