summaryrefslogtreecommitdiff
path: root/libcli
AgeCommit message (Collapse)AuthorFilesLines
2015-10-07Change the libreadline word-break character set to only space, TAB and NL so ↵Richard Sharpe1-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
2015-08-26lib: Remove unused sid_blob_parseVolker Lendecke2-15/+6
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-26lib: Make sid_parse take a uint8_tVolker Lendecke2-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>
2015-08-20lib: Use dom_sid_equal where appropriateVolker Lendecke1-1/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2015-08-17libcli/smb: prefer AES128_CCMStefan Metzmacher1-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>
2015-08-14libcli: Use iov_buflen in smb2_signing.cVolker Lendecke1-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
2015-08-14lib: Remove some unused codeVolker Lendecke2-20/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-08-14lib: Remove some unused codeVolker Lendecke2-24/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-07Introduce setting "desired" for 'smb encrypt' and 'client/server signing'Michael Adam2-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>
2015-07-03libcli/smb: let tstream_smbXcli_np report connection errors as EPIPE instead ↵Stefan Metzmacher1-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>
2015-06-26libsmb: Streamline smb1cli_trans a bitVolker Lendecke1-3/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2015-06-16lib: ldap: Properly check talloc error returns.Jeremy Allison1-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
2015-06-12libcli/smb: make sure we remove the writev_send() request when a request is ↵Stefan Metzmacher1-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>
2015-06-12libcli/smb: add smb1 requests to the pending array before writev_send()Stefan Metzmacher1-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>
2015-06-12libcli/smb: make sure the writev_send of smbXcli_conn_samba_suicide() is ↵Stefan Metzmacher1-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>
2015-06-12libcli/smb: remove unused split of read_fd and write_fdStefan Metzmacher1-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>
2015-06-12libcli/smb: close the socket fd at the end of smbXcli_conn_disconnect()Stefan Metzmacher1-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>
2015-06-12libcli/smb: use tevent_req_received(req) in read_smb_recv()Stefan Metzmacher1-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>
2015-06-05libcli/named_pipe_auth: call smb_set_close_on_exec() in tstream_npa_socketpair()Stefan Metzmacher1-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>
2015-06-04tstream: Make socketpair nonblockingVolker Lendecke1-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>
2015-05-29libcli/smb: In CCM and GCM mode we can't reuse noncesStefan Metzmacher2-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>
2015-05-29s3: libsmbclient: Add server-side copy supportRoss Lagerwall3-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>
2015-05-08libcli/smb: SMB 3.0.2: define SVHDX_OPEN_DEVICE_CONTEXTMichael Adam1-0/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-08libcli/smb: SMB 3.0.2: define FSCTL_QUERY_SHARED_VIRTUAL_DISK_SUPPORTMichael Adam1-0/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-08libcli/smb: SMB 3.0.2: define FSCTL_SVHDX_SYNC_TUNNEL_REQUESTMichael Adam1-0/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-08libcli/smb: SMB 3.0.2: define SMB2_WRITEFLAG_WRITE_UNBUFFEREDMichael Adam1-0/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-08libcli/smb: SMB 3.0.2: define SMB2_READFLAG_READ_UNBUFFEREDMichael Adam1-0/+2
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-08libcli/smb: add support for SMB >= 3.1.1 io prioritiesMichael Adam2-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>
2015-05-08libcli/smb: add define for SMB 3.1.1 SMB2_HDR_FLAG_PRIORITY_MASK and helper ↵Stefan Metzmacher1-0/+4
macros Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-08libcli/smb: add PROTOCOL_SMB3_11 and SMB3_DIALECT_REVISION_311Stefan Metzmacher3-2/+5
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2015-05-08libcli/smb: don't alter state->smb2.hdr when getting STATUS_PENDINGMichael Adam1-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>
2015-05-08libcli: add new NTSTATUS codes from SMB 3.1Michael Adam2-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>
2015-05-08libcli: add missing printable form of NT_STATUS_VHD_SHAREDMichael Adam1-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>
2015-04-29s4: Fix bad review I did in dom_sid_parse_length() code.Jeremy Allison1-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
2015-04-28lib: Simplify dom_sid_parse_lengthVolker Lendecke1-8/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-30libcli/security: add security_descriptor_for_client() helper functionStefan Metzmacher2-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>
2015-03-30libcli/security: support "IS" in SDDL for SID_NT_IUSRStefan Metzmacher1-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>
2015-03-27libcli/util: remove unused WERR_BAD_PASSWORDStefan Metzmacher2-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>
2015-03-27libcli/auth: use WERR_INVALID_PASSWORD instead of WERR_BAD_PASSWORDStefan Metzmacher1-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>
2015-03-27libcli/util: let WERR_UNKNOWN_LEVEL be an alias to WERR_INVALID_LEVELStefan Metzmacher2-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>
2015-03-27Rename SMB2_OP_FIND to SMB2_OP_QUERY_DIRECTORY so that it conforms with the ↵Richard Sharpe2-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
2015-03-20libcli/auth: add forward declaration for struct wkssvc_PasswordBufferStefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-20libcli/auth: add some const to netlogon_creds_server_{init,step_check}()Stefan Metzmacher2-4/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-20libcli/auth: Match Declaration of netlogon_creds_cli_context_tmp with ↵Thomas Schulz1-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>
2015-03-20s3: libcli: smb1: Ensure we correctly finish a tevent req if the writev ↵Jeremy Allison1-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
2015-03-13lib/util: globally include herrors in error.hGünther Deschner1-0/+1
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-03-13libcli/util/hresult: add generated hresult_errstr() function.Günther Deschner2-0/+16
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-03-13libcli/util/hresult: re-generate hresult.c.Günther Deschner1-1/+2929
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-03-11idl: define FSCTL_DUPLICATE_EXTENTS_TO_FILEDavid Disseldorp1-0/+1
As specified in the recent 20150129 revision of MS-FSCC. Add a note regarding the FileHandle field, which was confirmed to correspond to the volatile part of the fileid: https://lists.samba.org/archive/samba-technical/2015-February/105454.html Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-08Add the definition of FSCTL_SET_INTEGRITY_INFORMATION found from a capture ↵Richard Sharpe1-0/+2
and the Web. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Ira Cooper <ira@samba.org> Autobuild-Date(master): Sun Mar 8 00:43:08 CET 2015 on sn-devel-104