summaryrefslogtreecommitdiff
path: root/libcli/smb/smbXcli_base.h
AgeCommit message (Collapse)AuthorFilesLines
2020-11-06Add smb2cli_session_get_encryption_cipher()Isaac Boukris1-0/+1
When 'session->smb2->should_encrypt' is true, the client MUST encrypt all transport messages (see also MS-SMB2 3.2.4.1.8). Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2019-06-12libcli/smb: s/smbXcli_session_copy/smbXcli_session_shallow_copyStefan Metzmacher1-1/+1
We should make clear that this is a function for testing only, with possible strange side effects. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-03-21libcli: Use a define for the SMB_SUICIDE_PACKETAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-02-09libcli: add getters for smb2 {signing,encryption,decryption} keysAurelien Aptel1-0/+9
Adds: - smb2cli_session_signing_key() - smb2cli_session_encryption_key() - smb2cli_session_decryption_key() Signed-off-by: Aurelien Aptel <aaptel@suse.com> Reviewed-by: Noel Power <npower@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2018-11-13libcli/smb: add smb2cli_session_require_signed_response()Ralph Boehme1-0/+2
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-11-02libcli: add smbXcli_req_endtimeRalph Boehme1-0/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13667 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-01-14smbXcli: Add "force_channel_sequence"Volker Lendecke1-0/+4
This enables use of the channel sequence number even for non-multi-channel servers. This makes our client invalid, but we need to protect against broken clients with tests. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13215 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-09-20CVE-2017-12150: libcli/smb: add smbXcli_conn_signing_mandatory()Stefan Metzmacher1-0/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12997 Signed-off-by: Stefan Metzmacher <metze@samba.org>
2017-07-25libsmb: Add smb2cli_notify()Volker Lendecke1-0/+26
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-17libcli: smb: Add smb2cli_tcon_set_id().Jeremy Allison1-0/+1
Will be used in test and client code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12831 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2017-06-17libcli: smb: Add smbXcli_tcon_copy().Jeremy Allison1-0/+2
Makes a deep copy of a struct smbXcli_tcon *, will be used later. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12831 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2017-03-28libcli: introduce smbXcli_conn_support_passthrough()Uri Simchoni1-0/+1
This routine queries the client connenction whether it supports query/set InfoLevels beyond 1000 (which, in Windows OS, is a pass-through mechanism to the file system). Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-03-03libcli/smb: add smb2cli_conn_get_mid and smb2cli_conn_set_midRalph Boehme1-0/+2
This will be needed for a torture test in the next commit. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-03-03libcli/smb: add smb2cli_conn_get_cur_creditsRalph Boehme1-0/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-03-03libcli/smb: add max_credits arg to smbXcli_negprot_send()Ralph Boehme1-1/+2
This allows source4/torture code to set the option for tests by preparing a struct smbcli_options with max_credits set to some value and pass that to a torture_smb2_connection_ext(). This will be used in subsequent smbtorture test for SMB2 creditting. Behaviour of existing upper layers is unchanged, they simply pass the wanted max credits value to smbXcli_negprot_send() instead of retrofitting it with a call to smb2cli_conn_set_max_credits(). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2016-11-15libcli/smb: add smb1cli_session_setup_ext_send/recv()Stefan Metzmacher1-0/+21
This does a session setup for the NT1 protocol with CAP_EXTENDED_SECURITY. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-15libcli/smb: add smb1cli_session_setup_nt1_send/recv()Stefan Metzmacher1-0/+24
This does a session setup for the NT1 protocol (without CAP_EXTENDED_SECURITY). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-11-15libcli/smb: add smb1cli_session_setup_lm21_send/recv()Andreas Schneider1-0/+20
This does a session setup for the LANMAN 2(.1) protocol. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-04-28libcli/smb: add smbXcli_session_is_guest() helper functionStefan Metzmacher1-0/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11841 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-28libcli/smb: add smb1cli_session_set_action() helper functionStefan Metzmacher1-0/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11841 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2016-03-22libcli:smb:smbXcli_base: add smb2cli_session_current_channel_sequence() call.Günther Deschner1-0/+1
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-14lib: cli: Add accessor function smb2cli_tcon_flags() to get tcon flags.Jeremy Allison1-0/+1
We need this to see if a share supports access-based enumeration. https://bugzilla.samba.org/show_bug.cgi?id=10252 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2015-05-29s3: libsmbclient: Add server-side copy supportRoss Lagerwall1-0/+6
Introduce a new operation, splice, which copies data from one SMBCFILE to another. Implement this operation using FSCTL_SRV_COPYCHUNK_WRITE for SMB2+ protocols and using read+write for older protocols. Since the operation may be long running, it takes a callback which gets called periodically to indicate progress to the application and given an opportunity to stop it. Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-08libcli/smb: add support for SMB >= 3.1.1 io prioritiesMichael Adam1-0/+3
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-10-07libcli/smb: implement SMB 3.10 session setupStefan Metzmacher1-0/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-07libcli/smb: add smb2cli_req_get_send_iov()Stefan Metzmacher1-0/+10
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-09-30libcli/smb: add smb2cli_validate_negotiate_info*()Stefan Metzmacher1-0/+8
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30libcli/smb: move smb2cli_tcon.c to the toplevelStefan Metzmacher1-0/+28
removing use of cli_state from the code. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30libcli/smb: add smb2cli_tcon_{should_sign,is_signing_on}()Stefan Metzmacher1-0/+3
This can be used to force signing for individual requests. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30libcli/smb: add smb2cli_tcon_should_encrypt()Stefan Metzmacher1-0/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30libcli/smb: add smbXcli_session_is_authenticated()Stefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19libcli/smb: Add routines to enable/disable SMB2_HDR_FLAG_REPLAY_OPERATION flag.Anubhav Rakshit1-0/+2
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19libcli/smb: Add routine to reset the Channel Sequence number.Anubhav Rakshit1-0/+2
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-30libcli: Make smb2cli_create return blobsVolker Lendecke1-2/+6
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-09s3: client - rename 'struct smb2_create_returns' to 'struct ↵Jeremy Allison1-3/+3
smb_create_returns' so we can use this in SMB1 create returns as well. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-01-07libcli/smb: add smb1cli_readx*Gregor Beck1-0/+13
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07libcli/smb: add smb1cli_writex*Gregor Beck1-0/+27
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07libcli/smb: add smb1cli_close*Gregor Beck1-0/+17
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07libcli/smb: add smb1cli_ntcreatex*Gregor Beck1-0/+37
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-10-17libcli/smb: add smbXcli_tcon_{set,get}_fs_attributes()Stefan Metzmacher1-0/+3
These are the attributes returned from the FileFsAttributeInformation request. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17libcli/smb: add smbXcli_tcon_is_dfs_share()Stefan Metzmacher1-0/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17libcli/smb: Introduce smbXcli_conn_dfs_supportedLuk Claes1-0/+2
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Luk Claes <luk@debian.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-15libcli/smb: add smb2cli_tcon_is_encryption_on()Michael Adam1-0/+1
https://bugzilla.samba.org/show_bug.cgi?id=10208 Signed-off-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 Allison1-0/+1
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 Metzmacher1-0/+1
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 Metzmacher1-0/+1
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 Metzmacher1-1/+2
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 Metzmacher1-1/+2
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 Allison1-2/+5
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 Allison1-2/+4
written. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>