summaryrefslogtreecommitdiff
path: root/libcli/smb
AgeCommit message (Collapse)AuthorFilesLines
2013-09-18libcli/smb: only check the SMB2 session setup signature if required and validStefan Metzmacher1-5/+21
This is an update to commit af290a03cef63c3b08446c1980de064a3b1c8804 that skips the scary debug messages. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10146 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Sep 18 04:46:00 CEST 2013 on sn-devel-104
2013-09-17libcli/smb: fix non mendatory signing against some vendor SMB2 servers.Stefan Metzmacher1-1/+10
Windows and Samba always sign the final session setup response even if signing is not mendatory, but it ensures that the signing key is correctly in place. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10146 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Sep 17 09:40:10 CEST 2013 on sn-devel-104
2013-09-17libcli/smb: use SMB1 MID=0 for the initial NegprotStefan Metzmacher1-0/+8
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10144 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-17libcli/smb: negotiate SMB3_DIALECT_REVISION_302 if PROTOCOL_SMB3_02 is requestedStefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-17libcli/smb: add PROTOCOL_SMB3_02Stefan Metzmacher1-2/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-17libcli/smb: add SMB3_DIALECT_REVISION_302Stefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-21As SMB3 has transport level encryption, allow smbclient -e to force encryted ↵Jeremy Allison2-0/+22
SMB3 transport. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-15libcli/smb: add smb2cli_conn_req_possible()Stefan Metzmacher2-0/+23
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15libcli/smb: add smb1cli_conn_req_possible()Stefan Metzmacher2-0/+18
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15libcli/smb: pass max_dyn_len to smb2cli_req_send()Stefan Metzmacher13-16/+50
This way we can calculate the correct credit charge for requests with large output buffers. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15libcli/smb: pass max_dyn_len to smb2cli_req_create()Stefan Metzmacher2-4/+10
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15libcli/smb: calculate the credit charge on the input and output dyn_lenStefan Metzmacher1-1/+11
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15libcli/smb: Change smb2cli_create() and smb2cli_create_recv() to return a ↵Jeremy Allison3-23/+35
parameter blob of the newly opened/created file. Will use in the smb2 client code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-08-15libcli/smb: Fix smb2cli_write_recv() and smb2cli_write() to return the bytes ↵Jeremy Allison2-7/+29
written. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-08-15libcli/smb: fix the credit handling on a SMB1 => SMB2 negotiateStefan Metzmacher1-1/+6
Our cur_credit value had 1 credit too many in the case of an SMB1 => SMB2 upgrade. When we max out the credits the server disconnected the connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-12libsmb: Remove an unnecessary variable assignmentVolker Lendecke1-2/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-12libsmb: Avoid an unnecessary "else"Volker Lendecke1-1/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-09lib: add FSCTL_[GET/SET]_COMPRESSION constantsDavid Disseldorp1-0/+3
Values taken from MS-FSCC. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-06-21Add missing SMB2/SMB3 share capability flag defineSteve French1-0/+1
SMB3.02 adds SHARE_CAP_ASYMMETRIC Signed-off-by: Steve French <smfrench@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jun 21 22:57:16 CEST 2013 on sn-devel-104
2013-06-19build: Build with system md5.h on OpenIndianaAndrew Bartlett1-1/+1
This changes (again...) our system md5 detection to cope with how OpenIndiana does md5. I'm becoming increasingly convinced this isn't worth our while (we should have just done samba_md5...), but for now this change seems to work on FreeBSD, OpenIndiana and Linux with libbsd. This needs us to rename struct MD5Context -> MD5_CTX, but we provide a config.h define to rename the type bad if MD5_CTX does not exist (it does however exist in the md5.h from libbsd). Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 19 21:32:36 CEST 2013 on sn-devel-104
2013-04-30libcli: Add smb2_lease marshallingVolker Lendecke3-0/+94
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-30libsmb: Move "struct smb2_lease" to commonVolker Lendecke3-0/+45
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-18libcli/smb: add SMB2_LEASE_FLAG_* definesStefan Metzmacher1-0/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-03-20libcli/smb: smb1cli_inbuf_parse_chain() and smb1cli_conn_dispatch_incoming() ↵Jeremy Allison1-2/+2
should use smb_len_tcp. They have to cope with large READX call replies that have a length greater than smb_len_nbt() can handle. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-20libcli/smb: defer failing for missing NEGOTIATE_SECURITY_SIGNATURES_ENABLEDStefan Metzmacher1-0/+9
Windows servers take a look at the FLAGS2_SMB_SECURITY_SIGNATURES_REQUIRED flag during a session setup and turn on signing if the client requires it. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-20libcli/smb: add SMB_CAP_LEGACY_CLIENT_MASK defineStefan Metzmacher1-0/+10
Older Samba releases (<= 3.6.x) expect the client to send CAP_LARGE_READX in order to let the client use large reads. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-19libcli/smb: make use of samba_tevent_context_init()Stefan Metzmacher14-15/+15
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-01-30Add new function smbXcli_session_copy(), to be used when creating compound ↵Jeremy Allison2-0/+29
SMB2 requests. Copies the signing state needed to make client compound requests work on signed connections. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2013-01-16smb2_ioctl: split ioctl handler code on device typeDavid Disseldorp1-0/+2
Add per device type ioctl handler source files for FSCTL_DFS, FSCTL_FILESYSTEM, FSCTL_NAMED_PIPE and FSCTL_NETWORK_FILESYSTEM. Reviewed by: Jeremy Allison <jra@samba.org>
2012-12-21libcli: Fix smb2cli_ioctl_send() if clause.Andreas Schneider1-1/+1
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2012-11-30Fix Bug 9422 - large read requests cause server to issue malformed replyVolker Lendecke1-1/+1
Reviewed by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Nov 30 03:27:07 CET 2012 on sn-devel-104
2012-11-01libcli/smb: add smbXcli_session_set_disconnect_expired() (bug #9175)Stefan Metzmacher2-0/+35
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>
2012-10-27libcli/smb: fix unitialized padding in smb2_create_blob_push_one() (bug #9209)Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sat Oct 27 10:05:22 CEST 2012 on sn-devel-104
2012-09-29libcli/smb: add smb1cli_echo*Stefan Metzmacher3-0/+181
metze
2012-09-29libcli/smb: add smb2cli_echo*Stefan Metzmacher3-0/+130
metze
2012-09-29libcli/smb: use an explicit TALLOC_FREE(subreq) in smb2cli_*Stefan Metzmacher9-0/+9
metze
2012-09-27Fix bug #9209 - Parse of invalid SMB2 create blob can cause smbd crash.Jeremy Allison1-3/+2
Ensure we correctly protect against blobs with data_offset==0 and data_length != 0. Jeremy. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Sep 27 22:07:02 CEST 2012 on sn-devel-104
2012-09-19libcli: add a define for the APP_INSTANCE_ID smb2 create contextMichael Adam1-0/+1
2012-09-19libcli/smb: fix padding in smb2_create_blob*Stefan Metzmacher1-11/+30
metze
2012-08-25libcli/smb: split out a smb_transport private libraryStefan Metzmacher1-3/+15
metze
2012-08-25libcli/smb: wscript_build => wscriptStefan Metzmacher1-1/+2
We'll need some configure checks in future. metze
2012-08-17libcli/smb: make sure the SMB2_TRANSFORM pdu is completeStefan Metzmacher1-3/+12
metze
2012-08-16libcli/smb: support broken OS/2 error responses bug #9096Stefan Metzmacher1-3/+57
OS/2 skips the DATA Block in SMB1 responses. metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Aug 16 13:16:49 CEST 2012 on sn-devel-104
2012-08-15libcli/smb: verify decrypted SMB2 pdus correctlyStefan Metzmacher1-2/+38
We need to make sure we got a encrypted response if we asked for it. If we don't get a encrypted response, we use a similar logic as with signing to propagated wellknown errors to the higher layer and set state->smb2.signing_skipped = true. metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Aug 15 16:26:26 CEST 2012 on sn-devel-104
2012-08-15libcli/smb: fix parsing of compounded messages within a SMB2_TRANSFORM pduStefan Metzmacher1-5/+12
One SMB2_TRANSFORM pdu wraps multiple SMB2 pdus. We inject the SMB2_TRANSFORM header to each response which was wrapped inside. This allows the next layer to verify if the SMB2 pdu was encrypted. metze
2012-08-15libcli/smb: fix smb2cli_req_compound_submit for multiple encrypted messagesStefan Metzmacher1-63/+104
There should be only one SMB2_TRANSFORM header for all compound requests. metze
2012-08-15libcli/smb: all flags except SMB2_HDR_FLAG_ASYNC should be cleared in a ↵Stefan Metzmacher1-0/+6
cancel request. metze
2012-08-08libcli/smb: do not set SMB2_TF_MSG_SIZE in the callerStefan Metzmacher1-3/+0
metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Aug 8 07:32:55 CEST 2012 on sn-devel-104
2012-08-08libcli/smb: smb2_signing_[en|de]crypt_pdu() check and set SMB2_TF_MSG_SIZEStefan Metzmacher1-6/+16
metze
2012-08-07libcli/smb: use forward declaration instead of includesStefan Metzmacher1-3/+2
metze