summaryrefslogtreecommitdiffstats
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
...
* s3-kerberos: remove print_kdc_line() completely.Günther Deschner2014-03-071-68/+5
| | | | | | | | | | | | | | | | Just calling print_canonical_sockaddr() is sufficient, as it already deals with ipv6 as well. The port handling, which was only done for IPv6 (not IPv4), is removed as well. It was pointless because it always derived the port number from the provided address which was either a SMB (usually port 445) or LDAP connection. No KDC will ever run on port 389 or 445 on a Windows/Samba DC. Finally, the kerberos libraries that we support and build with, can deal with ipv6 addresses in krb5.conf, so we no longer put the (unnecessary) burden of resolving the DC name on the kerberos library anymore. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:smb2_server: avoid talloc_zero_array() in smbd_smb2_request_setup_out()Stefan Metzmacher2014-03-062-4/+12
| | | | | | | | | | | In the common case with just one request, we can use a preallocated req->out.vector. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Mar 6 00:59:29 CET 2014 on sn-devel-104
* s3:smb2_server: don't assume that req->out.vector is always a valid talloc ↵Stefan Metzmacher2014-03-051-4/+4
| | | | | | | | | pointer We use 'req' instead as it has the same lifetime. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: avoid talloc_zero_array() in smbd_smb2_request_error_ex()Stefan Metzmacher2014-03-051-6/+2
| | | | | | | | | It is only important that the content of info->data stays alive for the lifetime of the request, but the DATA_BLOB structure itself can be on the stack, while passing it as 'dyn' to smbd_smb2_request_done_ex(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: optimize smbd_smb2_generate_outbody() for the common caseStefan Metzmacher2014-03-052-0/+7
| | | | | | | Use a preallocated buffer for the first response in the compound chain. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_write: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_tcon: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_setinfo: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_sesssetup: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_read: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_notify: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_negprot: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_lock: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_keepalive: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_ioctl: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_getinfo: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_flush: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_find: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_create: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_close: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_break: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: add smbd_smb2_generate_outbody() helperStefan Metzmacher2014-03-052-0/+7
| | | | | | | We can add optimization there later. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_read: avoid 2 talloc* calls when using sendfile()Stefan Metzmacher2014-03-052-15/+29
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: avoid a call to data_blob_clear_free() if not neededStefan Metzmacher2014-03-051-6/+18
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: optimize smbd_smb2_request_setup_out()Stefan Metzmacher2014-03-052-6/+10
| | | | | | | | | | We can use a preallocated buffer for the possible error response of the first response in the compound chain. This avoids a talloc_array_zero() call for the common case. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: optimize req->in.vector allocationStefan Metzmacher2014-03-052-13/+31
| | | | | | | | | We can avoid a talloc_zero_array() call in the common case (without compound requests) and use a preallocated array instead. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: s/BUFFER_SIZE/LARGE_WRITEX_BUFFER_SIZEStefan Metzmacher2014-03-052-4/+2
| | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Mar 5 22:53:34 CET 2014 on sn-devel-104
* s3:smbd: fix the maxentries calculation depending on the max_send.Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: simplify maxentries calculation in reply_search()Stefan Metzmacher2014-03-051-5/+4
| | | | | | | Using helper variables make it much easier to understand. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: fix the read numtoread calculation depending on the max_send.Stefan Metzmacher2014-03-051-9/+9
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: fix the lockread numtoread calculation depending on the max_send.Stefan Metzmacher2014-03-051-9/+9
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.Stefan Metzmacher2014-03-051-4/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: fix lockread numtoread calculation to match reply_outbuf() arguments.Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: take less than SMB_BUFFER_SIZE_MIN ('500') as header overhead in ipc.cStefan Metzmacher2014-03-051-4/+6
| | | | | | | | | | | | | We're now sure that sconn->smb1.sessions.max_send is >= SMB_BUFFER_SIZE_MIN. in order to garantee some progress we need to make sure our assumed header overhead is less than SMB_BUFFER_SIZE_MIN. Assuming 372 bytes for the SMBtrans headers should still be more than enough. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: reject a MaxBufferSize < SMB_BUFFER_SIZE_MIN (500) in a session ↵Stefan Metzmacher2014-03-051-6/+13
| | | | | | | | | | setup request This makes sure sconn->smb1.sessions.max_send is always >= SMB_BUFFER_SIZE_MIN. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: use sconn->smb1.sessions.max_send = SMB_BUFFER_SIZE_MAXStefan Metzmacher2014-03-051-1/+1
| | | | | | | | | SMB_BUFFER_SIZE_MAX is UINT16_MAX and the largest value a client can possibly specify in the session setup request. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: use SMB_BUFFER_SIZE_MIN/MAX to limit lp_max_xmit()Stefan Metzmacher2014-03-051-1/+6
| | | | | | | | | | | | | The current limit of 128*1024 causes problems as the value has to be <= UINT16_MAX otherwise some clients get confused, as they want to use the MaxBufferSize value from the negprot response (uint32_t) for the MaxBufferSize value in thet session setup request (uint16_t). E.g. Windows 7 (as client) sends MaxBufferSize = 0 if the server value is > UINT16_MAX. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:include: let CLI_BUFFER_SIZE be an alias of SMB_BUFFER_SIZE_MAXStefan Metzmacher2014-03-051-1/+1
| | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:param: avoid using BUFFER_SIZE to limit the lp_min_receive_file_size()Stefan Metzmacher2014-03-051-1/+1
| | | | | | | There's really no reason to add such limit. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:client: only limit the buffer by the given length 'n'Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:torture: use CLI_BUFFER_SIZE instead of BUFFER_SIZEStefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:utils/smbfilter: use a local variable for the packet bufferStefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* nsswitch: Remove fallback setting of WINBINDD_SOCKET_DIRAndrew Bartlett2014-03-051-0/+1
| | | | | | | | | | | | | | This is the original cause of the wbc NT_STATUS_OBJECT_NAME_NOT_FOUND issues in recent git master, as the build was able to progress without the correct path being set as an override. Andrew Bartlett Change-Id: I1dbc7350695756356e869199b589eb781eb5c673 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Mar 5 18:34:48 CET 2014 on sn-devel-104
* Remove all uses of the NT_STATUS_NOT_OK_RETURN_AND_FREE macro from the codebase.Garming Sam2014-03-051-2/+8
| | | | | | | | | | Following the current coding guidelines, it is considered bad practice to return from within a macro and change control flow as they look like normal function calls. Change-Id: I421e169275fe323e2b019c6cc5d386289aec07f7 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* Remove a number of NT_STATUS_HAVE_NO_MEMORY_AND_FREE macros from the codebase.Garming Sam2014-03-052-17/+68
| | | | | | | | | | | Following the current coding guidelines, it is considered bad practice to return from within a macro and change control flow as they look like normal function calls. Change-Id: I133eb5a699757ae57b87d3bd3ebbcf5b556b0268 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* rpc_server: change unsupported pipe errorDavid Disseldorp2014-03-051-3/+2
| | | | | | | | | | | | | | | smbd currently prints the following level 0 error when a client attempts to connect to an unsupported named pipe (e.g. browser): ERROR! 'browser' is not a registred pipe This change reduces the severity of the error (0->2) and fixes a couple of typos. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Wed Mar 5 16:31:42 CET 2014 on sn-devel-104
* rpc_client: retry open on STATUS_PIPE_NOT_AVAILABLEDavid Disseldorp2014-03-041-17/+68
| | | | | | | | | | | | | | Windows Server starts some named pipe services on demand, and responds to initial open requests with STATUS_PIPE_NOT_AVAILABLE. The FssagentRpc named pipe on Windows Server 2012 exhibits this behaviour. This change sees rpcclient retry named pipe open requests when the server responds with STATUS_PIPE_NOT_AVAILABLE. The retry logic is contained in an asynchronous tevent_timer callback, to allow for non-blocking callers. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd - smb1 - fix read of deleted memory in reply_writeclose().Noel Power2014-03-031-11/+13
| | | | | | | | | | | | | While running smbtorture test raw.write under valgrind an "Invalid read" was reported in methid reply_writeclose, it seems after closing a file sometime later we try to access it again. Signed-off-by: Noel Power <noel.power@suse.com> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Mar 3 20:42:40 CET 2014 on sn-devel-104
* smbd: Fix an uninitialized memory readVolker Lendecke2014-03-031-0/+2
| | | | | | | | | | This might be the reason for a few flaky builds. 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): Mon Mar 3 16:30:53 CET 2014 on sn-devel-104
* pthreadpool: Add test for fork crashVolker Lendecke2014-03-031-0/+48
| | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Simo Sorce <simo@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>