]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/bscan.c
Apply patch from Richard Mortimer to ensure that the number
[bacula/bacula] / bacula / src / stored / bscan.c
index 16b17d291d46400ef9273d629f2d45862b0777a1..735ddc11c9d7768d396ec679976973afa2683bc9 100644 (file)
@@ -670,6 +670,13 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
    case STREAM_WIN32_DATA:
    case STREAM_FILE_DATA:
    case STREAM_SPARSE_DATA:
+   case STREAM_ENCRYPTED_FILE_DATA:
+   case STREAM_ENCRYPTED_WIN32_DATA:
+   case STREAM_ENCRYPTED_MACOS_FORK_DATA:
+      /*
+       * For encrypted stream, this is an approximation.
+       * The data must be decrypted to know the correct length.
+       */
       mjcr->JobBytes += rec->data_len;
       if (rec->Stream == STREAM_SPARSE_DATA) {
          mjcr->JobBytes -= sizeof(uint64_t);
@@ -679,8 +686,13 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       break;
 
    case STREAM_GZIP_DATA:
-      mjcr->JobBytes += rec->data_len; /* No correct, we should expand it */
-      free_jcr(mjcr);                 /* done using JCR */
+   case STREAM_ENCRYPTED_FILE_GZIP_DATA:
+   case STREAM_ENCRYPTED_WIN32_GZIP_DATA:
+      /* No correct, we should (decrypt and) expand it 
+         done using JCR 
+      */
+      mjcr->JobBytes += rec->data_len;
+      free_jcr(mjcr);                 
       break;
 
    case STREAM_SPARSE_GZIP_DATA:
@@ -758,7 +770,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec)
       break;
 
    default:
-      Pmsg2(0, _("Unknown stream type!!! stream=%d data=%s\n"), rec->Stream, rec->data);
+      Pmsg2(0, _("Unknown stream type!!! stream=%d len=%i\n"), rec->Stream, rec->data_len);
       break;
    }
    return true;
@@ -844,6 +856,7 @@ static int create_media_record(B_DB *db, MEDIA_DBR *mr, VOLUME_LABEL *vl)
    /* We mark Vols as Archive to keep them from being re-written */
    bstrncpy(mr->VolStatus, "Archive", sizeof(mr->VolStatus));
    mr->VolRetention = 365 * 3600 * 24; /* 1 year */
+   mr->Enabled = 1;
    if (vl->VerNum >= 11) {
       mr->FirstWritten = btime_to_utime(vl->write_btime);
       mr->LabelDate    = btime_to_utime(vl->label_btime);
@@ -1072,8 +1085,8 @@ static int update_job_record(B_DB *db, JOB_DBR *jr, SESSION_LABEL *elabel,
       return 0;
    }
    if (verbose) {
-      Pmsg2(000, _("Updated Job termination record for JobId=%u TermStat=%c\n"), jr->JobId,
-         jr->JobStatus);
+      Pmsg3(000, _("Updated Job termination record for JobId=%u Level=%s TermStat=%c\n"), 
+         jr->JobId, job_level_to_str(mjcr->JobLevel), jr->JobStatus);
    }
    if (verbose > 1) {
       const char *term_msg;