From: Jorge Gea Date: Tue, 9 Jul 2024 16:00:37 +0000 (+0200) Subject: metaplugin: Include bacula jobid in the backend calls as BACULA_JOBID env variable X-Git-Tag: Release-15.0.3~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec636c391317e785c72ac0d126818111c76ec080;p=thirdparty%2Fbacula.git metaplugin: Include bacula jobid in the backend calls as BACULA_JOBID env variable --- diff --git a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp index d344c7ae5..2a20ce355 100644 --- a/bacula/src/plugins/fd/pluginlib/metaplugin.cpp +++ b/bacula/src/plugins/fd/pluginlib/metaplugin.cpp @@ -462,7 +462,13 @@ bRC METAPLUGIN::run_backend(bpContext *ctx) return bRC_Error; } DMSG(ctx, DINFO, "Executing: %s\n", backend_cmd.c_str()); - bp = open_bpipe(backend_cmd.c_str(), 0, "rwe"); + char ed1[64]; + bsnprintf(ed1, sizeof(ed1), "BACULA_JOBID=%d", JobId); + char *envp[] = { + ed1, + NULL + }; + bp = open_bpipe(backend_cmd.c_str(), 0, "rwe", envp); if (bp == NULL){ berrno be; DMSG(ctx, DERROR, "Unable to run backend. Err=%s\n", be.bstrerror());