if (state->do_durable_reconnect) {
DATA_BLOB new_cookie = data_blob_null;
NTTIME now = timeval_to_nttime(&smb2req->request_time);
+ const struct smb2_lease_key *lease_key = NULL;
+ if (state->lease_ptr != NULL) {
+ lease_key = &state->lease_ptr->lease_key;
+ }
status = smb2srv_open_recreate(smb2req->xconn,
smb1req->conn->session_info,
state->persistent_id,
state->create_guid,
+ lease_key,
now,
&state->op);
if (tevent_req_nterror(req, status)) {
#include "source3/include/util_tdb.h"
#include "lib/util/idtree_random.h"
#include "lib/util/time_basic.h"
+#include "../librpc/gen_ndr/ndr_smb2_lease_struct.h"
struct smbXsrv_open_table {
struct {
struct smb2srv_open_recreate_state {
struct smbXsrv_open *op;
+ const struct GUID *client_guid;
const struct GUID *create_guid;
+ const struct smb2_lease_key *lease_key;
struct security_token *current_token;
struct server_id me;
struct smb2srv_open_recreate_state *state = private_data;
TDB_DATA key = dbwrap_record_get_key(rec);
struct smbXsrv_open_global0 *global = NULL;
+ struct GUID_txt_buf buf1, buf2;
state->status = smbXsrv_open_global_verify_record(
key, oldval, state->op, &state->op->global);
}
global = state->op->global;
+ if (state->lease_key != NULL &&
+ !GUID_equal(&global->client_guid, state->client_guid))
+ {
+ DBG_NOTICE("client guid: %s != %s in %s\n",
+ GUID_buf_string(&global->client_guid, &buf1),
+ GUID_buf_string(state->client_guid, &buf2),
+ tdb_data_dbg(key));
+ goto not_found;
+ }
+
/*
* If the provided create_guid is NULL, this means that
* the reconnect request was a v1 request. In that case
*/
if ((state->create_guid != NULL) &&
!GUID_equal(&global->create_guid, state->create_guid)) {
- struct GUID_txt_buf buf1, buf2;
DBG_NOTICE("%s != %s in %s\n",
GUID_buf_string(&global->create_guid, &buf1),
GUID_buf_string(state->create_guid, &buf2),
struct auth_session_info *session_info,
uint64_t persistent_id,
const struct GUID *create_guid,
+ const struct smb2_lease_key *lease_key,
NTTIME now,
struct smbXsrv_open **_open)
{
struct smbXsrv_open_table *table = conn->client->open_table;
struct smb2srv_open_recreate_state state = {
+ .client_guid = &conn->client->global->client_guid,
.create_guid = create_guid,
+ .lease_key = lease_key,
.me = messaging_server_id(conn->client->msg_ctx),
};
struct smbXsrv_open_global_key_buf key_buf;