summaryrefslogtreecommitdiff
path: root/source4/libcli/raw
AgeCommit message (Collapse)AuthorFilesLines
2026-01-07lib: Move a few smb-related constant #defines to common codeVolker Lendecke1-44/+0
No need to have two copies in source3 and source4 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Jan 7 11:00:48 UTC 2026 on atb-devel-224
2025-06-18s3:libsmb: let smbsock_any_connect_recv return smbXcli_transportStefan Metzmacher1-19/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-06-18s4:libcli: let struct smbcli_socket hold struct smbXcli_transport instead of ↵Stefan Metzmacher3-19/+14
sockfd Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-06-18libcli/smb: pass smbXcli_transport to smbXcli_conn_create()Stefan Metzmacher1-4/+13
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: make use of smbsock_any_connect_send/recv()Stefan Metzmacher1-320/+134
This means have only one codepath that connects based on struct smb_transports. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: pass struct loadparm_context to smbcli_sock_connect_send()Stefan Metzmacher1-1/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: pass struct loadparm_context to smb_composite_connect()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: pass struct loadparm_context to smbcli_tree_full_connection()Stefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: pass struct loadparm_context to smbcli_sock_connect()Stefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: simplify struct smbcli_socketStefan Metzmacher3-13/+18
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: use the correct talloc parent for smbcli_socket->hostnameStefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: remove unused dest_ports from smbcli_tree_full_connection()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: remove unused dest_ports from struct smb_composite_connectStefan Metzmacher1-1/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: pass struct smbcli_options to smbcli_sock_connect() instead of ↵Stefan Metzmacher1-11/+32
port strings This allows us to build the ports array from options.transports. Pair-Programmed-With: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s4:libcli: introduce smbcli_options.transports based on lpcfg_smb_ports()Stefan Metzmacher1-0/+1
This will allow us to avoid passing lpcfg_smb_ports() explicitly in a lot of places in the following commits. Once that's done we will change away from "smb ports" to something like "client smb transports". Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-08-29s4:libcli: allow smb2_composite_unlink* to truncate the file before closeStefan Metzmacher1-0/+6
This is needed to delete streams... BUG: https://bugzilla.samba.org/show_bug.cgi?id=15656 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-03-12lib: Make GUID_to_ndr_buf() return voidVolker Lendecke1-5/+1
The whole point of struct GUID_ndr_buf is that this never fails. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-01-08s4/libcli/raw: implemement RAW_SFILEINFO_LINK_INFORMATIONRalph Boehme1-0/+14
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13688 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-11-15util/charset: Rename utf16_len_n() to utf16_null_terminated_len_n()Joseph Sutton1-2/+2
The new name indicates that — contrary to functions such as strnlen() — the length may include the terminator. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-07libcli: Fix whitespaceVolker Lendecke26-483/+482
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-08-14s4:libcli: Fix code spellingAndreas Schneider4-10/+10
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-08-26smbXcli: Pass negotiate contexts through smbXcli_negprot_send/recvVolker Lendecke1-2/+3
We already don't allow setting max_credits in the sync wrapper, so omit the contexts there as well. 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): Fri Aug 26 19:54:03 UTC 2022 on sn-devel-184
2022-06-09lib/util: Change function to mem_equal_const_time()Joseph Sutton1-1/+1
Since memcmp_const_time() doesn't act as an exact replacement for memcmp(), and its return value is only ever compared with zero, simplify it and emphasize the intention of checking equality by returning a bool instead. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-06-09auth: Use constant-time memcmp when comparing sensitive buffersJoseph Sutton1-1/+1
This helps to avoid timing attacks. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15010 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-03-17libcli/smb: pass smb3_capabilities to smbXcli_conn_create()Stefan Metzmacher1-1/+2
Passing NULL means use none. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14512 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-03-17s4:libcli/raw: add smb3_capabilities to struct smbcli_optionsStefan Metzmacher1-0/+2
Currently this will be zeroed in lpcfg_smbcli_options(), but will later allow advanced callers to pass values to smbXcli_conn_create(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14512 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-10-23smb: rename NTCREATEX_OPTIONS_PRIVATE_DENY_FCB to NTCREATEX_FLAG_DENY_FCBRalph Boehme1-1/+1
Just a shorter name, no change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-10-23smb: rename NTCREATEX_OPTIONS_PRIVATE_DENY_DOS to NTCREATEX_FLAG_DENY_DOSRalph Boehme1-1/+1
Just a shorter name, no change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-10-02libcli: Use GUID_to_ndr_buf() in smbcli_push_guid()Volker Lendecke1-6/+4
Avoid two talloc/free Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-07-08s4:libcli/smb2: allow smb2_connect*() to fake session and tconStefan Metzmacher1-0/+1
For multichannel connection we want a way to have just a connection with a negprot finished. For now we just fake a tcon and session in order to avoid changes in the caller. We can clean that up later if needed. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2020-04-28Implement alt name query for smb2David Mulder2-1/+8
Implements smb2_qpathinfo_alt_name() and RAW_FILEINFO_SMB2_ALT_NAME_INFORMATION. Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 097df343ce21c8340aee7f42f233fe74b92b47e2)
2019-09-25s4/libcli/raw: clang: Fix 'Value stored to 'p' is never read'Noel Power1-3/+3
Fixes: source4/libcli/raw/clisession.c:198:4: warning: Value stored to 'p' is never read <--[clang] p += smbcli_req_pull_string(&req->in.bufinfo, mem_ctx, &parms->old.out.domain, p, -1, STR_TERMINATE); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source4/libcli/raw/clisession.c:212:5: warning: Value stored to 'p' is never read <--[clang] p += smbcli_req_pull_string(&req->in.bufinfo, mem_ctx, &parms->nt1.out.domain, p, -1, STR_TERMINATE); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source4/libcli/raw/clisession.c:232:3: warning: Value stored to 'p' is never read <--[clang] p += smbcli_req_pull_string(&req->in.bufinfo, mem_ctx, &parms->spnego.out.workgroup, p, -1, STR_TERMINATE); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-09-25s4/libcli/raw: clang: Fix 'Dereference of null pointer'Noel Power1-1/+9
Fixes: source4/libcli/raw/rawfileinfo.c:597:2: warning: Dereference of null pointer <--[clang] SMBCLI_CHECK_WCT(req, 10); ^ source4/libcli/raw/rawfileinfo.c:639:2: warning: Dereference of null pointer <--[clang] SMBCLI_CHECK_WCT(req, 11); ^ Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-09-25s4/libcli/raw: clang: Fix 'Access to field results in a deref of a null ptrNoel Power1-0/+8
Fixes: source4/libcli/raw/rawfileinfo.c:301:56: warning: Access to field 'transport' results in a dereference of a null pointer (loaded from variable 'session') <--[clang] parms->standard.out.create_time = raw_pull_dos_date2(session->transport, ^ source4/libcli/raw/rawfileinfo.c:314:55: warning: Access to field 'transport' results in a dereference of a null pointer (loaded from variable 'session') <--[clang] parms->ea_size.out.create_time = raw_pull_dos_date2(session->transport, Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-07-16s4/libcli/raw: Fix 'Value stored to 'p' is never read'Noel Power1-1/+1
Fixes: source4/libcli/raw/clitree.c:138:3: warning: Value stored to 'p' is never read <--[clang] p += smbcli_req_pull_string(&req->in.bufinfo, mem_ctx, &parms->tconx.out.fs_type, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-16s4/libcli/raw: clang: Fix 'initialization value is never read'Noel Power1-2/+3
Fixes: source4/libcli/raw/rawnegotiate.c:157:11: warning: Value stored to 'status' during its initialization is never read <--[clang] NTSTATUS status = NT_STATUS_INTERNAL_ERROR; ^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-05-27Fix ubsan null pointer passed as argument 2Gary Lockyer4-24/+50
Fix ubsan warning null pointer passed as argument 2 when the source pointer is NULL. The calls to memcpy are now guarded by an if (len > 0) Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Mon May 27 01:29:48 UTC 2019 on sn-devel-184
2019-05-21s3:libcli: Use GnuTLS MD5 for smb singingAndreas Schneider1-24/+69
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-05-01s4:libcli/raw: add RAW_FILEINFO_NORMALIZED_NAME_INFORMATION supportStefan Metzmacher3-12/+16
This is supported over the wire in SMB 3.1.1 on starting with Windows 10 1803. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13919 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-04-01libsmb: Make "struct smb2_lock_element" generally usableVolker Lendecke1-6/+1
This struct will be of interest when we add locking capabilities to libcli/smb/smb2cli* Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-03-28s4:libcli/smb2: align struct smb_ioctl.smb2 to [MS-SMB2] namesStefan Metzmacher1-7/+8
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13863 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-03-28s4:libcli/raw: don't schedule idle handlers on a dead connectionStefan Metzmacher1-0/+17
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-02-28s4:libcli: remember return code from maximum accessRalph Boehme1-0/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13812 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2018-07-24s4:libcli: allow passing an already negotiated connection to ↵Stefan Metzmacher1-0/+1
smb_composite_connect() It will just do the session setup and tree connect steps. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: add smbcli_transport_raw_init()Stefan Metzmacher1-0/+44
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-07-24s4:libcli: split out smb_raw_negotiate_fill_transport()Stefan Metzmacher1-30/+44
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-09-20Make sure smbtorture tests can run if someone has set their min protocol ↵Richard Sharpe1-0/+4
above NT1. This code is SMB1 only, and already modifies maxprotocol, so this change is appropriate. Signed-off-by: Richard Sharpe <richard.sharpe@primarydata.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-05-10s4-libcli: remove some dead prototypesGünther Deschner1-1/+0
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-03-03libcli/smb: add max_credits arg to smbXcli_negprot_send()Ralph Boehme2-1/+3
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>
2017-02-21s4:libcli/raw: remove unused DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTHStefan Metzmacher1-7/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12262 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>