]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_status.c
Fix #1902 about a segfault with the "cancel inactive" command
[bacula/bacula] / bacula / src / dird / ua_status.c
index 6ac3d66ed28b4a96da05ed9f28343bb4c3cb3342..395966041dff58ea217d8de708faf47a51ea96a7 100644 (file)
@@ -2,7 +2,6 @@
    Bacula(R) - The Network Backup Solution
 
    Copyright (C) 2000-2015 Kern Sibbald
-   Copyright (C) 2001-2014 Free Software Foundation Europe e.V.
 
    The original author of Bacula is Kern Sibbald, with contributions
    from many others, a complete list can be found in the file AUTHORS.
@@ -69,7 +68,7 @@ bool dot_status_cmd(UAContext *ua, const char *cmd)
       if (strcasecmp(ua->argk[2], "current") == 0) {
          ua->send_msg(OKqstatus, ua->argk[2]);
          foreach_jcr(njcr) {
-            if (njcr->JobId != 0 && acl_access_ok(ua, Job_ACL, njcr->job->name())) {
+            if (!njcr->is_internal_job() && acl_access_ok(ua, Job_ACL, njcr->job->name())) {
                ua->send_msg(DotStatusJob, edit_int64(njcr->JobId, ed1),
                         njcr->JobStatus, njcr->JobErrors);
             }
@@ -1002,17 +1001,21 @@ static void list_running_jobs(UAContext *ua)
          msg = _("is waiting for an appendable Volume");
          break;
       case JS_WaitFD:
-         if (!pool_mem) {
-            emsg = (char *)get_pool_memory(PM_FNAME);
-            pool_mem = true;
+         /* Special case when JobStatus=JS_WaitFD, we don't have a FD link yet 
+          * we need to stay in WaitFD status See bee mantis #1414 */
+         if (jcr->JobStatus != JS_WaitFD) {
+            if (!pool_mem) {
+               emsg = (char *)get_pool_memory(PM_FNAME);
+               pool_mem = true;
+            }
+            if (!jcr->client || !jcr->wstore) {
+               Mmsg(emsg, _("is waiting for Client to connect to Storage daemon"));
+            } else {
+               Mmsg(emsg, _("is waiting for Client %s to connect to Storage %s"),
+                    jcr->client->name(), jcr->wstore->name());
+            }
+            msg = emsg;
          }
-         if (!jcr->client || !jcr->wstore) {
-            Mmsg(emsg, _("is waiting for Client to connect to Storage daemon"));
-         } else {
-            Mmsg(emsg, _("is waiting for Client %s to connect to Storage %s"),
-                 jcr->client->name(), jcr->wstore->name());
-        }
-        msg = emsg;
         break;
       case JS_DataCommitting:
          msg = _("SD committing Data");