Skip to content

Commit

Permalink
Merge pull request #238 from benibr/testing_sendpluginoptions
Browse files Browse the repository at this point in the history
sending all related Plugin Options to FD
  • Loading branch information
sduehr committed Sep 5, 2019
2 parents acdaa62 + 912a29b commit 02f7223
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/dird/backup.cc
Expand Up @@ -493,6 +493,8 @@ bool DoNativeBackup(JobControlRecord* jcr)

if (!SendExcludeList(jcr)) { goto bail_out; }

if (!SendPluginOptions(jcr)) { goto bail_out; }

if (!SendPreviousRestoreObjects(jcr)) { goto bail_out; }

if (!SendSecureEraseReqToFd(jcr)) {
Expand Down
17 changes: 17 additions & 0 deletions core/src/dird/fd_cmds.cc
Expand Up @@ -962,6 +962,9 @@ static int RestoreObjectHandler(void* ctx, int num_fields, char** row)
bool SendPluginOptions(JobControlRecord* jcr)
{
BareosSocket* fd = jcr->file_bsock;
int i;
PoolMem cur_plugin_options(PM_MESSAGE);
const char* plugin_options;
POOLMEM* msg;

if (jcr->plugin_options) {
Expand All @@ -977,6 +980,20 @@ bool SendPluginOptions(JobControlRecord* jcr)
return false;
}
}
if (jcr->res.job && jcr->res.job->FdPluginOptions &&
jcr->res.job->FdPluginOptions->size()) {
Dmsg2(200, "dird: sendpluginoptions found FdPluginOptions in res.job");
foreach_alist_index (i, plugin_options, jcr->res.job->FdPluginOptions) {
PmStrcpy(cur_plugin_options, plugin_options);
BashSpaces(cur_plugin_options.c_str());

fd->fsend(pluginoptionscmd, cur_plugin_options.c_str());
if (!response(jcr, fd, OKPluginOptions, "PluginOptions", DISPLAY_ERROR)) {
Jmsg(jcr, M_FATAL, 0, _("Plugin options failed.\n"));
return false;
}
}
}

return true;
}
Expand Down

0 comments on commit 02f7223

Please sign in to comment.