From: Eric Bollengier Date: Tue, 28 Feb 2023 08:32:59 +0000 (+0100) Subject: Report an error when .query cannot find a suitable plugin X-Git-Tag: Beta-15.0.0~241 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db46db59333ba3e36247a81e59f8463ce940ddba;p=thirdparty%2Fbacula.git Report an error when .query cannot find a suitable plugin --- diff --git a/bacula/src/filed/fd_plugins.c b/bacula/src/filed/fd_plugins.c index f45594efd..54c859ac5 100644 --- a/bacula/src/filed/fd_plugins.c +++ b/bacula/src/filed/fd_plugins.c @@ -1585,6 +1585,7 @@ bool plugin_query_parameter(JCR *jcr, char *param, char *command, void sendit(JC bRC rc; int len; int i; + int found=0; Dmsg0(dbglvl, "plugin_query\n"); @@ -1629,10 +1630,17 @@ bool plugin_query_parameter(JCR *jcr, char *param, char *command, void sendit(JC /* check out status */ if (rc != bRC_OK){ Dmsg0(dbglvl, "plugin->queryParameter returned error\n"); - return false; + OutputWriter ow;// TODO: pass api_opts + sendit(jcr, ow.get_output(OT_STRING, "error", "plugin protocol error", OT_END)); + goto bail_out; } + found=1; break; } + if (!found) { + OutputWriter ow; // TODO: pass api_opts + sendit(jcr, ow.get_output(OT_STRING, "error", "plugin not found", OT_END)); + } bail_out: jcr->plugin_ctx = NULL; jcr->plugin = NULL;