/*
Bacula® - The Network Backup Solution
- Copyright (C) 2002-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2002-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
*
* Kern Sibbald, June MMII
*
- * Version $Id$
*/
/*
if (bsr->fileregex_re == NULL)
return 1;
- if (bsr->attr == NULL)
+ if (bsr->attr == NULL) {
bsr->attr = new_attr(jcr);
+ }
- /* The code breaks if the first record associated with a file is
+ /*
+ * The code breaks if the first record associated with a file is
* not of this type
*/
if (rec->Stream == STREAM_UNIX_ATTRIBUTES ||
rec->Stream == STREAM_UNIX_ATTRIBUTES_EX) {
bsr->skip_file = false;
- if (unpack_attributes_record(jcr, rec->Stream, rec->data, bsr->attr)) {
+ if (unpack_attributes_record(jcr, rec->Stream, rec->data, rec->data_len, bsr->attr)) {
if (regexec(bsr->fileregex_re, bsr->attr->fname, 0, NULL, 0) == 0) {
Dmsg2(dbglevel, "Matched pattern, fname=%s FI=%d\n",
bsr->attr->fname, rec->FileIndex);
static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
SESSION_LABEL *sessrec, bool done, JCR *jcr)
{
- Dmsg0(050, "Enter match_all\n");
+ Dmsg0(dbglevel, "Enter match_all\n");
if (bsr->done) {
// Dmsg0(dbglevel, "bsr->done set\n");
goto no_match;
*/
if (bsr->count && bsr->FileIndex) {
rec->bsr = bsr;
- Dmsg0(050, "Leave match_all 1\n");
+ Dmsg0(dbglevel, "Leave match_all 1\n");
return 1; /* this is a complete match */
}
Dmsg0(dbglevel, "fail on stream\n");
goto no_match;
}
- Dmsg0(050, "Leave match_all 1\n");
return 1;
no_match:
return match_all(bsr->next, rec, volrec, sessrec, bsr->done && done, jcr);
}
if (bsr->done && done) {
- Dmsg0(050, "Leave match all -1\n");
+ Dmsg0(dbglevel, "Leave match all -1\n");
return -1;
}
- Dmsg0(050, "Leave match all 0\n");
+ Dmsg0(dbglevel, "Leave match all 0\n");
return 0;
}
return 0; /* Volume must match */
}
if (strcmp(volume->VolumeName, volrec->VolumeName) == 0) {
- Dmsg1(050, "match_volume=%s\n", volrec->VolumeName);
+ Dmsg1(dbglevel, "match_volume=%s\n", volrec->VolumeName);
return 1;
}
if (volume->next) {
if (!voladdr) {
return 1; /* no specification matches all */
}
+
+#ifdef xxx
+
/* For the moment, these tests work only with disk. */
if (rec->state & REC_ISTAPE) {
- return 1; /* All File records OK for this match */
+ uint32_t sFile = (voladdr->saddr)>>32;
+ uint32_t eFile = (voladdr->eaddr)>>32;
+ if (sFile <= rec->File && eFile >= rec->File) {
+ return 1;
+ }
}
+
+#endif
+
uint64_t addr = get_record_address(rec);
-// Dmsg3(dbglevel, "match_voladdr: saddr=%llu eaddr=%llu recaddr=%llu\n",
-// volblock->saddr, volblock->eaddr, addr);
+ Dmsg6(dbglevel, "match_voladdr: saddr=%llu eaddr=%llu recaddr=%llu sfile=%u efile=%u recfile=%u\n",
+ voladdr->saddr, voladdr->eaddr, addr, voladdr->saddr>>32, voladdr->eaddr>>32, addr>>32);
+
if (voladdr->saddr <= addr && voladdr->eaddr >= addr) {
return 1;
}