summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* source3 smbd: tests for null pointer dereferenceGary Lockyer2017-04-283-0/+64
| | | | | | | | | Test case to replicate null pointer dereference in smbd, introduced in the auth logging changes. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: inotify_map_mask_to_filter incorrectly indexes an array.Doug Nazar2017-04-281-1/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12760 Signed-off-by: Doug Nazar <nazard@nazar.ca> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* tdb: version 1.3.13tdb-1.3.13Stefan Metzmacher2017-04-272-1/+71
| | | | | | | | | | | | | | | * documentation for the tdbbackup -n option * correctly upgrade F_RDLCK to F_WRLCK locks * tdbtool: Add "storehex" command * fix robust mutex detection in threaded applications (bug #12593) * improve debugging of transaction lock failures Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Apr 27 18:50:10 CEST 2017 on sn-devel-144
* tdb: Improve debugging in _tdb_transaction_startAndrew Bartlett2017-04-271-0/+4
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tdb: Improve debugging when the allrecord lock fails to upgradeAndrew Bartlett2017-04-272-1/+6
| | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tdb: runtime check for robust mutexes may hang in threaded programsRalph Boehme2017-04-271-46/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current runtime check for robust mutexes in tdb_runtime_check_for_robust_mutexes() is not thread-safe. When called in a multi-threaded program where any another thread doesn't have SIGCHLD blocked, we may end up hung in sigsuspend() waiting for a SIGCHLD of a child procecss and the signal was delivered to another thread. Revert to the previous behaviour of waiting for the child instead of waiting for the SIGCHLD signal. Ensure the pid we wait for is not reset to -1 in a toctou race with the signal handler. Check whether waitpid() returns ECHILD which can happen if the signal handler is run by more then one thread in parallel (yes, this can happen) or if tdb_robust_mutex_wait_for_child() and the signal handler are racing. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12593 Pair-programmed-with: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* notify: Fix ordering of events in notifydShilpa Krishnareddy2017-04-261-1/+2
| | | | | | | | | | | | | | | | In notifyd_trigger_parser() while initializing notify_event_msg values from notify_trigger_msg, 'when' value is ignored. So the smbd process does not get correct 'when' value and this is causing issues during qsort in notify_marshall_changes(). Because of this issue, smb2.notify.dir test was failing. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12756 Signed-off-by: Shilpa Krishnareddy <skrishnareddy@panzura.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Apr 26 17:02:58 CEST 2017 on sn-devel-144
* s4-messaging: Add helpful commentsAndrew Bartlett2017-04-261-0/+7
| | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Apr 26 03:09:19 CEST 2017 on sn-devel-144
* process_standard: clean up messaging for children after exit()Andrew Bartlett2017-04-252-1/+4
| | | | | | | | This makes sure we remove any messaging sockets if a child dies or calls exit() without running the talloc destructor for messaging Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib: Fix CID 1405493 Error handling issues (CHECKED_RETURN)Volker Lendecke2017-04-251-1/+6
| | | | | | | | 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): Tue Apr 25 23:07:25 CEST 2017 on sn-devel-144
* lib/util: fix a Coverity finding in tforkRalph Boehme2017-04-251-5/+18
| | | | | | | If dup2() fails, fd is -1 and is later used in sys_write(). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-libgpo: Fix the build of the group policy CSEsGünther Deschner2017-04-243-3/+3
| | | | | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Apr 24 23:19:44 CEST 2017 on sn-devel-144
* tdbtool: Add "storehex" commandVolker Lendecke2017-04-222-0/+97
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 22 09:16:16 CEST 2017 on sn-devel-144
* secrets: Protect against a non-0-terminated ldap passwordVolker Lendecke2017-04-221-0/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* vfs_fruit: lp_case_sensitive() does not return a boolRalph Boehme2017-04-222-5/+19
| | | | | | | | | | | | | | | | | | | lp_case_sensitive() returns an int, not a bool, so with the default setting of "Auto" by default we set the AAPL flag SMB2_CRTCTX_AAPL_CASE_SENSITIVE. This caused the client to believe the volume is case sensitive where it wasn't, leading to an error when trying to rename files changing only the case of the name. Also fix the existing torture test that verifies AAPL context negotiation and actually expected the server to return "case sensitive", while the Samba default is really "case insensitive". Bug: https://bugzilla.samba.org/show_bug.cgi?id=12749 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* selftest: Do not enable inbound replication during replica_syncAndrew Bartlett2017-04-221-51/+0
| | | | | | | | | | | | | | Instead we should use the forced=True to only do a very specific replication, and so avoid noise from any other DC also live on the network. This extra replication in turn causes (and this patch fixes) flapping replica_sync tests. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12753 Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Apr 22 05:19:11 CEST 2017 on sn-devel-144
* lib: modules: Change XXX_init interface from XXX_init(void) to ↵Jeremy Allison2017-04-22205-335/+373
| | | | | | | | | | | | | | | | | | | | XXX_init(TALLOC_CTX *) Not currently used - no logic changes inside. This will make it possible to pass down a long-lived talloc context from the loading function for modules to use instead of having them internally all use talloc_autofree_context() which is a hidden global. Updated all known module interface numbers, and added a WHATSNEW. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144
* pyrpc: Fix segfault in ClientConnectionGary Lockyer2017-04-212-0/+26
| | | | | | | | | | | | | Fix segfault when connecting over TCP, the endpoints list in dummy_table was not initialised this caused a segfault when attempting to connect over TCP. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Apr 21 16:10:12 CEST 2017 on sn-devel-144
* vfs_acl_xattr|tdb: ensure create mask is at least 0666 if ignore_system_acls ↵Ralph Boehme2017-04-202-6/+42
| | | | | | | | | | | | is set Bug: https://bugzilla.samba.org/show_bug.cgi?id=12562 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Apr 20 20:50:10 CEST 2017 on sn-devel-144
* cleanupdb: Fix a memory read errorHanno Böck2017-04-201-1/+1
| | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=12748 Signed-off-by: Hanno Böck <hanno@hboeck.de> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* lib/util: add a test for samba_runcmd_send()Ralph Boehme2017-04-202-0/+51
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* wafsamba: add source directory define SRCDIR to config.hRalph Boehme2017-04-201-0/+2
| | | | | | | | This will be used in the next commit to prepare the path to a test script in a smbtorture test. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/util: make use of tfork in samba_runcmd_send()Ralph Boehme2017-04-202-48/+58
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/util: add a test for tfork()Ralph Boehme2017-04-203-0/+104
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib/util: add tfork()Stefan Metzmacher2017-04-203-2/+380
| | | | | | | | | | | | | | | triple-fork to avoid handling SIGCHLD in the parent. This function is a workaround for the problem of using fork() in library code. In that case the library should avoid setting a global signal handler for SIGCHLD, because the application may wants to use its own handler. status_fd can be used to wait for the child to exit and get its exit status. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbldap: Bump version numberVolker Lendecke2017-04-202-1/+32
| | | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Apr 20 14:23:14 CEST 2017 on sn-devel-144
* smbldap: Privatize struct smbldap_stateVolker Lendecke2017-04-202-24/+27
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* smbldap: Introduce "smbldap_get_paged_results"Volker Lendecke2017-04-203-1/+9
| | | | | | | | | This should be hidden inside smbldap.c, but this is a quick way to get smbldap_state private to smbldap.c Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* smbldap: Introduce "smbldap_get_paged_results"Volker Lendecke2017-04-203-3/+9
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* smbldap: Introduce "smbldap_get_ldap"Volker Lendecke2017-04-207-211/+343
| | | | | | | | | | This is a pretty big boiler-plate change. I've renamed the struct member temporarily to find all accessors. Not sure where this leads in the end, but the goal is to make struct smbldap_struct private to smbldap.c Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* smbldap: Fix a typoVolker Lendecke2017-04-201-1/+1
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* autobuild: Do not require cmocka to be installed for samba-libs to buildAndrew Bartlett2017-04-191-1/+1
| | | | | | | | | | cmocka does not have an install target, but is a depencency of ldb for the tests Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Apr 19 19:43:15 CEST 2017 on sn-devel-144
* ldb:tests: Unit test the ldb_rename() operationJakub Hrozek2017-04-191-38/+256
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb:tests: Add tests for case insensitive searchesJakub Hrozek2017-04-191-0/+114
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb:tests: unit test for ldb_search()Jakub Hrozek2017-04-191-13/+380
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb:tests: Add a modify testJakub Hrozek2017-04-191-0/+423
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb:tests: Add a test for ldb transactionsJakub Hrozek2017-04-191-0/+80
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb:tests: Add a basic delete testJakub Hrozek2017-04-191-13/+121
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb:tests: Add a basic search testJakub Hrozek2017-04-191-0/+72
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb:tests: A rudimentary ldb_add() testJakub Hrozek2017-04-191-0/+51
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb:tests: Build a ldb test for the tdb backendAndreas Schneider2017-04-191-1/+24
| | | | | | | Pair-Programmed-With: Andrew Bartlet <abartlet@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Andrew Bartlet <abartlet@samba.org>
* ldb:tests: Add a simple cmocka test for ldb_connect()Jakub Hrozek2017-04-191-0/+107
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb: Clarify LDB_MODULES_PATH is usedJakub Hrozek2017-04-191-0/+4
| | | | | | | | Make it (hopefully more) clear where modules are loaded from. Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb_tdb: Remove unused function parameterJakub Hrozek2017-04-191-4/+3
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb_tdb: Remove unused function parameterJakub Hrozek2017-04-191-4/+3
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* ldb_tdb: Remove unused function ltdb_add_attr_resultsJakub Hrozek2017-04-192-140/+0
| | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* s3-tests: assignement in shell shall have no spaces around equal signAlexander Bokovoy2017-04-191-3/+3
| | | | | | | | | | When assigning value to 'failed', no spaces should be around '=' sign. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Apr 19 02:53:25 CEST 2017 on sn-devel-144
* _netr_ServerPasswordSet2: use info level 26 to set plain text machine passwordAlexander Bokovoy2017-04-181-15/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support password change for machine or trusted domain accounts in Active Directory environment we need to pass down actual plain text password instead of NT hashes. This would allow a backend like ipasam to update Kerberos keys as well as NT hashes. By calling samr_SetUserInfo2 info level 26 we ensure PASSDB layer can actually get the plain text password. If PASSDB backend implements pdb_update_sam_account() callback, it then gets the plain text password from samr_SetUserInfo2. A plain text password is a data blob represented as up to 256 WCHARs. It is UTF-16 coded on wire and we have its length from the buffer. SetUserInfo2 SAMR call chain in decode_pw_buffer() does explicitly expect 512+4 bytes in the buffer. It then calls convert_string_talloc() to convert it to UNIX charset passing the correct value of the plaintext password length. However, convert_string_talloc() expects the length of input string *including* the terminating null and we pass just the string length. convert_string_talloc() then explicitly null-terminates the resulting string by adding two nulls. In most cases UNIX charset is UTF-8, so we get null-terminated UTF-8 string down to PASSDB layer. MS-SAMR does not limit what does the password should contain. It says it is 'userPassword' value. Either 'userPassword' or 'unicodePwd' cannot contain null characters according to MS-ADTS 3.1.1.3.1.5 because they must be proper UTF-8 and UTF-16 strings accordingly. We are talking to our own SAMR service here. Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: also run smb2.compound_find against share with async delay setRalph Boehme2017-04-182-0/+8
| | | | | | | | | Add a share with "smbd:find async delay usec" set to 10000 and run the test smb2.compound_find added in the previous commit against this new share as well. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4/torture: add a test for compound SMB2 FIND requestsRalph Boehme2017-04-182-0/+124
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>