Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
config: added GetTlsPskByFullyQualifiedResourceName-callbacks for sto…
…red and filed
  • Loading branch information
franku committed Aug 30, 2018
1 parent 304df42 commit e92f463
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 22 deletions.
29 changes: 18 additions & 11 deletions core/src/filed/filed_conf.cc
Expand Up @@ -251,6 +251,22 @@ static void ParseConfigCb(LEX *lc, ResourceItem *item, int index, int pass)
}
}

bool GetTlsPskByFullyQualifiedResourceName(const char *fq_name_, std::string &psk_return_value)
{
// char *fq_name_buffer = bstrdup(fq_name_);
// UnbashSpaces(fq_name_buffer);
// std::string fq_name(fq_name_buffer);
// free(fq_name_buffer);

return false;
}

static void ConfigInitLateCb(ConfigurationParser &my_config)
{
ClientResource *client_resource = (ClientResource *)GetNextRes(R_CLIENT, NULL);
client_resource->tls_psk.GetTlsPskByFullyQualifiedResourceNameCb = GetTlsPskByFullyQualifiedResourceName;
}

ConfigurationParser *InitFdConfig(const char *configfile, int exit_code)
{
return new ConfigurationParser (
Expand All @@ -268,7 +284,8 @@ ConfigurationParser *InitFdConfig(const char *configfile, int exit_code)
resources,
res_head,
default_config_filename.c_str(),
"bareos-fd.d");
"bareos-fd.d",
ConfigInitLateCb);
}

/**
Expand Down Expand Up @@ -312,16 +329,6 @@ bool PrintConfigSchemaJson(PoolMem &buffer)
}
#endif

bool GetTlsPskByFullyQualifiedResourceName(const char *fq_name_, std::string &psk_return_value)
{
// char *fq_name_buffer = bstrdup(fq_name_);
// UnbashSpaces(fq_name_buffer);
// std::string fq_name(fq_name_buffer);
// free(fq_name_buffer);

return false;
}

/* **************************************************************************** */
} /* namespace filedaemon */
/* **************************************************************************** */
Expand Down
29 changes: 18 additions & 11 deletions core/src/stored/stored_conf.cc
Expand Up @@ -496,6 +496,22 @@ static void ParseConfigCb(LEX *lc, ResourceItem *item, int index, int pass)
}
}

bool GetTlsPskByFullyQualifiedResourceName(const char *fq_name_, std::string &psk_return_value)
{
// char *fq_name_buffer = bstrdup(fq_name_);
// UnbashSpaces(fq_name_buffer);
// std::string fq_name(fq_name_buffer);
// free(fq_name_buffer);

return false;
}

static void ConfigInitLateCb(ConfigurationParser &my_config)
{
StorageResource *client_resource = (StorageResource *)GetNextRes(R_STORAGE, NULL);
client_resource->tls_psk.GetTlsPskByFullyQualifiedResourceNameCb = GetTlsPskByFullyQualifiedResourceName;
}

ConfigurationParser *InitSdConfig(const char *configfile, int exit_code)
{
return new ConfigurationParser(
Expand All @@ -513,7 +529,8 @@ ConfigurationParser *InitSdConfig(const char *configfile, int exit_code)
resources,
res_head,
default_config_filename.c_str(),
"bareos-sd.d");
"bareos-sd.d",
ConfigInitLateCb);
}

bool ParseSdConfig(const char *configfile, int exit_code)
Expand Down Expand Up @@ -578,16 +595,6 @@ bool PrintConfigSchemaJson(PoolMem &buffer)
}
#endif

bool GetTlsPskByFullyQualifiedResourceName(const char *fq_name_, std::string &psk_return_value)
{
// char *fq_name_buffer = bstrdup(fq_name_);
// UnbashSpaces(fq_name_buffer);
// std::string fq_name(fq_name_buffer);
// free(fq_name_buffer);

return false;
}

/* **************************************************************************** */
} /* namespace storagedaemon */
/* **************************************************************************** */
Expand Down

0 comments on commit e92f463

Please sign in to comment.