From: Kern Sibbald Date: Wed, 20 Jan 2010 17:09:30 +0000 (+0100) Subject: Make a missing plugin during backup fatal X-Git-Tag: Release-5.0.0~40 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9afa0fe79d365d30454ff92010ce52a204f208a8;p=bacula%2Fbacula Make a missing plugin during backup fatal --- diff --git a/bacula/src/filed/fd_plugins.c b/bacula/src/filed/fd_plugins.c index 84bc3bf423..a37d13d7c2 100644 --- a/bacula/src/filed/fd_plugins.c +++ b/bacula/src/filed/fd_plugins.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2007-2009 Free Software Foundation Europe e.V. + Copyright (C) 2007-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -218,6 +218,7 @@ int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level) POOL_MEM link(PM_FNAME); if (!plugin_list || !jcr->plugin_ctx_list || job_canceled(jcr)) { + Jmsg1(jcr, M_FATAL, 0, "Command plugin \"%s\" not loaded.\n", cmd); return 1; /* Return if no plugins loaded */ } @@ -302,7 +303,7 @@ int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level) } goto bail_out; } - Jmsg1(jcr, M_ERROR, 0, "Command plugin \"%s\" not found.\n", cmd); + Jmsg1(jcr, M_FATAL, 0, "Command plugin \"%s\" not found.\n", cmd); bail_out: jcr->cmd_plugin = false; diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c index ed598c426e..e6ad616692 100644 --- a/bacula/src/findlib/find.c +++ b/bacula/src/findlib/find.c @@ -204,15 +204,17 @@ find_files(JCR *jcr, FF_PKT *ff, int file_save(JCR *jcr, FF_PKT *ff_pkt, bool to return 0; /* error return */ } } - if (plugin_save) { - foreach_dlist(node, &incexe->plugin_list) { - char *fname = node->c_str(); - Dmsg1(100, "PluginCommand: %s\n", fname); - ff->top_fname = fname; - ff->cmd_plugin = true; - plugin_save(jcr, ff, true); - ff->cmd_plugin = false; + foreach_dlist(node, &incexe->plugin_list) { + char *fname = node->c_str(); + if (!plugin_save) { + Jmsg(jcr, M_FATAL, 0, _("Plugin: \"%s\" not found.\n"), fname); + return 0; } + Dmsg1(100, "PluginCommand: %s\n", fname); + ff->top_fname = fname; + ff->cmd_plugin = true; + plugin_save(jcr, ff, true); + ff->cmd_plugin = false; } } }