]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/fd_cmds.c
Adapt new prune code with old db_accurate_get_jobids()
[bacula/bacula] / bacula / src / dird / fd_cmds.c
index 46ca8138f7b184b5cb91eb9a074ab4b0118cd422..23b1da2593882f22301969a56ed258a8edb7ce1b 100644 (file)
@@ -122,6 +122,9 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time,
    /*
     * Now send JobId and authorization key
     */
+   if (jcr->sd_auth_key == NULL) {
+      jcr->sd_auth_key = bstrdup("dummy");
+   }
    fd->fsend(jobcmd, edit_int64(jcr->JobId, ed1), jcr->Job, jcr->VolSessionId,
              jcr->VolSessionTime, jcr->sd_auth_key);
    if (!jcr->keep_sd_auth_key && strcmp(jcr->sd_auth_key, "dummy")) {
@@ -370,23 +373,26 @@ static bool send_fileset(JCR *jcr)
             }
 
             /* Strip out compression option Zn if disallowed for this Storage */
-            if (!store->AllowCompress) {
+            if (store && !store->AllowCompress) {
                char newopts[MAX_FOPTS];
+               bool done=false;         /* print warning only if compression enabled in FS */ 
                int j = 0;
                for (k=0; fo->opts[k]!='\0'; k++) {                   
                  /* Z compress option is followed by the single-digit compress level */
                  if (fo->opts[k]=='Z') {
+                    done=true;
                     k++;                /* skip option and level */
                  } else {
                     newopts[j] = fo->opts[k];
-                   j++;
+                    j++;
                  }
                }
                newopts[j] = '\0';
 
-               Jmsg(jcr, M_INFO, 0,
-                   _("FD compression disabled for this Job because AllowCompress=No in Storage resource.\n") );
-
+               if (done) {
+                  Jmsg(jcr, M_INFO, 0,
+                      _("FD compression disabled for this Job because AllowCompress=No in Storage resource.\n") );
+               }
                /* Send the new trimmed option set without overwriting fo->opts */
                fd->fsend("O %s\n", newopts);
             } else {