diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-10-22 14:18:20 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-11-01 16:25:33 +0100 |
commit | c5cd22b5bbce724dcd68fe94320382b3f772cabf (patch) | |
tree | 3e442f42ac1c739a50d676ff87b0840d62d7e85d | |
parent | 24f3f87706329e6e280dc6be6d025e997d46c910 (diff) | |
download | samba-c5cd22b5bbce724dcd68fe94320382b3f772cabf.tar.gz samba-c5cd22b5bbce724dcd68fe94320382b3f772cabf.tar.bz2 samba-c5cd22b5bbce724dcd68fe94320382b3f772cabf.zip |
libcli/smb: add smbXcli_session_set_disconnect_expired() (bug #9175)
This should be a short term hack until the upper layers have implemented
re-authentication.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r-- | libcli/smb/smbXcli_base.c | 34 | ||||
-rw-r--r-- | libcli/smb/smbXcli_base.h | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 02d0227637..c547515d59 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -157,6 +157,13 @@ struct smbXcli_session { struct { DATA_BLOB signing_key; } smb2_channel; + + /* + * this should be a short term hack + * until the upper layers have implemented + * re-authentication. + */ + bool disconnect_expired; }; struct smbXcli_tcon { @@ -1970,6 +1977,17 @@ static NTSTATUS smb1cli_conn_dispatch_incoming(struct smbXcli_conn *conn, cmd = CVAL(inhdr, HDR_COM); status = smb1cli_pull_raw_error(inhdr); + if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_SESSION_EXPIRED) && + (state->session != NULL) && state->session->disconnect_expired) + { + /* + * this should be a short term hack + * until the upper layers have implemented + * re-authentication. + */ + return status; + } + if (state->smb1.chained_requests == NULL) { if (num_iov != 3) { return NT_STATUS_INVALID_NETWORK_RESPONSE; @@ -3442,6 +3460,17 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct smbXcli_conn *conn, } } + if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_SESSION_EXPIRED) && + (session != NULL) && session->disconnect_expired) + { + /* + * this should be a short term hack + * until the upper layers have implemented + * re-authentication. + */ + return status; + } + smbXcli_req_unset_pending(req); /* @@ -4483,6 +4512,11 @@ NTSTATUS smbXcli_session_application_key(struct smbXcli_session *session, return NT_STATUS_OK; } +void smbXcli_session_set_disconnect_expired(struct smbXcli_session *session) +{ + session->disconnect_expired = true; +} + uint16_t smb1cli_session_current_id(struct smbXcli_session *session) { return session->smb1.session_id; diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h index 03cb2809e7..b720bc6e8c 100644 --- a/libcli/smb/smbXcli_base.h +++ b/libcli/smb/smbXcli_base.h @@ -263,6 +263,7 @@ struct smbXcli_session *smbXcli_session_create(TALLOC_CTX *mem_ctx, NTSTATUS smbXcli_session_application_key(struct smbXcli_session *session, TALLOC_CTX *mem_ctx, DATA_BLOB *key); +void smbXcli_session_set_disconnect_expired(struct smbXcli_session *session); uint16_t smb1cli_session_current_id(struct smbXcli_session* session); void smb1cli_session_set_id(struct smbXcli_session* session, uint16_t session_id); |