2 This patch should fix bug #1047 -- heap corruption when using
3 strippath on certain directories.
5 Apply it to 2.2.8 (probably prior versions) with:
8 patch -p0 <2.2.8-strip-path.patch
9 ./configure <your-options>
15 Index: src/filed/backup.c
16 ===================================================================
17 --- src/filed/backup.c (revision 6390)
18 +++ src/filed/backup.c (revision 6391)
19 @@ -1146,20 +1146,21 @@
21 * Strip path. If it doesn't succeed put it back. If
22 * it does, and there is a different link string,
23 - * attempt to strip the link. If it fails, but them
24 + * attempt to strip the link. If it fails, back them
26 + * Don't strip symlinks.
27 * I.e. if either stripping fails don't strip anything.
29 if (do_strip(ff_pkt->strip_path, ff_pkt->fname)) {
30 - if (ff_pkt->fname != ff_pkt->link) {
31 + if (ff_pkt->type != FT_LNK && ff_pkt->fname != ff_pkt->link) {
32 pm_strcpy(ff_pkt->link_save, ff_pkt->link);
33 if (!do_strip(ff_pkt->strip_path, ff_pkt->link)) {
34 - strcpy(ff_pkt->link, ff_pkt->link_save);
35 - strcpy(ff_pkt->fname, ff_pkt->fname_save);
36 + pm_strcpy(ff_pkt->link, ff_pkt->link_save);
37 + pm_strcpy(ff_pkt->fname, ff_pkt->fname_save);
41 - strcpy(ff_pkt->fname, ff_pkt->fname_save);
42 + pm_strcpy(ff_pkt->fname, ff_pkt->fname_save);
44 Dmsg2(200, "fname=%s stripped=%s\n", ff_pkt->fname_save, ff_pkt->fname);
47 if (!(ff_pkt->flags & FO_STRIPPATH) || ff_pkt->strip_path <= 0) {
50 - strcpy(ff_pkt->fname, ff_pkt->fname_save);
51 - if (ff_pkt->fname != ff_pkt->link) {
52 - strcpy(ff_pkt->link, ff_pkt->link_save);
53 + pm_strcpy(ff_pkt->fname, ff_pkt->fname_save);
54 + if (ff_pkt->type != FT_LNK && ff_pkt->fname != ff_pkt->link) {
55 + pm_strcpy(ff_pkt->link, ff_pkt->link_save);