From 5450f5e38d6dd94600c7c35fedf7f9ccea3e7adb Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 28 Apr 2009 09:44:42 +0000 Subject: [PATCH] Check for job_canceled() in fd_plugin code git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8758 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/fd_plugins.c | 14 ++++++++++---- bacula/technotes | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/bacula/src/filed/fd_plugins.c b/bacula/src/filed/fd_plugins.c index ec6ce7449a..ef24d0520e 100644 --- a/bacula/src/filed/fd_plugins.c +++ b/bacula/src/filed/fd_plugins.c @@ -123,7 +123,7 @@ void generate_plugin_event(JCR *jcr, bEventType eventType, void *value) Plugin *plugin; int i = 0; - if (!plugin_list || !jcr || !jcr->plugin_ctx_list) { + if (!plugin_list || !jcr || !jcr->plugin_ctx_list || job_canceled(jcr)) { return; /* Return if no plugins loaded */ } @@ -160,7 +160,7 @@ bool plugin_check_file(JCR *jcr, char *fname) int rc = bRC_OK; int i = 0; - if (!plugin_list || !jcr || !jcr->plugin_ctx_list) { + if (!plugin_list || !jcr || !jcr->plugin_ctx_list || job_canceled(jcr)) { return false; /* Return if no plugins loaded */ } @@ -217,7 +217,7 @@ int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level) POOL_MEM fname(PM_FNAME); POOL_MEM link(PM_FNAME); - if (!plugin_list || !jcr->plugin_ctx_list) { + if (!plugin_list || !jcr->plugin_ctx_list || job_canceled(jcr)) { return 1; /* Return if no plugins loaded */ } @@ -324,6 +324,9 @@ bool send_plugin_name(JCR *jcr, BSOCK *sd, bool start) Jmsg0(jcr, M_FATAL, 0, _("Plugin save packet not found.\n")); return false; } + if (job_canceled(jcr)) { + return false; + } if (start) { index++; /* JobFiles not incremented yet */ @@ -463,7 +466,7 @@ int plugin_create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) int flags; int rc; - if (!plugin || !plugin_ctx || !set_cmd_plugin(bfd, jcr)) { + if (!plugin || !plugin_ctx || !set_cmd_plugin(bfd, jcr) || job_canceled(jcr)) { return CF_ERROR; } rp.pkt_size = sizeof(rp); @@ -649,6 +652,9 @@ void new_plugins(JCR *jcr) Dmsg0(dbglvl, "plugin list is NULL\n"); return; } + if (job_canceled(jcr)) { + return; + } int num = plugin_list->size(); diff --git a/bacula/technotes b/bacula/technotes index de97904d98..cb9e0c45aa 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -3,6 +3,7 @@ General: 28Apr09 +kes Check for job_canceled() in fd_plugin code. kes Update Win32/64 table creation to have new DB version 11 format kes Remove illegal Options in Exclude of default Win32/64 bacula-dir.conf 27Apr09 -- 2.39.5