]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/match_bsr.c
Escape filenames in restore command
[bacula/bacula] / bacula / src / stored / match_bsr.c
index 97981576012ec9dda235672739272dd2333cee5f..da72874d597e6ed28b4b619d78842790f4220a6f 100755 (executable)
@@ -55,10 +55,15 @@ static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec, SESSION_LA
  */
 int match_bsr(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec, SESSION_LABEL *sessrec)
 {
-   if (!bsr) {
-      return 0;
+   int stat;
+
+   if (bsr) {
+      stat = match_all(bsr, rec, volrec, sessrec, 1);
+   } else {
+      stat = 0;
    }
-   return match_all(bsr, rec, volrec, sessrec, 1);
+// Dmsg1(000, "BSR returning %d\n", stat);
+   return stat;
 }
 
 /* 
@@ -216,6 +221,12 @@ static int match_volfile(BSR *bsr, BSR_VOLFILE *volfile, DEV_RECORD *rec, int do
    if (!volfile) {
       return 1;                      /* no specification matches all */
    }
+   /* For the moment, these tests work only with tapes. */
+   if (!(rec->state & REC_ISTAPE)) {
+      return 1;                      /* All File records OK for this match */
+   }
+// Dmsg3(000, "match_volfile: sfile=%d efile=%d recfile=%d\n",
+//            volfile->sfile, volfile->efile, rec->File);
    if (volfile->sfile <= rec->File && volfile->efile >= rec->File) {
       return 1;
    }