Skip to content

Commit

Permalink
Fix accurate mode when using strip path.
Browse files Browse the repository at this point in the history
Fixes #366: Accurate Mode and strippath
  • Loading branch information
Marco van Wieringen committed May 9, 2015
1 parent eac795d commit f0d33f8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/filed/accurate.c
Expand Up @@ -126,6 +126,9 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
return true; /* Not initialized properly */
}

/*
* Apply path stripping for lookup in accurate data.
*/
strip_path(ff_pkt);

if (S_ISDIR(ff_pkt->statp.st_mode)) {
Expand All @@ -137,9 +140,18 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
if (!accurate_lookup(jcr, fname, &payload)) {
Dmsg1(dbglvl, "accurate %s (not found)\n", fname);
status = true;
unstrip_path(ff_pkt);
goto bail_out;
}

/*
* Restore original name so we can check the actual file when we check
* the accurate options later on. This is mostly important for the
* calculate_and_compare_file_chksum() function as that needs to calulate
* the checksum of the real file and not try to open the stripped pathname.
*/
unstrip_path(ff_pkt);

ff_pkt->accurate_found = true;
ff_pkt->delta_seq = payload->delta_seq;

Expand Down Expand Up @@ -279,7 +291,6 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
}

bail_out:
unstrip_path(ff_pkt);
return status;
}

Expand Down

0 comments on commit f0d33f8

Please sign in to comment.