summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* param: remove string_init and inline it into string_setGarming Sam2014-05-071-26/+12
| | | | | | | | | | | | In making this change, the special case has been removed for empty strings. The use of empty strings causes various issues with trying to mix s4 and s3 code. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-on: https://gerrit.samba.org/156 Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:loadparm: change memory allocations to use tallocGarming Sam2014-05-071-161/+202
| | | | | | | | | (talloc memory paternity fix to handle_debug_list() and lp_parm_const_string_service() added by abartlet) Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: remove unnecessary temporary service in handle copyGarming Sam2014-05-071-8/+3
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging: Nobody uses G_LOCK_RETRY anymoreVolker Lendecke2014-05-062-10/+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): Tue May 6 23:01:22 CEST 2014 on sn-devel-104
* build: find blkcnt_t size via arrayGustavo Zacarias2014-05-061-10/+12
| | | | | | | | | | | | | Using the same trick as commit 0d9bb86293c9d39298786df095c73a6251b08b7e find blkcnt_t size via an array so that it can be determined via build rather than running it. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Tue May 6 20:37:16 CEST 2014 on sn-devel-104
* build: tweak SIZEOF utmp->ut_lineGustavo Zacarias2014-05-061-1/+1
| | | | | | | | | | | Set the critical parameter of CHECK_SIZEOF utmp->ut_line to False since it's used to find out if utmp support should be enabled. This is necessary with the introduction of the cross-compile aware CHECK_SIZEOF. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* build: make wafsamba CHECK_SIZEOF cross-compile friendlyGustavo Zacarias2014-05-061-12/+16
| | | | | | | | | | | | | | | Use the same trick as commit 0d9bb86293c9d39298786df095c73a6251b08b7e We do the same array trick iteratively starting from 1 (byte) by powers of 2 up to 32. The new 'critical' option is used to make the invocation die or not according to each test. The default is True since normally it's expected to find a proper result and should error out if not. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* build: unify and fix endian testsGustavo Zacarias2014-05-062-58/+62
| | | | | | | | | | | | | Unify the endian tests out of lib/ccan/wscript into wafsamba since they're almost cross-compile friendly. While at it fix them to be so by moving the preprocessor directives out of main scope since that will fail. And keep the WORDS_BIGENDIAN, HAVE_LITTLE_ENDIAN and HAVE_BIG_ENDIAN defines separate because of different codebases. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* byteorder: do not assume PowerPC is big-endianDavid Disseldorp2014-05-061-4/+6
| | | | | | | | | | | byteorder.h currently uses reverse-indexing ASM instructions for little endian multi-byte storage/retrieval on PowerPC. With Power8 this is an incorrect assumption, as it can be big or little endian. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10590 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* dsdb: Do not permit nested event loops when in a transaction, use a nested ↵Andrew Bartlett2014-05-061-13/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | event context It is never safe to execute arbitary code inside a transaction - we need to get in and get out, not run other events for the rest of the server. This patch avoids that by creating a private event loop during transactions, so no unexpected operations fire, and returning the original one when we finish it. If an event fires during an LDB transaction, an unrelated operation can occur during the transaction, and if the transaction were to be cancelled, there would be a silent rollback (despite the client having been indicated success). Additionally, other processes could be called via IRPC that need to operate on the database but are locked out due to the ongoing transaction. Andrew Bartlett BUG: https://bugzilla.samba.org/show_bug.cgi?id=10582 Change-Id: I22322fc006e61d7291da17cdf6431416ebb7b30f 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): Tue May 6 13:36:20 CEST 2014 on sn-devel-104
* dsdb: Rename private_data to rootdse_private_data in rootdseAndrew Bartlett2014-05-061-8/+8
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10582 Change-Id: I349a2be67333ada86c19cd6d2ed283cd5bbeb2aa Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Minor typo fix in source3/wscript.Jose A. Rivera2014-05-051-1/+1
| | | | | | | | | Signed-off-by: Jose A. Rivera <jarrpa@redhat.com> 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): Mon May 5 22:41:19 CEST 2014 on sn-devel-104
* Fix an empty if statement.Jose A. Rivera2014-05-051-1/+1
| | | | | | | | | | Primarily following the precedent set by other uses of composite_is_ok(), but also making sure nothing tries to use c after this point if it is in fact not ok. Signed-off-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ctdb-daemon: Move a ZERO_STRUCT() to a better placeMartin Schwenke2014-05-051-3/+12
| | | | | | | | | | | | | | It might as well be near where it is used. Add a comment explaining it. Also add/update comments at the top of the RELEASE_IP and TAKEOVER_IP loops to explain what is happening. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon May 5 06:20:39 CEST 2014 on sn-devel-104
* ctdb-eventscripts: Add check for invalid policy routing configurationMartin Schwenke2014-05-053-0/+33
| | | | | | | | | | | | | The range CTDB_PER_IP_ROUTING_TABLE_ID_LOW..CTDB_PER_IP_ROUTING_TABLE_ID_HIGH should not include 253-255. Otherwise policy routing may overwrite the default system routing tables. Add some corresponding tests. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-eventscripts: Update comment in 11.routingMartin Schwenke2014-05-051-8/+13
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-eventscripts: Don't check if $iface is emptyMartin Schwenke2014-05-051-13/+15
| | | | | | | | | | | | | This is the loop variable. It can't be empty, especially given the way the list is built. This must have survived from an earlier version of the script. Given that there are whitespace changes associated with the above, clean-up the "virtio_net" avoidance check so that it reads less like line-noise. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* poll_funcs: Fix a comment typoVolker Lendecke2014-05-041-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Sun May 4 22:19:53 CEST 2014 on sn-devel-104
* ldb: make the successful ldb_transaction_start() message clearerAndrew Bartlett2014-05-031-4/+8
| | | | | | | | | | | Change-Id: I00d0705484c3b53f55c4a8ec2953e92329b7408e Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat May 3 10:20:52 CEST 2014 on sn-devel-104
* s3:passdb: improve a debug message in pdb_default_sid_to_id()Michael Adam2014-05-031-1/+4
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:passdb: fix and improve debug message in pdb_default_sid_to_id().Michael Adam2014-05-031-1/+2
| | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:samr: allow builtin groups for samr_OpenGroup.Michael Adam2014-05-031-7/+16
| | | | | | | This fixes nsswitch getgrgid for builtins. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add tests for dbcheck detection and removal of partial objectsAndrew Bartlett2014-05-0334-3/+80719
| | | | | | | | | | | To avoid listing all the provision snapshots, we use a broader blacklist for waf dist and a whitelist for dbcheck-oldrelease.sh Andrew Bartlett Change-Id: Iab0ff4be0b4287dc128a49302836a6f0f7b39678 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb: Make it harder to corrupt the database by requiring DBCHECK or RELAX ↵Andrew Bartlett2014-05-032-10/+32
| | | | | | | | | | | | | | | for final object deletion This kind of deletion can cause us to then replicate back a partial object. We allow dbcheck to directly remove totally corrupt objects (missing an objectclass) by specifying both DBCHECK and RELAX, and the tombstone sweep after 180 days is done with the RELAX control. Andrew Bartlett Change-Id: Ic21f68e507ba9b65e035ca568430e35e2d001c7d Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: Always cache idmapping results of pdb backend.Alexander Werth2014-05-032-17/+33
| | | | | | | | | | | And don't cache in the pdb_ldap module on the id_to_sid calls. Signed-off-by: Alexander Werth <alexander.werth@de.ibm.com> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Sat May 3 04:14:05 CEST 2014 on sn-devel-104
* waf: fetch and use some exit codes of called processesBjörn Baumbach2014-05-031-5/+15
| | | | | | | | | Without this patch for example "make ctags" reports "Success", also if ctags fails or is not available. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* samba-tool ldapcmp: fix a typoBjörn Baumbach2014-05-031-2/+2
| | | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3: smbd: Remove open_file_fchmod().Jeremy Allison2014-05-022-36/+0
| | | | | | | | | | | | | | No longer used (hurrah!). Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri May 2 23:47:38 CEST 2014 on sn-devel-104
* s3: smbd: change file_set_dosmode() to use get_file_handle_for_metadata() ↵Jeremy Allison2014-05-021-12/+92
| | | | | | | | | | | | | | | | | | instead of open_file_fchmod(). get_file_handle_for_metadata() is a new function that finds an existing open handle (fsp->fh->fd != -1) for a given dev/ino if there is one available, and uses INTERNAL_OPEN_ONLY with WRITE_DATA access if not. Allows open_file_fchmod() to be removed next. Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org>
* s3: smbd : Ensure file_new doesn't call into smbXsrv_open_create() for ↵Jeremy Allison2014-05-022-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | INTERNAL_OPEN_ONLY. This causes deadlocks which cause smbd to crash if the locking database has already been locked for a compound operation we need to be atomic (as in the file rename case). Ensure INTERNAL_OPEN_ONLY opens are synonymous with req==NULL. INTERNAL_OPEN_ONLY opens leave a NO_OPLOCK record in the share mode database, so they can be detected by other processes for share mode violation purposes (because they're doing an operation on the file that may include reads or writes they need to have real state inside the locking database) but have an fnum of FNUM_FIELD_INVALID and a local share_file_id of zero, as they will never be seen on the wire. Ensure validate_my_share_entries() ignores INTERNAL_OPEN_ONLY records (share_file_id == 0). Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org>
* s3 : smbd : Protect all possible code paths from fsp->op == NULL.Jeremy Allison2014-05-025-2/+41
| | | | | | | | | | | | | In changes to come this will be possible for an INTERNAL_OPEN_ONLY. The protection was already in place for some code paths, this makes the coverage compete. Bug 10564 - Lock order violation and file lost https://bugzilla.samba.org/show_bug.cgi?id=10564 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Fix compile warning in dmapi.cChristof Schmitt2014-05-021-1/+1
| | | | | | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Change-Id: I69297d91ab8c857204e1f78cafb210b9a05f3b77 Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri May 2 03:41:31 CEST 2014 on sn-devel-104
* dbcheck: Directly call dn.get_rdn_{val,name}() for clarity and consistencyAndrew Bartlett2014-05-021-18/+13
| | | | | | | | | | | | When looking for incorrect name values, this improves the previous code by avoiding one more manual parse step, and uses less cryptic variable names. Andrew Bartlett Change-Id: Iff8e571a6359a67bf173f729dc12b8787292b3cb Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* s4:repl_meta_data: fix array assignment in replmd_process_linked_attribute()Stefan Metzmacher2014-05-021-2/+2
| | | | | | Change-Id: I10357236108f68ab749ba0e1f07558302c573887 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dbchecker: verify and fix broken dn valuesStefan Metzmacher2014-05-021-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | With older Samba versions (4.0.x) the following could happen: - On account was created on DC1 - It was replicated to DC2 - The connection between the dcs is offline - The account gets modified on DC2 - The account gets deleted on DC1 - The connection becomes online again - DC1 replicates the modification from DC2, this resets the dn to the original value. 'name' and 'cn' are correct (with '\nDEL${GUID}'), but 'dn' is wrong. - DC2 replicates the deletion from DC1. this doesn't include a changed dn as DC1 had a bug. 'name' is correct (with '\nDEL${GUID}'), but 'cn' and 'dn' are wrong. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10536 Change-Id: Ia70a6c12e0ff0d4c2c8100cb1d8f3c6422b65591 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dbchecker: make the deleted objects container detection more genericStefan Metzmacher2014-05-021-2/+8
| | | | | | Change-Id: I282ad887c41412e25fdf73476e405f4e88e0b239 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb: change version to 1.1.17Stefan Metzmacher2014-05-023-1/+265
| | | | | | | | This adds some pyldb methods for ldb.Dn. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb:pyldb: add some more helper functions for LdbDnStefan Metzmacher2014-05-021-0/+112
| | | | | | | | This adds [g|s]et_component[|_name|_value]() and get_rdn_[name|value](). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb:pyldb: fix doc string for set_extended_component()Stefan Metzmacher2014-05-021-1/+1
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ldb:pyldb: add some const to PyObject_FromLdbValue()Stefan Metzmacher2014-05-021-1/+1
| | | | | | | | PyString_FromStringAndSize() makes a copy of the value... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* ctdb: Fix a comment typoVolker Lendecke2014-04-301-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): Wed Apr 30 21:05:09 CEST 2014 on sn-devel-104
* torture3: Add a test deleting a different reqVolker Lendecke2014-04-304-0/+106
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Apr 30 17:09:59 CEST 2014 on sn-devel-104
* torture3: Add local-messaging-read1Volker Lendecke2014-04-305-0/+148
| | | | | | | This covers deleting and re-adding a request in a callback Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Fix messaging_read_send/recvVolker Lendecke2014-04-302-16/+77
| | | | | | | | | | | | | | | | | | | | | | | | | messaging_read_send/recv was okay for just one handler in the queue. For multiple handlers it was pretty broken. A handler that deletes itself as part of the callback (pretty typical use case...) drops the message for a subsequent handler that responds to the same message type. In messaging_dispatch_rec we walk the array, however messaging_read_cleanup has already changed the array. tevent_req_defer_callback does not help here: It only defers the callback, it does not defer the cleanup function. This also happens when a callback deletes a different handler A handler that re-installs itself in the callback might get a message twice. This patch changes the code such that only messaging_dispatch_rec adds records to msg_ctx->waiters, new waiters are put into a staging area first (msg_ctx->new_waiters). Also messaging_read_cleanup does not move anything around in msg_ctx->waiters, it only nulls out itself. messaging_dispatch_rec is changed to cope with this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Make "presult" optional in messaging_read_recvVolker Lendecke2014-04-301-1/+3
| | | | | | | | Callers might not be interested in the rec, just the fact that something arrived Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* torture3: Add a bit more coverage to messaging_readVolker Lendecke2014-04-301-0/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging3: Fix formattingVolker Lendecke2014-04-301-1/+2
| | | | | | | This went over the 80-char limit Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd : Fix wildcard unlink to fail if we get an error rather than trying ↵Jeremy Allison2014-04-301-1/+2
| | | | | | | | | | to continue. This can break smbd if we end up leaving a SHARING_VIOLATION retry record on the queue. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* winbind: Allow winbindd to be run from inside "samba"Andrew Bartlett2014-04-293-1/+104
| | | | | | | | | Change-Id: I6b90a9b62ba5821e0feedb23cd20642078ba0ca6 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Apr 29 05:28:39 CEST 2014 on sn-devel-104
* kerberos: Remove un-used event context argument from smb_krb5_init_context()Andrew Bartlett2014-04-2812-25/+6
| | | | | | | | | | | | | | | | | The event context here was only specified in the server or admin-tool context, which does not do network communication, so this only caused a talloc_reference() and never any useful result. The actual network communication code sets an event context directly before making the network call. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Apr 28 02:24:57 CEST 2014 on sn-devel-104