summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* dsdb: Specify no event context to smb_krb5_init_context() in dsdbAndrew Bartlett2014-04-283-4/+6
| | | | | | | | | | These routines parse principals and generate keys only, no network communication is done. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* autorid: Add allocation from above in alloc range for well known sidsMichael Adam2014-04-251-0/+86
| | | | | | | | | | | This way, we achieve a better determinism for the id mappings of the well knowns without wasting a separate range. 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): Fri Apr 25 17:52:10 CEST 2014 on sn-devel-104
* autorid: use dbwrap_trans_do() in idmap_autorid_sid_to_id_alloc()Michael Adam2014-04-251-22/+26
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: add high_id to range config and fill it where we also fill ↵Michael Adam2014-04-252-0/+3
| | | | | | | | | | range->low_id. This corresponds to low_id for convenience and allows for computations without going back to the global config. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: reserve 500 IDs at the top of the ALLOC range.Michael Adam2014-04-251-1/+4
| | | | | | | The wellknowns are now allocated into this sub-range. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: reverse order of arguments of idmap_autorid_sid_to_id_alloc()Michael Adam2014-04-251-4/+5
| | | | | | | for consistency Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: introduce idmap_autorid_domsid_is_for_alloc()Michael Adam2014-04-251-2/+14
| | | | | | | | | Currently, this checks if the sid is a wellknown domain sid. But the code reads more nicely and more domains might be added in the future. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: factor idmap_autorid_sid_to_id() out of idmap_autorid_sids_to_unixids()Michael Adam2014-04-251-95/+76
| | | | | | | | | - reduces indentation - unifies error code paths and bumping counters - makes the code more easy to read Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: make the checks for bumping num_mapped identical for alloc and rid caseMichael Adam2014-04-251-2/+2
| | | | | | | in idmap_autorid_sids_to_unixids() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: explicitly return NTSTATUS_OK in idmap_autorid_sid_to_id_alloc().Michael Adam2014-04-251-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: more explicitly and reasonably set map->state in ↵Michael Adam2014-04-251-3/+5
| | | | | | | idmap_autorid_sid_to_id_alloc Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: rename idmap_autorid_sid_to_id() -> idmap_autorid_sid_to_id_rid()Michael Adam2014-04-251-2/+3
| | | | | | | | For consistency. This is the function that does the calculation if the sid is treated by a rid range. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: rename idmap_autorid_map_sid_to_id() -> idmap_autorid_sid_to_id_alloc()Michael Adam2014-04-251-5/+5
| | | | | | | for consistency. this is the sid->id function for the alloc range. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: rename idmap_autorid_map_id_to_sid() -> idmap_autorid_id_to_sid_alloc()Michael Adam2014-04-251-3/+3
| | | | | | | | for consistency. This is the function that maps id to sid for the alloc range. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: factor idmap_autorid_get_alloc_range() out of ↵Michael Adam2014-04-251-6/+17
| | | | | | | idmap_autorid_allocate_id() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: fix discard-const warning in idmap_autorid_init_hwm()Michael Adam2014-04-251-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: fix uninitialized return code for successful autorid.tdb ↵Michael Adam2014-04-251-3/+1
| | | | | | | creation/opening Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: improve a debug message in idmap_autorid_map_sid_to_id()Michael Adam2014-04-251-2/+2
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: add debug messages to idmap_autorid_get_domainrange()Michael Adam2014-04-251-0/+4
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: improve wording in a debug messageMichael Adam2014-04-251-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: remove a legacy comment from sid_to_idMichael Adam2014-04-251-5/+0
| | | | | | | | | | | With the introduction of the ID_TYPE_BOTH mapping to idmap_autorid, it is not a deficiency but a virtue of the autorid backend that it does not care about the existence or type of the sid to be mapped. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* idmap_rid: remove a legacy comment from sid_to_idMichael Adam2014-04-251-4/+0
| | | | | | | | | | | With the introduction of the ID_TYPE_BOTH mapping to idmap_rid, it is not a deficiency but a virtue of the rid backend that it does not care about the existence or type of the sid to be mapped. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* idmap_tdb_common: remove legacy comment.Michael Adam2014-04-251-5/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* idmap_tdb_common: fix a debug message in idmap_tdb_common_set_mapping()Michael Adam2014-04-251-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>