summaryrefslogtreecommitdiffstats
path: root/source3/libsmb
Commit message (Collapse)AuthorAgeFilesLines
* libsmb: Make "ip_service_compare" staticVolker Lendecke2015-02-271-1/+1
| | | | | | | | 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 Feb 27 06:20:58 CET 2015 on sn-devel-104
* libsmb: Do not lookup invalid netbios names.Andreas Schneider2015-02-231-3/+14
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: provide authinfo domain for encrypted session referralsDavid Disseldorp2015-01-211-1/+1
| | | | | | | | | | | | 6c9de0cd056afc0b478c02f1bdb0e06532388037 requires this extra change. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11059 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 21 04:29:06 CET 2015 on sn-devel-104
* libsmb: provide authinfo domain for DFS referral authDavid Disseldorp2015-01-191-3/+8
| | | | | | | | | | | libsmbclient uses the smbc_init->smbc_get_auth_data_fn() provided workgroup/domain in initial connections, but then switches to the default smb.conf workgroup/domain when handling DFS referrals. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11059 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: reuse connections derived from DFS referralsDavid Disseldorp2015-01-191-24/+79
| | | | | | | | | | | | | | | | | | | | | | | [MS-DFSC] 3.2.1.1 and 3.2.1.2 states that DFS targets with the same site location or relative cost are placed in random order in a DFS referral response. libsmbclient currently resolves DFS referrals on every API call, always using the first entry in the referral response. With random ordering, libsmbclient may open a new server connection, rather than reuse an existing (cached) connection established in a previous DFS referred API call. This change sees libsmbclient check the connection cache for any of the DFS referral response entries before creating a new connection. This change is based on a patch by Har Gagan Sahai <SHarGagan@novell.com>. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10123 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* cli_connect_nb_send: don't segfault on host == NULL.Michael Adam2015-01-191-7/+15
| | | | | | | | | | | | | | | The functions called futher down can cope with host == NULL. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11058 This is part one of the bugfix: This ensures that it is enough to pass one of host or address to the function. Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-libsmb: Remove obsolete support for dns_host_file.Andreas Schneider2014-12-181-27/+0
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* addns: Remove support for dns_host_file.Andreas Schneider2014-12-182-28/+41
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: let cli_session_setup_kerberos_recv() return a useful error codeStefan Metzmacher2014-12-181-6/+22
| | | | | | | | | | Forcing NT_STATUS_UNSUCCESSFUL is not a good idea, we should return NT_STATUS_LOGON_FAILURE instead. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11010 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libsmb: Simplify netsamlogon_cache_getVolker Lendecke2014-12-121-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Only print decoded netsamlogon cache entriesVolker Lendecke2014-12-121-4/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Fix removing invalid samlogon cache entriesVolker Lendecke2014-12-121-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Allow change of BDC trust account passwordAndrew Bartlett2014-12-111-0/+3
| | | | | | | | | | This account is otherwise just like the workstation trust acocunt, so use that code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10891 Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib: Split out sys_[read|write] & friendsVolker Lendecke2014-12-071-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: leases: libsmbsharemodes no longer works with SMB2 leases inside our ↵Jeremy Allison2014-12-042-11/+8
| | | | | | | | | locking.tdb. Remove it until a maintainer can be found. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-libsmb: Duplicate the memory before we free it.Andreas Schneider2014-12-021-3/+6
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10279 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Dec 2 21:46:53 CET 2014 on sn-devel-104
* s3-libsmb: Set the netbios_name in use_ccache case too.Andreas Schneider2014-12-021-0/+9
| | | | | | | | | | If we do not set the netbios_name we are not able to connect to a Windows DC. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10279 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:libsmb: remove unused variables in cliconnect.cStefan Metzmacher2014-11-251-3/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: fix some function header comments.Michael Adam2014-11-201-3/+3
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Nov 20 18:45:28 CET 2014 on sn-devel-104
* s3-libsmb: Make sure the stat structure is initialized.Andreas Schneider2014-10-311-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: libsmbclient - smb2. MacOSX 10 SMB2 server doesn't set ↵Jeremy Allison2014-10-231-0/+14
| | | | | | | | | | | STATUS_NO_MORE_FILES when handed a non-wildcard path. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Steve French <smfrench@gmail.com> Tested-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Steve French <sfrench@samba.org> Autobuild-Date(master): Thu Oct 23 20:44:31 CEST 2014 on sn-devel-104
* s3:libsmb: remove unused cli_set_username() functionStefan Metzmacher2014-10-172-15/+0
| | | | | | Change-Id: Ib432b4ff66f966de9e733e01de6de2f486c0c728 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: avoid calling cli_set_username() cliconnect.cStefan Metzmacher2014-10-171-33/+1
| | | | | | Change-Id: I45e44405ea51ecb1aa38c72f4fc6243a1d3d531a Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: avoid calling cli_set_username() in clidfsStefan Metzmacher2014-10-171-3/+0
| | | | | | Change-Id: I8b32be8a10d2bff33bb468cc68c98e555b220bde Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: avoid cli_set_username() in SMBC_server_internal()Stefan Metzmacher2014-10-171-7/+0
| | | | | | Change-Id: I32e19078a4d4948e405f39dc2a479ff925ad3684 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: Remove unused domain copy stored in cli_stateStefan Metzmacher2014-10-176-56/+6
| | | | | | Change-Id: I7333140906bb3a487205b5760396dcc00a9f49b0 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:libsmb: Remove unused password copy stored in cli_stateAndrew Bartlett2014-10-176-32/+11
| | | | | | Change-Id: Ia6b33a25628ae08be8a8c6baeb71ce390315cb45 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-librpc: Add cli_rpc_pipe_open_with_creds()Andrew Bartlett2014-10-171-0/+8
| | | | | | | | | | | This provides a credentials-based interface. In the long term, we will want to change this not to reference the credentials, but for now this suits the caller in winbindd_cm.c Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libsmb: Print the principal name that we failed to kinit for.Andrew Bartlett2014-10-171-6/+7
| | | | | | | | | | This should aid debugging when this is called from an automated process. Andrew Bartlett Change-Id: I2c7291ab3f67f9f7462d7c52c8c9a4b042f7ec5a Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-rpc_client: Adapt cli_rpc_pipe_open_generic_auth to use enum ↵Andrew Bartlett2014-10-081-0/+1
| | | | | | | | | | | credentials_kerberos_state This allows us to pass this value in directly from the cli_credentials structure in winbindd, once we merge this with cli_rpc_pipe_open_spnego(). Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* samlogon_cache: don't leak cache_path onto talloc tosDavid Disseldorp2014-10-061-1/+6
| | | | | | | | Also check for allocation failures. Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: remove unused smb2cli.hStefan Metzmacher2014-09-303-29/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli/smb: move smb2cli_tcon.c to the toplevelStefan Metzmacher2014-09-303-306/+22
| | | | | | | removing use of cli_state from the code. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smb2cli_tcon: use smb2 signing if possibleStefan Metzmacher2014-09-301-1/+7
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:libsmb: remove unused ';'Stefan Metzmacher2014-09-301-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3: libsmb: Ensure all asn1_XX returns are checked.Jeremy Allison2014-09-261-116/+137
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
* s3:libsmb: add 'cli_state_client_guid'Stefan Metzmacher2014-09-192-1/+10
| | | | | | | This can be used by tests to use the same client guid for multiple connections. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* namecache: fix uninitialised pointer returnsDavid Disseldorp2014-09-131-3/+3
| | | | | | | | | | asprintf_strupper_m() doesn't set *strp on error. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Sep 13 03:21:39 CEST 2014 on sn-devel-104
* s3-lib: Do not walk past the end of the dos_to_ntstatus_map arrayAndrew Bartlett2014-09-081-1/+1
| | | | | | | | Found by AddressSanitizer Change-Id: Ic8b3e2599713c37b11324f9ec2d01891f0f287b9 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
* s3:libsmb: Set a max charge for SMB2 connectionsRoss Lagerwall2014-08-211-0/+5
| | | | | | | | | | | | Set a max charge for SMB2 connections so that larger request sizes can be used and more requests can be in flight. Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Aug 21 17:31:11 CEST 2014 on sn-devel-104
* Fixed a memory leak in cli_set_mntpoint().Har Gagan Sahai2014-08-131-2/+4
| | | | | | | | | | | | | | Fixes bug #10759 - Memory leak in libsmbclient in cli_set_mntpoint function https://bugzilla.samba.org/show_bug.cgi?id=10759 Signed-off-by: Har Gagan Sahai <SHarGagan@novell.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-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 Aug 13 04:36:50 CEST 2014 on sn-devel-104
* samlogon_cache: avoid overwriting info3->base.full_name.string.Andreas Schneider2014-07-151-0/+14
| | | | | | | | | | | | | | This field servers as a source for the gecos field. We should not overwrite it when a info3 struct from a samlogon network level gets saved in which case this field is always NULL. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10440 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Jul 15 18:25:28 CEST 2014 on sn-devel-104
* samlogon_cache: use a talloc_stackframe inside netsamlogon_cache_store.Günther Deschner2014-07-151-9/+4
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libcli: Make cli_smb2_close_fnum asyncVolker Lendecke2014-06-302-23/+92
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Align nt_time_to_unix_timespec with unix_timespec_to_nt_timeVolker Lendecke2014-06-301-3/+3
| | | | | | | Both take and return values now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: Make smb2cli_create return blobsVolker Lendecke2014-06-301-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd - fix processing of packets with invalid DOS charset conversions.Jeremy Allison2014-06-251-2/+2
| | | | | | | | | | | | | | | CVE-2014-3493 Bug 10654 - Segmentation fault in smbd_marshall_dir_entry()'s SMB_FIND_FILE_UNIX handler https://bugzilla.samba.org/show_bug.cgi?id=10654 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 25 03:47:55 CEST 2014 on sn-devel-104
* libsmb: Make cli_ntcreate cancellableVolker Lendecke2014-06-211-0/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_ntcreate1 cancellableVolker Lendecke2014-06-211-0/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_smb2_create_fnum cancellableVolker Lendecke2014-06-211-0/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>