diff options
author | Ralph Boehme <slow@samba.org> | 2016-04-13 17:44:26 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2016-05-04 01:28:22 +0200 |
commit | a2c59d3e45e71b44d9135b35c1cf5522e04dec0e (patch) | |
tree | a5299caed772b524a40c8d1c5402f405bf7bc9a9 /source3/smbd/smb2_sesssetup.c | |
parent | 719e42294d33f9e40d6f21c85a59296921b4b297 (diff) | |
download | samba-a2c59d3e45e71b44d9135b35c1cf5522e04dec0e.tar.gz |
smbd: use remote arch caching
We're using the client guid as gencache db key, so this can only be used
with SMB 2_10 or higher.
The idea is that whenever we get a direct SMB2 negprot, we can then try
to see if a value is cached for the client's guid.
When a user logs off the cache entry is deleted.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd/smb2_sesssetup.c')
-rw-r--r-- | source3/smbd/smb2_sesssetup.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index 821024fec18..6a0caac1308 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -1306,6 +1306,9 @@ static void smbd_smb2_logoff_shutdown_done(struct tevent_req *subreq) struct smbd_smb2_logoff_state *state = tevent_req_data( req, struct smbd_smb2_logoff_state); NTSTATUS status; + bool ok; + const struct GUID *client_guid = + &state->smb2req->session->client->connections->smb2.client.guid; status = smb2srv_session_shutdown_recv(subreq); if (tevent_req_nterror(req, status)) { @@ -1313,6 +1316,14 @@ static void smbd_smb2_logoff_shutdown_done(struct tevent_req *subreq) } TALLOC_FREE(subreq); + if (!GUID_all_zero(client_guid)) { + ok = remote_arch_cache_delete(client_guid); + if (!ok) { + /* Most likely not an error, but not in cache */ + DBG_DEBUG("Deletion from remote arch cache failed\n"); + } + } + /* * As we've been awoken, we may have changed * uid in the meantime. Ensure we're still |