From: Kern Sibbald Date: Mon, 21 May 2018 16:03:12 +0000 (+0200) Subject: Fix bad placement of jcr->pool reference as pointed out by Martin Simmons X-Git-Tag: Release-9.0.8~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ebec7afafd1f943119881cb1868393fc1d5c6a6e;p=bacula%2Fbacula Fix bad placement of jcr->pool reference as pointed out by Martin Simmons --- diff --git a/bacula/src/dird/ua_label.c b/bacula/src/dird/ua_label.c index bb40566017..9fec5ed198 100644 --- a/bacula/src/dird/ua_label.c +++ b/bacula/src/dird/ua_label.c @@ -986,9 +986,6 @@ int get_num_drives_from_SD(UAContext *ua) */ static bool is_cleaning_tape(UAContext *ua, MEDIA_DBR *mr, POOL_DBR *pr) { - if (ua->jcr->pool->cleaning_prefix == NULL) { - return false; /* if no cleaning prefix, this is not a cleaning tape */ - } /* Find Pool resource */ ua->jcr->pool = (POOL *)GetResWithName(R_POOL, pr->Name); if (!ua->jcr->pool) { @@ -996,11 +993,14 @@ static bool is_cleaning_tape(UAContext *ua, MEDIA_DBR *mr, POOL_DBR *pr) pr->Name, mr->VolumeName); return false; } + if (ua->jcr->pool->cleaning_prefix == NULL) { + return false; /* if no cleaning prefix, this is not a cleaning tape */ + } Dmsg4(100, "CLNprefix=%s: Vol=%s: len=%d strncmp=%d\n", ua->jcr->pool->cleaning_prefix, mr->VolumeName, strlen(ua->jcr->pool->cleaning_prefix), strncmp(mr->VolumeName, ua->jcr->pool->cleaning_prefix, - strlen(ua->jcr->pool->cleaning_prefix))); + (int)strlen(ua->jcr->pool->cleaning_prefix))); return strncmp(mr->VolumeName, ua->jcr->pool->cleaning_prefix, strlen(ua->jcr->pool->cleaning_prefix)) == 0; }