Skip to content

Commit

Permalink
stored: store the session key before sending it to the director
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Dec 16, 2018
1 parent d1f16be commit e33374f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 0 additions & 2 deletions core/src/dird/socket_server.cc
Expand Up @@ -77,8 +77,6 @@ static void *HandleConnectionRequest(ConfigurationParser *config, void *arg)

jcr.ua = bs;

Bmicrosleep(0,250000);

if (!TryTlsHandshakeAsAServer(bs, config)) {
bs->signal(BNET_TERMINATE);
bs->close();
Expand Down
2 changes: 0 additions & 2 deletions core/src/filed/socket_server.cc
Expand Up @@ -59,8 +59,6 @@ static void *HandleConnectionRequest(ConfigurationParser *config, void *arg)
{
BareosSocket *bs = (BareosSocket *)arg;

Bmicrosleep(0,250000);

if (!TryTlsHandshakeAsAServer(bs, config)) {
bs->signal(BNET_TERMINATE);
bs->close();
Expand Down
8 changes: 4 additions & 4 deletions core/src/stored/job.cc
Expand Up @@ -163,10 +163,10 @@ bool job_cmd(JobControlRecord *jcr)
*/
Bsnprintf(seed, sizeof(seed), "%p%d", jcr, JobId);
MakeSessionKey(auth_key, seed, 1);
dir->fsend(OK_job, jcr->VolSessionId, jcr->VolSessionTime, auth_key);
Dmsg2(50, ">dird jid=%u: %s", (uint32_t)jcr->JobId, dir->msg);
jcr->sd_auth_key = bstrdup(auth_key);
dir->fsend(OK_job, jcr->VolSessionId, jcr->VolSessionTime, auth_key);
memset(auth_key, 0, sizeof(auth_key));
Dmsg2(50, ">dird jid=%u: %s", (uint32_t)jcr->JobId, dir->msg);

DispatchNewPluginOptions(jcr);
GeneratePluginEvent(jcr, bsdEventJobStart, (void *)"JobStart");
Expand Down Expand Up @@ -275,13 +275,13 @@ bool nextRunCmd(JobControlRecord *jcr)
*/
Bsnprintf(seed, sizeof(seed), "%p%d", jcr, jcr->JobId);
MakeSessionKey(auth_key, seed, 1);
dir->fsend(OK_nextrun, auth_key);
Dmsg2(50, ">dird jid=%u: %s", (uint32_t)jcr->JobId, dir->msg);
if (jcr->sd_auth_key) {
free(jcr->sd_auth_key);
}
jcr->sd_auth_key = bstrdup(auth_key);
dir->fsend(OK_nextrun, auth_key);
memset(auth_key, 0, sizeof(auth_key));
Dmsg2(50, ">dird jid=%u: %s", (uint32_t)jcr->JobId, dir->msg);

jcr->sendJobStatus(JS_WaitFD); /* wait for FD to connect */

Expand Down
2 changes: 0 additions & 2 deletions core/src/stored/socket_server.cc
Expand Up @@ -67,8 +67,6 @@ void *HandleConnectionRequest(ConfigurationParser *config, void *arg)
char name[MAX_NAME_LENGTH];
char tbuf[MAX_TIME_LENGTH];

Bmicrosleep(0,250000);

if (!TryTlsHandshakeAsAServer(bs, config)) {
bs->signal(BNET_TERMINATE);
bs->close();
Expand Down

0 comments on commit e33374f

Please sign in to comment.