summaryrefslogtreecommitdiff
path: root/libcli
Commit message (Collapse)AuthorAgeFilesLines
* repl: Give an error if we get a secret when not expecting oneAndrew Bartlett2015-10-262-0/+7
| | | | | | | | | We should never get a secret from a server when we specify DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING This asserts that this is the case. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* lib: cli: Add accessor function smb2cli_tcon_flags() to get tcon flags.Jeremy Allison2015-10-142-0/+6
| | | | | | | | | 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>
* libdap: Fix a '\0' vs NULL mixupVolker Lendecke2015-10-141-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Change the libreadline word-break character set to only space, TAB and NL so ↵Richard Sharpe2015-10-071-0/+6
| | | | | | | | | | | | | that we can attempt to do tab completion across backslashes. This turned out to be all that was needed to enable cd to handle multiple directory levels. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Oct 7 04:16:24 CEST 2015 on sn-devel-104
* lib: Remove unused sid_blob_parseVolker Lendecke2015-08-262-15/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Make sid_parse take a uint8_tVolker Lendecke2015-08-262-2/+2
| | | | | | | | sid_parse takes a binary blob, uint8_t reflects this a bit better than char * does Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Use dom_sid_equal where appropriateVolker Lendecke2015-08-201-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* libcli/smb: prefer AES128_CCMStefan Metzmacher2015-08-171-2/+6
| | | | | | | | | | | | Callgrind showed that we use 28,165,720,719 cpu cycles to send a 100MB file to a client using aes-ccm. With aes-gcm this is raises up to 723,094,413,831 cpu cycles. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11451 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* libcli: Use iov_buflen in smb2_signing.cVolker Lendecke2015-08-141-6/+11
| | | | | | | | | | This gives us overflow protection. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Aug 14 13:56:49 CEST 2015 on sn-devel-104
* lib: Remove some unused codeVolker Lendecke2015-08-142-20/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* lib: Remove some unused codeVolker Lendecke2015-08-142-24/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* Introduce setting "desired" for 'smb encrypt' and 'client/server signing'Michael Adam2015-07-072-0/+7
| | | | | | | | | | | This should trigger the behaviour where the server requires signing when the client supports it, but does not reject clients that don't support it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11372 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* libcli/smb: let tstream_smbXcli_np report connection errors as EPIPE instead ↵Stefan Metzmacher2015-07-031-4/+4
| | | | | | | | | | | | | of EIO This maps to NT_STATUS_CONNECTION_DISCONNECTED instead of NT_STATUS_IO_DEVICE_ERROR. EPIPE, NT_STATUS_CONNECTION_DISCONNECTED matches what other tstream backends e.g. tcp and unix report. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* libsmb: Streamline smb1cli_trans a bitVolker Lendecke2015-06-261-3/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: ldap: Properly check talloc error returns.Jeremy Allison2015-06-161-1/+10
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jun 16 04:16:13 CEST 2015 on sn-devel-104
* libcli/smb: make sure we remove the writev_send() request when a request is ↵Stefan Metzmacher2015-06-121-0/+14
| | | | | | | | | | | | destroyed This way smbXcli_conn_disconnect() removes all tevent_fd structures attached to the sock_fd before closing it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* libcli/smb: add smb1 requests to the pending array before writev_send()Stefan Metzmacher2015-06-121-12/+6
| | | | | | | | | | This way we have a change to destroy the pending writev_send request before closing the socket in smbXcli_conn_disconnect(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* libcli/smb: make sure the writev_send of smbXcli_conn_samba_suicide() is ↵Stefan Metzmacher2015-06-121-0/+53
| | | | | | | | | removed before closing the socket BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* libcli/smb: remove unused split of read_fd and write_fdStefan Metzmacher2015-06-121-26/+12
| | | | | | | | | | The tevent epoll backend supports separate read and write tevent_fd structure on a single fd, so there's no need for a dup() anymore. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* libcli/smb: close the socket fd at the end of smbXcli_conn_disconnect()Stefan Metzmacher2015-06-121-6/+9
| | | | | | | | | | We need to cancel all pending requests before closing the socket fds, otherwise we cause problem with the interaction with the epoll event backend. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* libcli/smb: use tevent_req_received(req) in read_smb_recv()Stefan Metzmacher2015-06-121-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* libcli/named_pipe_auth: call smb_set_close_on_exec() in tstream_npa_socketpair()Stefan Metzmacher2015-06-051-0/+11
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11312 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* tstream: Make socketpair nonblockingVolker Lendecke2015-06-041-5/+20
| | | | | | | | | When we have a large RPC reply, we can't block in the RPC server. Test: Do rpcclient netshareenumall with a thousand shares defined Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: In CCM and GCM mode we can't reuse noncesStefan Metzmacher2015-05-292-11/+65
| | | | | | | | | | Reuse of nonces with AES-CCM and AES-GCM leads to catastrophic failure, so make sure the server drops the connection if that ever happens. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11300 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* s3: libsmbclient: Add server-side copy supportRoss Lagerwall2015-05-293-4/+85
| | | | | | | | | | | | | 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>
* libcli/smb: SMB 3.0.2: define SVHDX_OPEN_DEVICE_CONTEXTMichael Adam2015-05-081-0/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: SMB 3.0.2: define FSCTL_QUERY_SHARED_VIRTUAL_DISK_SUPPORTMichael Adam2015-05-081-0/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: SMB 3.0.2: define FSCTL_SVHDX_SYNC_TUNNEL_REQUESTMichael Adam2015-05-081-0/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: SMB 3.0.2: define SMB2_WRITEFLAG_WRITE_UNBUFFEREDMichael Adam2015-05-081-0/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: SMB 3.0.2: define SMB2_READFLAG_READ_UNBUFFEREDMichael Adam2015-05-081-0/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: add support for SMB >= 3.1.1 io prioritiesMichael Adam2015-05-082-0/+25
| | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: add define for SMB 3.1.1 SMB2_HDR_FLAG_PRIORITY_MASK and helper ↵Stefan Metzmacher2015-05-081-0/+4
| | | | | | | macros Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli/smb: add PROTOCOL_SMB3_11 and SMB3_DIALECT_REVISION_311Stefan Metzmacher2015-05-083-2/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli/smb: don't alter state->smb2.hdr when getting STATUS_PENDINGMichael Adam2015-05-081-20/+14
| | | | | | | | | | | | | We need to make sure smb2cli_req_get_sent_iov() returns what was sent over the wire. This is required in order to correctly perform the preauth calculation for SMB >= 3.1. We keep separate variables for the cancel information we got from a STATUS_PENDING response. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* libcli: add new NTSTATUS codes from SMB 3.1Michael Adam2015-05-082-0/+4
| | | | | | | | | NT_STATUS_SMB_NO_PREAUTH_INTEGRITY_HASH_OVERLAP NT_STATUS_SMB_BAD_CLUSTER_DIALECT Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* libcli: add missing printable form of NT_STATUS_VHD_SHAREDMichael Adam2015-05-081-0/+1
| | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s4: Fix bad review I did in dom_sid_parse_length() code.Jeremy Allison2015-04-291-1/+2
| | | | | | | | | | | | Volker, apologies for the mistake. Spotted by Andrew Bartlett <abartlet@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Apr 29 08:20:23 CEST 2015 on sn-devel-104
* lib: Simplify dom_sid_parse_lengthVolker Lendecke2015-04-281-8/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/security: add security_descriptor_for_client() helper functionStefan Metzmacher2015-03-302-0/+75
| | | | | | | This prepares a possibly stripped security descriptor for a client. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* libcli/security: support "IS" in SDDL for SID_NT_IUSRStefan Metzmacher2015-03-301-0/+1
| | | | | | | TODO: we should import the whole lists from [MS-DTYP]. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* libcli/util: remove unused WERR_BAD_PASSWORDStefan Metzmacher2015-03-272-3/+0
| | | | | | | The values are the same, but WERR_INVALID_PASSWORD matches the documentation. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* libcli/auth: use WERR_INVALID_PASSWORD instead of WERR_BAD_PASSWORDStefan Metzmacher2015-03-271-3/+3
| | | | | | | The values are the same, but WERR_INVALID_PASSWORD matches the documentation. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* libcli/util: let WERR_UNKNOWN_LEVEL be an alias to WERR_INVALID_LEVELStefan Metzmacher2015-03-272-2/+3
| | | | | | | | WERR_INVALID_LEVEL is the documented name that should be printed in logs. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* Rename SMB2_OP_FIND to SMB2_OP_QUERY_DIRECTORY so that it conforms with the ↵Richard Sharpe2015-03-272-20/+20
| | | | | | | | | | MS document MS-SMB2. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Mar 27 01:24:47 CET 2015 on sn-devel-104
* libcli/auth: add forward declaration for struct wkssvc_PasswordBufferStefan Metzmacher2015-03-201-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/auth: add some const to netlogon_creds_server_{init,step_check}()Stefan Metzmacher2015-03-202-4/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/auth: Match Declaration of netlogon_creds_cli_context_tmp with ↵Thomas Schulz2015-03-201-1/+1
| | | | | | | | | | | | | implementation I have been building 4.2.0 with the GNU C compiler but I decided to see how it works with the Sun C 5.11 compiler. The Sun compiler complains about a identifier being redeclared in libcli/auth/netlogon_creds_cli.c BUG: https://bugzilla.samba.org/show_bug.cgi?id=11140 Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3: libcli: smb1: Ensure we correctly finish a tevent req if the writev ↵Jeremy Allison2015-03-201-0/+1
| | | | | | | | | | | | | | | | | | | fails in the SMB1 case. We haven't added the req to the pending array yet, as SMB1 requests can be one-way (no reply needed). So if we error out after the writev, but before we add to the pending array we must rember to terminate our current tevent req with a tevent_req_nterror call. Fixes bug 11173 - SMB1 Server disconnect can cause timeout on client write error. https://bugzilla.samba.org/show_bug.cgi?id=11173 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Mar 20 05:08:25 CET 2015 on sn-devel-104
* lib/util: globally include herrors in error.hGünther Deschner2015-03-131-0/+1
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/util/hresult: add generated hresult_errstr() function.Günther Deschner2015-03-132-0/+16
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>