From 35fa2080c6056a3cb03aefe429e83e9df2cfb5c2 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 11 May 2007 18:06:08 +0000 Subject: [PATCH] kes Check for client and store NULL pointers in status command. This fixes bug #845. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4747 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/ua_status.c | 20 +++++++++++++++----- bacula/technotes-2.1 | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c index e4993aadc3..cf8e2fb95f 100644 --- a/bacula/src/dird/ua_status.c +++ b/bacula/src/dird/ua_status.c @@ -598,7 +598,11 @@ static void list_running_jobs(UAContext *ua) break; case JS_WaitFD: emsg = (char *) get_pool_memory(PM_FNAME); - Mmsg(emsg, _("is waiting on Client %s"), jcr->client->name()); + if (!jcr->client) { + Mmsg(emsg, _("is waiting on Client")); + } else { + Mmsg(emsg, _("is waiting on Client %s"), jcr->client->name()); + } pool_mem = true; msg = emsg; break; @@ -606,8 +610,10 @@ static void list_running_jobs(UAContext *ua) emsg = (char *) get_pool_memory(PM_FNAME); if (jcr->wstore) { Mmsg(emsg, _("is waiting on Storage %s"), jcr->wstore->name()); - } else { + } else if (jcr->rstore) { Mmsg(emsg, _("is waiting on Storage %s"), jcr->rstore->name()); + } else { + Mmsg(emsg, _("is waiting on Storage")); } pool_mem = true; msg = emsg; @@ -632,7 +638,7 @@ static void list_running_jobs(UAContext *ua) break; default: - emsg = (char *) get_pool_memory(PM_FNAME); + emsg = (char *)get_pool_memory(PM_FNAME); Mmsg(emsg, _("is in unknown state %c"), jcr->JobStatus); pool_mem = true; msg = emsg; @@ -661,8 +667,12 @@ static void list_running_jobs(UAContext *ua) emsg = (char *)get_pool_memory(PM_FNAME); pool_mem = true; } - Mmsg(emsg, _("is waiting for Client %s to connect to Storage %s"), - jcr->client->name(), jcr->wstore->name()); + 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; } diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 70e59fac5b..34c4b1cdf0 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -2,6 +2,8 @@ General: 11May07 +kes Check for client and store NULL pointers in status command. This + fixes bug #845. kes Fix non-ssl build so that it works (add JCR *jcr to crypto structures). kes Fix sign extended editing of %p. kes Clean out a little old #ifdefing in cats/mysql.c -- 2.39.5