]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
pluginlib: Move the new variables in the JobInfo phase
authorEric Bollengier <eric@baculasystems.com>
Mon, 10 Oct 2022 13:56:03 +0000 (15:56 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:59 +0000 (13:56 +0200)
bacula/src/plugins/fd/pluginlib/metaplugin.cpp

index bea06fc72263133e20efe368f56364dd2f768e04..d344c7ae575b648253b59f3fb2c06cd208c192a0 100644 (file)
@@ -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 */