summaryrefslogtreecommitdiff
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
* smbd: rename sconn->raw_thread_pool to sconn->poolRalph Boehme2019-01-115-10/+9
| | | | | | | | | | | | | | | This is basically a revert of commit 2be7518ae5a3c046f5fca04ecc83f9f7044eac74. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "smbd: introduce sconn->sync_thread_pool"Ralph Boehme2019-01-113-28/+1
| | | | | | | | | | | | | | This reverts commit 0c97226356f2ba5f01a58d361371055caf11e2a7. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "s3: vfs: add smb_vfs_ev_glue"Ralph Boehme2019-01-112-862/+0
| | | | | | | | | | | | | | This reverts commit 1251a536df4b1df58d9ddacab03d3ebe6f4e5b60. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "s3: vfs: add user_vfs_evg to connection_struct"Ralph Boehme2019-01-116-819/+29
| | | | | | | | | | | | | | This reverts commit 2dd95c1c38b9e1ce32d3d1081b6ec177910087a4. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "vfs_aio_pthread: use event context and threadpool from user_vfs_evg"Ralph Boehme2019-01-111-18/+22
| | | | | | | | | | | | | | This reverts commit cd37badc02b3e56f974168b28447444cd54ee541. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: pass (raw) ev to fetch_dos_mode_send instead of smb_vfs_ev_glueRalph Boehme2019-01-111-7/+4
| | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: pass (raw) ev to dos_mode_at_send() instead of smb_vfs_ev_glueRalph Boehme2019-01-113-5/+4
| | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: pass (raw) ev to SMB_VFS_GET_DOS_ATTRIBUTES_SEND() instead of ↵Ralph Boehme2019-01-117-67/+17
| | | | | | | | | | | smb_vfs_ev_glue This also removes smb_vfs_ev_glue_[push|pop]_use() as the only caller got removed. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: let SMB_VFS_GETXATTRAT_SEND() do explicit impersonationRalph Boehme2019-01-119-72/+176
| | | | | | | | | | SMB_VFS_GETXATTRAT_SEND() gets passed a raw event context and the default implementation uses that as well a raw threadpool. Impersonation is done explicitly instead of by the tevent and pthreadpool wrappers. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:torture: call per_thread_cwd_check() in vfstest.c main()Stefan Metzmacher2019-01-111-0/+2
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:smbd: prepare the usage of per_thread_cwd_*() functionsStefan Metzmacher2019-01-112-0/+14
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:lib: add per_thread_cwd_{check,supported,disable,activate}() helper functionsStefan Metzmacher2019-01-113-0/+164
| | | | | | | | | Only Linux it's possible to have a per thread current working directory using unshare(CLONE_FS). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:lib: add root_unix_token()Ralph Boehme2019-01-112-0/+27
| | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* statvfs: rename linux_statvfs to posix_statvfsBjörn Jacke2019-01-111-2/+2
| | | | | | | | | | the statvfs call is posix standard and not Linux specific Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Björn Jacke <bjacke@samba.org> Autobuild-Date(master): Fri Jan 11 02:53:57 CET 2019 on sn-devel-144
* s3/smbd: fix utmp hostname logging on SolarisBjörn Jacke2019-01-101-1/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=2489 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* waf: check for utmpx struct member ut_hostBjörn Jacke2019-01-101-0/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=2489 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* statvfs: fix bsize and frsize mixupBjörn Jacke2019-01-101-2/+4
| | | | | | | | | | | | | | | | | the block size (the real one) is the "fundamental file system block size" and that is the frsize struct member in the statvfs struct. The bsize struct member of the statvfs struct is *different* from the same named one of the statfs struct. See also http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_statvfs.h.html BUG: https://bugzilla.samba.org/show_bug.cgi?id=11810 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Jan 10 09:40:06 CET 2019 on sn-devel-144
* Fix typos and ban the rams from sambatdb-1.3.17Swen Schillig2019-01-101-2/+2
| | | | | | Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* s3:libsmb: cli_smb2_list() can sometimes fail initially on a connectionTim Beale2019-01-101-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cli_smb2_list() appears to be a slightly unique SMB operation in that it specifies the max transaction size for the response buffer size. The Python bindings highlighted a problem where if cli_smb2_list() were one of the first operations performed on the SMBv2 connection, it would fail due to insufficient credits. Because the response buffer size is (potentially) so much larger, it requires more credits (128) compared with other SMB operations. When talking to a samba DC, the connection credits seem to start off at 1, then increase by 32 for every SMB reply we receive back from the server. After cli_full_connection(), the connection has 65 credits. The cli_smb2_create_fnum() in cli_smb2_list() adds another 32 credits, but this is still less than the 128 that smb2cli_query_directory() requires. This problem doesn't happen for smbclient because the cli_cm_open() API it uses ends up sending more messages, and so the connection has more credits. This patch changes cli_smb2_list(), so it requests a smaller response buffer size if it doesn't have enough credits available for the max transaction size. smb2cli_query_directory() is already in a loop, so it can span multiple SMB messages if for some reason the transaction size isn't big enough for the listings. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13736 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Jan 10 02:40:16 CET 2019 on sn-devel-144
* s3:utils:net: Print debug message about NetbiosJustin Stephenson2019-01-092-2/+10
| | | | | | | | | | | | | | | | | With a preceding patch, cli_connect_nb() will return NT_STATUS_NOT_SUPPORTED when 'disable netbios' is set in smb.conf. Print an informative error message to indicate Netbios is disabled if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Noel Power <nopower@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Wed Jan 9 22:38:21 CET 2019 on sn-devel-144
* s3:smbpasswd: Print debug message about NetbiosJustin Stephenson2019-01-091-4/+12
| | | | | | | | | | | | | | With a preceding patch, cli_connect_nb() will return NT_STATUS_NOT_SUPPORTED when 'disable netbios' is set in smb.conf. Print an informative error message to indicate Netbios is disabled if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Noel Power <nopower@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: Print debug message about NetbiosJustin Stephenson2019-01-092-0/+8
| | | | | | | | | | | | | | With a preceding patch, cli_connect_nb() will return NT_STATUS_NOT_SUPPORTED when 'disable netbios' is set in smb.conf. Print an informative error message to indicate Netbios is disabled if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Noel Power <nopower@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: Check disable_netbios in socket connectJustin Stephenson2019-01-091-0/+5
| | | | | | | | | If the disable_netbios option is set then return NT_STATUS_NOT_SUPPORTED for a port 139 connection in the low level socket connection code. Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Noel Power <nopower@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: Revert SMB Py bindings name back to libsmb_samba_internalTim Beale2019-01-092-6/+9
| | | | | | | | | | | | | | | | | | In order to make it clear that the APIs in these Python bindings are unstable and should not be used by external consumers, this patch changes the name of the Python bindings back to libsmb_samba_internal. To make the Python code that uses these bindings (i.e. samba-tool, etc) look a little cleaner, we can just change the module name as we import it, e.g. from samba.samba3 import libsmb_samba_internal as libsmb Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Jan 9 14:30:31 CET 2019 on sn-devel-144
* idmap: In _wbint_Sids2UnixIDs, pass back what we haveVolker Lendecke2019-01-081-0/+9
| | | | | | | | | | | SOME_UNMAPPED does not mean that nothing worthwhile is in here. We need to pass what we have. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jan 8 13:15:35 CET 2019 on sn-devel-144
* idmap_tdb: If one SID fails to map, try the restVolker Lendecke2019-01-081-1/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* selftest: Test sids-to-xids with one failing sidVolker Lendecke2019-01-081-0/+5
| | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* waf: fix tri-state of --with-sendfile-support being auto the defaultBjörn Jacke2019-01-081-8/+4
| | | | | | | | | | | | | | | --with-sendfile-support should be used automatically if it's found. Configure now also fails reliably for all platforms when sendfile was explicitly requested but failed to be detected. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9707 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jan 8 07:03:49 CET 2019 on sn-devel-144
* waf: fix waf errors with sendfail detection on SolarisBjörn Jacke2019-01-081-3/+4
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: net: Do not set NET_FLAGS_ANONYMOUS with -kJustin Stephenson2019-01-081-2/+8
| | | | | | | | | | | | This affects net rpc getsid and net rpc changetrustpw commands. This avoids an anonymous IPC connection being made when -k is used, this only affects net rpc getsid and net rpc changetrustpw commands. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13726 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* passdb: Use dom_sid_str_bufVolker Lendecke2019-01-081-33/+64
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Fix a typoVolker Lendecke2019-01-081-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbclient: Use dom_sid_str_bufVolker Lendecke2019-01-081-3/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbindd: Use dom_sid_str_bufVolker Lendecke2019-01-081-8/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* auth3: Use dom_sid_str_bufVolker Lendecke2019-01-081-3/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove StrnCpyVolker Lendecke2019-01-082-27/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use strlcpy instead of StrnCpyVolker Lendecke2019-01-081-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* nmbd: Use strlcpy instead of StrnCpyVolker Lendecke2019-01-081-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Use strlcpy instead of StrnCpyVolker Lendecke2019-01-081-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:pylibsmb: Add flags used by .list() to SMB Py bindingsTim Beale2019-01-071-0/+20
| | | | | | | | | | | | | These flags are exposed by the s4 code. Python code that calls .list() checks the returned attribs/mode for the directory listing, e.g. to work out whether something is a sub-directory: if item['attrib'] & libsmb.FILE_ATTRIBUTE_DIRECTORY... BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Rename 'credentials' param to match s4Tim Beale2019-01-071-1/+1
| | | | | | | | | | | s4 just calls it 'creds'. Renaming it will make it easier to convert existing SMB connections over to use the new bindings. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s3:pylibsmb: Rename libsmb_samba_internal Py bindings to libsmbTim Beale2019-01-072-5/+5
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Add .deltree() API to SMB py bindingsTim Beale2019-01-071-0/+95
| | | | | | | | | | | | | | | | | | | This basically re-uses the underlying functionality of existing APIs in order to support a .deltree() API, i.e. - we use the .list() functionality (i.e. do_listing()) to traverse every item in the given directory. - we then use either .unlink() (i.e. unlink_file()) or .rmdir() (i.e. remove_dir()) to delete the individual item. - sub-directories are handled recursively, by repeating the process. Note that the .deltree() API is currently only really used for testing (and deleting GPO files). So the recursion is never going to be excessive. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:pylibsmb: Minor refactor to py_cli_list() variablesTim Beale2019-01-071-5/+5
| | | | | | | | | | Add a define for the file attribute mask (we'll reuse it in a subsequent patch), and make the variable type explicit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: Avoid duplicated code by making cli_read_sink() publicTim Beale2019-01-073-10/+7
| | | | | | | | | | cli_read_sink() and pull_helper() were essentially identical. By making cli_read_sink() non-static, we can delete the latter. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Add .loadfile() API to SMB py bindingsTim Beale2019-01-071-0/+131
| | | | | | | | | | | | Add a .loadfile API to read a file's contents. This provides a convenient way to read a file and is consistent with the existing source4 API, which is used by things like the GPO python code and the ntacls backup. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Add .savefile() API to SMB py bindingsTim Beale2019-01-071-0/+89
| | | | | | | | | | | | | | | | | | This provides a simple API for writing a file's contents and makes the s3 API consistent with the s4 API. All the async APIs here support SMBv2 so we don't need to use the sync APIs at all. Note that we have the choice here of using either cli_write_send() or cli_push_send(). I chose the latter, because that's what smbclient uses. It also appears to handle writing a large file better (i.e. one that exceeds the max write size of the underlying connection). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Free async .list() memoryTim Beale2019-01-071-0/+3
| | | | | | | | | finfos was being allocated but never freed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:pylibsmb: Make s3 and s4 listings return the same dictTim Beale2019-01-071-3/+17
| | | | | | | | | | | | Make the python dictionary generated by the s3 .list() use the same keys as the current source4 dict. The reason for using the source4 dict is that other python code depends on these keys (e.g. ntacls.py), whereas the source3 API is currently unused. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Don't return '.'/'..' in .list()Tim Beale2019-01-071-0/+5
| | | | | | | | | | | The source4 .list() API wasn't doing this. This makes source3 and source4 have *almost* equivalent functionality, so we can start usign the source3 API in the tests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>