From: Eric Bollengier Date: Mon, 10 Oct 2022 13:56:03 +0000 (+0200) Subject: pluginlib: Move the new variables in the JobInfo phase X-Git-Tag: Beta-15.0.0~422 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f8a2fa84458be613a93ef6a5d40d84a146813ea;p=thirdparty%2Fbacula.git pluginlib: Move the new variables in the JobInfo phase --- diff --git a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp index bea06fc72..d344c7ae5 100644 --- a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp +++ b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp @@ -741,6 +741,29 @@ bRC METAPLUGIN::send_jobinfo(bpContext *ctx, char type) } } + const char *dir; + bfuncs->getBaculaValue(ctx, bVarWorkingDir, &dir); + Mmsg(cmd, "WorkingDir=%s\n", dir); + rc = backend.ctx->write_command(ctx, cmd); + if (rc < 0) { + /* error */ + return bRC_Error; + } + bfuncs->getBaculaValue(ctx, bVarSysConfigPath, &dir); + Mmsg(cmd, "SysconfigPath=%s\n", dir); + rc = backend.ctx->write_command(ctx, cmd); + if (rc < 0) { + /* error */ + return bRC_Error; + } + bfuncs->getBaculaValue(ctx, bVarExePath, &dir); + Mmsg(cmd, "ExePath=%s\n", dir); + rc = backend.ctx->write_command(ctx, cmd); + if (rc < 0) { + /* error */ + return bRC_Error; + } + backend.ctx->signal_eod(ctx); if (!backend.ctx->read_ack(ctx)){ @@ -873,28 +896,7 @@ bRC METAPLUGIN::send_parameters(bpContext *ctx, char *command) return bRC_Error; } #endif - const char *dir; - bfuncs->getBaculaValue(ctx, bVarWorkingDir, &dir); - Mmsg(cmd, "WorkingDir=%s\n", dir); - rc = backend.ctx->write_command(ctx, cmd); - if (rc < 0) { - /* error */ - return bRC_Error; - } - bfuncs->getBaculaValue(ctx, bVarSysConfigPath, &dir); - Mmsg(cmd, "SysconfigPath=%s\n", dir); - rc = backend.ctx->write_command(ctx, cmd); - if (rc < 0) { - /* error */ - return bRC_Error; - } - bfuncs->getBaculaValue(ctx, bVarExePath, &dir); - Mmsg(cmd, "ExePath=%s\n", dir); - rc = backend.ctx->write_command(ctx, cmd); - if (rc < 0) { - /* error */ - return bRC_Error; - } + // signal end of parameters block backend.ctx->signal_eod(ctx); /* ack Params command */