X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fstored%2Fmatch_bsr.c;h=350de85a8415afca9d820e69b94fe8456173c2fc;hb=706490171cd2e5458defa3e4abfeca745d19d1f3;hp=8968cf8f9cfd970268e889e5ab210c17426601b2;hpb=d4d7a4da557b695e3912c362a1071f7bc614c3ab;p=bacula%2Fbacula diff --git a/bacula/src/stored/match_bsr.c b/bacula/src/stored/match_bsr.c old mode 100755 new mode 100644 index 8968cf8f9c..350de85a84 --- a/bacula/src/stored/match_bsr.c +++ b/bacula/src/stored/match_bsr.c @@ -1,22 +1,14 @@ -/* - * Match Bootstrap Records (used for restores) against - * Volume Records - * - * Kern Sibbald, June MMII - * - * Version $Id$ - */ /* Bacula® - The Network Backup Solution - Copyright (C) 2002-2006 Free Software Foundation Europe e.V. + Copyright (C) 2002-2007 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. This program is Free Software; you can redistribute it and/or modify it under the terms of version two of the GNU General Public - License as published by the Free Software Foundation plus additions - that are listed in the file LICENSE. + License as published by the Free Software Foundation and included + in the file LICENSE. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -28,11 +20,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - Bacula® is a registered trademark of John Walker. + Bacula® is a registered trademark of Kern Sibbald. The licensor of Bacula is the Free Software Foundation Europe (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. */ +/* + * Match Bootstrap Records (used for restores) against + * Volume Records + * + * Kern Sibbald, June MMII + * + * Version $Id$ + */ /* * ***FIXME*** @@ -60,7 +60,7 @@ #include "lib/fnmatch.h" #endif -const int dbglevel = 10; +const int dbglevel = 500; /* Forward references */ static int match_volume(BSR *bsr, BSR_VOLUME *volume, VOLUME_LABEL *volrec, bool done); @@ -191,13 +191,14 @@ BSR *find_next_bsr(BSR *root_bsr, DEVICE *dev) { BSR *bsr; BSR *found_bsr = NULL; - bool no_file_seek = !dev->is_tape(); -#ifdef FILE_SEEK - no_file_seek = false; -#endif - if (!root_bsr || !root_bsr->use_positioning || - !root_bsr->reposition || no_file_seek) { + /* Do tape/disk seeking only if CAP_POSITIONBLOCKS is on */ + if (!root_bsr) { + Dmsg0(dbglevel, "NULL root bsr pointer passed to find_next_bsr.\n"); + return NULL; + } + if (!root_bsr->use_positioning || + !root_bsr->reposition || !dev->has_cap(CAP_POSITIONBLOCKS)) { Dmsg2(dbglevel, "No nxt_bsr use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition); return NULL; } @@ -330,7 +331,7 @@ static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec, SESSION_LABEL *sessrec, bool done) { if (bsr->done) { - Dmsg0(dbglevel, "bsr->done set\n"); +// Dmsg0(dbglevel, "bsr->done set\n"); goto no_match; } if (!match_volume(bsr, bsr->volume, volrec, 1)) { @@ -436,7 +437,7 @@ static int match_client(BSR *bsr, BSR_CLIENT *client, SESSION_LABEL *sessrec, bo if (!client) { return 1; /* no specification matches all */ } - if (fnmatch(client->ClientName, sessrec->ClientName, 0) == 0) { + if (strcmp(client->ClientName, sessrec->ClientName) == 0) { return 1; } if (client->next) { @@ -450,7 +451,7 @@ static int match_job(BSR *bsr, BSR_JOB *job, SESSION_LABEL *sessrec, bool done) if (!job) { return 1; /* no specification matches all */ } - if (fnmatch(job->Job, sessrec->Job, 0) == 0) { + if (strcmp(job->Job, sessrec->Job) == 0) { return 1; } if (job->next) {