summaryrefslogtreecommitdiff
path: root/source3/libsmb/proto.h
Commit message (Collapse)AuthorAgeFilesLines
* CVE-2019-10218 - s3: libsmb: Protect SMB1 client code from evil server ↵Jeremy Allison2019-10-291-0/+3
| | | | | | | | | | returned names. Disconnect with NT_STATUS_INVALID_NETWORK_RESPONSE if so. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14071 Signed-off-by: Jeremy Allison <jra@samba.org>
* libsmb: Add async cli_lockingx()Volker Lendecke2019-06-181-0/+43
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libsmb: Remove unused is_andx_reqVolker Lendecke2019-06-181-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libsmb: Remove unused cli_[un]lock64()Volker Lendecke2019-06-181-11/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libsmb: Change cli_posix_readlink to return talloc'ed targetVolker Lendecke2019-03-271-5/+7
| | | | | | | | | | | | | | | | This is a deviation from the Posix readlink function that from my point of view makes this function easier to use. In Posix, probably the assumption is that readlink is cheap, so someone under memory constraints could just start with a small buffer and incrementally increase the buffer size. For us, it's a network round-trip, and we have the luxury of [mt]alloc, which the syscall kernel interface does not have. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Mar 27 12:31:37 UTC 2019 on sn-devel-144
* libsmb: Don't pass "cli" to cli_posix_readlink_recvVolker Lendecke2019-03-271-2/+2
| | | | | | | | From my point of view the option to change "cli" between cli_posix_readlink_send and _recv is not necessary. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make SMB1-only cli_nt_hardlink calls staticVolker Lendecke2019-03-201-8/+0
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Mar 20 23:32:31 UTC 2019 on sn-devel-144
* libsmb: Introduce protocol-agnostic cli_hardlinkVolker Lendecke2019-03-201-0/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Change cli_posix_stat_send to take a pointer to sbufVolker Lendecke2019-03-181-5/+5
| | | | | | | | | | This moves the parsing work from the _recv function into the _done function. This makes writing the SMB2 call easier later on: We can have a smb2-specific done function doing the smb2-specific work and we don't have to fork on protocol in the _recv function. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: add cli_query_mxac()Ralph Boehme2019-03-041-0/+4
| | | | | | | Works only for SMB2. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: Avoid duplicated code by making cli_read_sink() publicTim Beale2019-01-071-0/+1
| | | | | | | | | | cli_read_sink() and pull_helper() were essentially identical. By making cli_read_sink() non-static, we can delete the latter. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:libsmb: pass impersonation_level to cli_ntcreate_send()Stefan Metzmacher2018-12-131-0/+1
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Tim Beale <timbeale@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: add cli_write_send/recv which work with SMB1/2/3Stefan Metzmacher2018-12-131-0/+7
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Tim Beale <timbeale@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libsmb: Expose protocol-agnostic cli_writeall_send/recvVolker Lendecke2018-08-271-0/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Add protocol-agnostic cli_readVolker Lendecke2018-08-271-0/+9
| | | | | | | | | So far only cli_pull could be called directly without looking at the protocol. We did not have a simple read that did the right thing depending on the protocol Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/libsmb: adjust smb1 cli code to use idl structs and ndr push/pull funcs.Noel Power2018-07-311-0/+6
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: libsmb: Rename cli_close_create() -> cli_smb1_close_create().Jeremy Allison2017-12-061-1/+1
| | | | | | | | | | Move cli_smb1_close_done() next to its caller. This is SMB1 specific. Prepare to wrap cli_close_send/cli_close_recv to handle SMB2. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13159 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* CVE-2017-12151: s3:libsmb: add cli_state_is_encryption_on() helper functionStefan Metzmacher2017-09-201-0/+1
| | | | | | | | | This allows to check if the current cli_state uses encryption (either via unix extentions or via SMB3). BUG: https://bugzilla.samba.org/show_bug.cgi?id=12996 Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:libsmb: Move prototye of remote_password_change()Andreas Schneider2017-08-231-0/+10
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12975 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* Add support for passing the max_referral_level into the cli call to get a ↵Richard Sharpe2017-07-071-0/+7
| | | | | | | DFS referral. This is being done so I can write tests of the DFS referral code on the server side. Signed-off-by: Richard Sharpe <richard.sharpe@primarydata.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: remove unused 'bool show_hdr' from cli_cm_open()Stefan Metzmacher2017-06-271-1/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: no longer pass remote_realm to cli_state_create()Stefan Metzmacher2017-06-221-1/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: remove unused cli_state_remote_realm()Stefan Metzmacher2017-06-221-1/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: libsmb: Widen cli_state_get_tid() / cli_state_set_tid() to 32-bits.Jeremy Allison2017-06-171-2/+2
| | | | | | | | | Copes with SMB2 connections. 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>
* s3: libsmb: Add cli_state_save_tcon() / cli_state_restore_tcon().Jeremy Allison2017-06-171-0/+3
| | | | | | | | | Save and restore tcon pointers in smb1 or smb2 structs. 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>
* libsmb: proto.h does not need ads.hVolker Lendecke2017-05-171-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-libsmb: remove some dead prototypeGünther Deschner2017-05-101-1/+0
| | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-libsmb: fail rename and replace inside cifs variantUri Simchoni2017-03-281-4/+5
| | | | | | | | | Another refactoring step - fail request to rename and replace existing file from within the CIFS version, allowing the soon-to-be-added SMB version to succeed. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: libsmb: add replace support to cli_rename()Uri Simchoni2017-03-281-1/+4
| | | | | | | | | Adds support for replacing the destination file at the higher-level cli_rename(). This is actually supported only by SMB2, and fails with invalid parameter with SMB1. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: pass cli_credentials to cli_check_msdfs_proxy()Stefan Metzmacher2016-12-211-3/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: split out cli_cm_force_encryption_creds()Stefan Metzmacher2016-12-211-0/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: remove now unused cli_session_setup()Stefan Metzmacher2016-12-211-4/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: remove unused cli_*_encryption* functionsStefan Metzmacher2016-12-211-9/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: add cli_smb1_setup_encryption*() functionsStefan Metzmacher2016-12-211-0/+2
| | | | | | | | This will allow us to setup SMB1 encryption by just passing cli_credentials. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: split out a cli_session_creds_prepare_krb5() functionStefan Metzmacher2016-12-191-0/+2
| | | | | | | | | | | This can be used temporarily to do the required kinit if we use kerberos and the password has been specified. In future this should be done in the gensec layer on demand, but there's more work attached to doing it in the gensec_gse module. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: don't pass 'passlen' to cli_tree_connect[_send]() and allow pass=NULLStefan Metzmacher2016-12-091-1/+1
| | | | | | | | | | There're no callers which try to pass a raw lm_response directly anymore. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Dec 9 13:09:37 CET 2016 on sn-devel-144
* s3:libsmb: add cli_tree_connect_creds()Stefan Metzmacher2016-12-091-0/+3
| | | | | | | | | | | | This can be used with a valid creds structure in order to do a share level authentication or with NULL in the cases we assume a modern server already. Later we can change the ordering and implement cli_tree_connect() on top of cli_tree_connect_creds(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: change cli_full_connection_send/recv into ↵Stefan Metzmacher2016-12-021-5/+13
| | | | | | | cli_full_connection_creds_send/recv Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: make cli_session_creds_init() non-staticStefan Metzmacher2016-11-151-0/+9
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: add cli_session_setup_anon()Stefan Metzmacher2016-11-151-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: change cli_session_setup_send/recv into ↵Stefan Metzmacher2016-11-151-7/+8
| | | | | | | cli_session_setup_creds_send/recv Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli/smb: move {smb,trans2}_bytes_push_{str,bytes}() to common codeStefan Metzmacher2016-11-151-9/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:libsmb: let the callers only pass the password string to ↵Stefan Metzmacher2016-11-151-4/+2
| | | | | | | | | cli_session_setup[_send]() There're no callers which tried to pass raw {lm,nt}_response any more. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* cliquota: factor out building of FILE_FS_CONTROL_INFORMATIONUri Simchoni2016-10-041-0/+4
| | | | | | | | | add a service routine that builds FILE_FS_CONTROL_INFORMATION with default quota and flags. This will be reused by SMB2 and by server code. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* cliquota: factor out building of FILE_QUOTA_INFORMATIONUri Simchoni2016-10-041-2/+11
| | | | | | | | | | | | Add a function to build a FILE_QUOTA_INFORMATION buffer out of a quota list, and a function that adds a record to a quota list. Some parameters of the new functions are unused by client code, but will be used by server code. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* cliquota: factor out fs quota parsingUri Simchoni2016-10-041-0/+3
| | | | | | | This code will be reused by SMB2 code. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* cliquota: factor out parsing of a quota record bufferUri Simchoni2016-10-041-0/+4
| | | | | | | | In preparation for SMB2 support, take parsing of the return buffer into a separate function. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-libsmb: make parse_user_quota_record() publicUri Simchoni2016-10-041-0/+4
| | | | | | | For reuse by SMB2 client code. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: libsmb: Add return args to clistr_is_previous_version_path().Jeremy Allison2016-08-221-1/+4
| | | | | | | | | Not yet used - we will use these to construct the SMB2 TWrp blob. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12166 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* s3: libsmb: Add clistr_is_previous_version_path()Jeremy Allison2016-08-191-0/+1
| | | | | | | | | Looks for @GMT- token in pathname. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12165 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>