The Samba-Bugzilla – Attachment 2850 Details for
Bug 4855
skipped local filters cause segfault while deleting (-rFR --delete)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
quick fix to avoid crash
rsync-2.6.9-localfilters.patch (text/plain), 1.60 KB, created by
wolfgang.mayer
on 2007-08-02 20:06:12 UTC
(
hide
)
Description:
quick fix to avoid crash
Filename:
MIME Type:
Creator:
wolfgang.mayer
Created:
2007-08-02 20:06:12 UTC
Size:
1.60 KB
patch
obsolete
>--- rsync-2.6.9/generator.c~ 2006-10-23 08:06:36.000000000 +0930 >+++ rsync-2.6.9/generator.c 2007-08-02 15:52:33.000000000 +0930 >@@ -226,8 +226,13 @@ > int dlen, i; > > if (!flist) { >- while (cur_depth >= min_depth) >- pop_local_filters(filt_array[cur_depth--]); >+ while (cur_depth >= min_depth) { >+ if (filt_array[cur_depth]) { /* check (a) */ >+ pop_local_filters(filt_array[cur_depth]); >+ filt_array[cur_depth]=NULL; >+ } >+ cur_depth--; >+ } > min_depth = MAXPATHLEN; > cur_depth = -1; > return; >@@ -251,8 +256,26 @@ > return; > } > >- while (cur_depth >= file->dir.depth && cur_depth >= min_depth) >- pop_local_filters(filt_array[cur_depth--]); >+ while (cur_depth >= file->dir.depth && cur_depth >= min_depth) { >+ if (filt_array[cur_depth]) { /* check (b) */ >+ pop_local_filters(filt_array[cur_depth]); >+ filt_array[cur_depth]=NULL; >+ } >+ cur_depth--; >+ } >+ >+ /* If checks (a) and (b) above were absent, the following invariant >+ must hold so proper cleanup can be performed in pop_local_filters. >+ However, this is a dirty fix, since this invariant being violated >+ implies that local filters in some parent directories of dname/dlen >+ have been skipped. */ >+ if(cur_depth >= 0 && file->dir.depth > cur_depth+1) { >+ rprintf(FINFO, >+ "Some local filters may have been skipped -- skipping file deletion\n"); >+ return; >+ } >+ /* assume: cur_depth < 0 || file->dir.depth <= cur_depth+1 */ >+ > cur_depth = file->dir.depth; > if (min_depth > cur_depth) > min_depth = cur_depth;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 4855
: 2850 |
2851