[Bug 8847] detect-renamed.diff update to ensure existence of directory for partial-dir

samba-bugs at samba.org samba-bugs at samba.org
Sat Feb 2 15:59:19 MST 2013


https://bugzilla.samba.org/show_bug.cgi?id=8847

--- Comment #2 from Russell Black <black.russell at gmail.com> 2013-02-02 22:59:17 UTC ---
If it helps to evaluate the patch, here is the difference in the code between
this one and the regular detect-renamed patch.  Seems pretty straightforward.

$ diff rsync-3.0.9\ 2 rsync-3.0.9\ 3
diff rsync-3.0.9 2/proto.h rsync-3.0.9 3/proto.h
307a308
> int do_mkdir_path(char *fname, mode_t mode);

diff rsync-3.0.9 2/syscall.c rsync-3.0.9 3/syscall.c
219a220,235
> int do_mkdir_path(char *fname, mode_t mode)
> {
> 	char fnametmp[MAXPATHLEN], *fnametmpptr;
> 	STRUCT_STAT st;
> 
> 	if (fname) {
> 		strcpy(fnametmp, fname);
> 		if ((fnametmpptr = strrchr(fnametmp, '/')) != NULL) {
> 			*fnametmpptr = '\0';
> 			if (do_stat(fnametmp, &st) < 0)
> 				do_mkdir_path(fnametmp, mode);
> 		}
> 	}
> 	return do_mkdir(fname, mode);
> }
> 

diff rsync-3.0.9 2/util.c rsync-3.0.9 3/util.c
1171c1171
<         if (statret < 0 && do_mkdir(dir, 0700) < 0) {
---
> 		if (statret < 0 && do_mkdir_path(dir, 0700) < 0) {

-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the rsync mailing list