diff --git a/core/src/dird/backup.cc b/core/src/dird/backup.cc index 01b16b3ac0a..e334b6887d5 100644 --- a/core/src/dird/backup.cc +++ b/core/src/dird/backup.cc @@ -567,7 +567,7 @@ bool DoNativeBackup(JobControlRecord *jcr) } } else { - if (jcr->connection_successful_handshake_ != ClientConnectionHandshakeMode::kTlsFirst) { + if (jcr->res.client->connection_successful_handshake_ != ClientConnectionHandshakeMode::kTlsFirst) { tls_need = GetLocalTlsPolicyFromConfiguration(client); } else { tls_need = TlsConfigBase::BNET_TLS_AUTO; diff --git a/core/src/dird/dird_conf.h b/core/src/dird/dird_conf.h index 8aaf97192d4..a4dca4ee9cc 100644 --- a/core/src/dird/dird_conf.h +++ b/core/src/dird/dird_conf.h @@ -31,6 +31,8 @@ #define BAREOS_DIRD_DIRD_CONF_H_ /* NOTE: #includes at the end of this file */ +#include "dird/client_connection_handshake_mode.h" + namespace directordaemon { static std::string default_config_filename("bareos-dir.conf"); @@ -279,6 +281,7 @@ class ClientResource: public TlsResource { bool ndmp_use_lmdb; /* NDMP Protocol specific use LMDB for the FHDB or not */ int64_t max_bandwidth; /* Limit speed on this client */ runtime_client_status_t *rcs; /* Runtime Client Status */ + ClientConnectionHandshakeMode connection_successful_handshake_; ClientResource() : TlsResource() {} }; diff --git a/core/src/dird/fd_cmds.cc b/core/src/dird/fd_cmds.cc index a4beaf409f9..feb1c0e930e 100644 --- a/core/src/dird/fd_cmds.cc +++ b/core/src/dird/fd_cmds.cc @@ -168,7 +168,7 @@ bool ConnectToFileDaemon(JobControlRecord *jcr, int retry_interval, int max_retr /* try the connection mode in case a client that cannot do Tls * immediately without cleartext md5-handshake first */ jcr->connection_handshake_try_ = ClientConnectionHandshakeMode::kTlsFirst; - jcr->connection_successful_handshake_ = ClientConnectionHandshakeMode::kUndefined; + jcr->res.client->connection_successful_handshake_ = ClientConnectionHandshakeMode::kUndefined; do { /* while (tcp_connect_failed ...) */ /* connect the tcp socket */ @@ -187,7 +187,7 @@ bool ConnectToFileDaemon(JobControlRecord *jcr, int retry_interval, int max_retr jcr->setJobStatus(JS_Running); if (AuthenticateWithFileDaemon(jcr)) { success = true; - jcr->connection_successful_handshake_ = jcr->connection_handshake_try_; + jcr->res.client->connection_successful_handshake_ = jcr->connection_handshake_try_; } else { /* authentication failed due to * - tls mismatch or diff --git a/core/src/dird/restore.cc b/core/src/dird/restore.cc index e6b3cfb1298..a55dcc7c90a 100644 --- a/core/src/dird/restore.cc +++ b/core/src/dird/restore.cc @@ -292,7 +292,7 @@ static inline bool DoNativeRestoreBootstrap(JobControlRecord *jcr) goto bail_out; } - if (jcr->connection_successful_handshake_ != ClientConnectionHandshakeMode::kTlsFirst) { + if (jcr->res.client->connection_successful_handshake_ != ClientConnectionHandshakeMode::kTlsFirst) { tls_need = GetLocalTlsPolicyFromConfiguration(client); } else { tls_need = TlsConfigBase::BNET_TLS_AUTO; diff --git a/core/src/dird/verify.cc b/core/src/dird/verify.cc index 7c341f6402a..d82d24c4639 100644 --- a/core/src/dird/verify.cc +++ b/core/src/dird/verify.cc @@ -360,7 +360,7 @@ bool DoVerify(JobControlRecord *jcr) uint32_t tls_need = 0; ClientResource *client = jcr->res.client; - if (jcr->connection_successful_handshake_ != ClientConnectionHandshakeMode::kTlsFirst) { + if (jcr->res.client->connection_successful_handshake_ != ClientConnectionHandshakeMode::kTlsFirst) { tls_need = GetLocalTlsPolicyFromConfiguration(client); } else { tls_need = TlsConfigBase::BNET_TLS_AUTO; diff --git a/core/src/include/jcr.h b/core/src/include/jcr.h index cdc3eaf820b..8bdb3ced5d8 100644 --- a/core/src/include/jcr.h +++ b/core/src/include/jcr.h @@ -533,7 +533,6 @@ class JobControlRecord { bool HasQuota; /**< Client has quota limits */ bool HasSelectedJobs; /**< Migration/Copy Job did actually select some JobIds */ directordaemon::ClientConnectionHandshakeMode connection_handshake_try_; - directordaemon::ClientConnectionHandshakeMode connection_successful_handshake_; #endif /* DIRECTOR_DAEMON */ #ifdef FILE_DAEMON