summaryrefslogtreecommitdiffstats
path: root/source4/dsdb
Commit message (Collapse)AuthorAgeFilesLines
...
* dsdb/repl_meta_data: split out replmd_deletion_state()Stefan Metzmacher2013-07-301-31/+71
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb: Prune deleted objects of links and extra attributes of replicated deletesAndrew Bartlett2013-07-301-71/+199
| | | | | | | | | | | | | | | | | | | When an object is deleted, the links to be removed are not propogated, you have to watch out for them manually! We do this by calling back into the originating update delete code (ie what is called if you ldb_delete() locally) so that any extra attribute found locally and not on the remote server becomes removed remotely too. We currently do the same with links, but that isn't strictly correct, but for now our getNCChanges server code filters these out, so only the usn is bumped. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb/samdb: use RECYCLED it implies DELETED...Stefan Metzmacher2013-07-252-3/+3
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* dsdb: Add assert in drepl_take_FSMO_roleAndrew Bartlett2013-07-241-4/+3
| | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* dsdb-ridalloc: Rework ridalloc to return error strings where RID allocation ↵Andrew Bartlett2013-07-241-15/+41
| | | | | | | | | | | | | | | | | | fails We now also only poke the RID manager once per request. This may help track down why RID allocation can fail, as while we never wait for the RID set to be created/updated, it may be the only clue the admin gets as to why the async allocations were failing. Andrew Bartlett 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: Stefan Metzmacher <metze@samba.org>
* dsdb: Rework subtree_rename module to use recursive LDB_SCOPE_ONELEVEL searchesAndrew Bartlett2013-07-242-104/+99
| | | | | | | | | | This should be more efficient, particularly in the leaf node case when renaming and deleting entries on large databases. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb-descriptor: Do not do a subtree search unless we have child entriesAndrew Bartlett2013-07-241-1/+32
| | | | | | | | | This avoids a subtree search here in most cases where an object is deleted. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb-ridalloc: Fix RID pools - RID numbers increase too quicklyAndrew Bartlett2013-07-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A patch by Cove Schneider <cove_s@yahoo.com> who reports: I noticed that the RID numbers seem to increase incrementally, then will suddenly jump by 124501. Unless I'm misunderstanding, shouldn't RID pool allocations just be 500 at a time? e.g. Adding accounts one after another on a single test instance here's how they're incrementing (from 4.0.6): 1596 1597 1598 1599 126100 126101 126102 ... 126599 251100 ... 251599 376100 ... The problem is that this complicates using sssd's AD integration, as that it doesn't expect the RIDs to increase in a single domain so quickly. 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): Thu Jul 4 20:13:05 CEST 2013 on sn-devel-104
* build: Build with system md5.h on OpenIndianaAndrew Bartlett2013-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | This changes (again...) our system md5 detection to cope with how OpenIndiana does md5. I'm becoming increasingly convinced this isn't worth our while (we should have just done samba_md5...), but for now this change seems to work on FreeBSD, OpenIndiana and Linux with libbsd. This needs us to rename struct MD5Context -> MD5_CTX, but we provide a config.h define to rename the type bad if MD5_CTX does not exist (it does however exist in the md5.h from libbsd). Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jun 19 21:32:36 CEST 2013 on sn-devel-104
* dsdb: remove a wrong comment in dsdb_check_access_on_dn_internal()Stefan Metzmacher2013-06-131-4/+1
| | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Jun 13 18:19:24 CEST 2013 on sn-devel-104
* dsdb: don't allow a missing nTSecurityDescriptor in ↵Stefan Metzmacher2013-06-131-3/+3
| | | | | | | | | | dsdb_get_sd_from_ldb_message() Every object has a nTSecurityDescriptor attribute. This also avoids potential segfaults in the callers. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* dsdb: use AS_SYSTEM | SHOW_RECYCLED for access check searchesStefan Metzmacher2013-06-131-1/+7
| | | | | | | | | We need AS_SYSTEM in order to get the nTSecurityDescriptor attribute. Also the result of this search not controlled by the client nor is the result exposed to the client. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb repl_meta_data: Use dsdb_request_add_controls()Andrew Bartlett2013-06-131-18/+1
| | | | | | | | | | | This makes the code easier to read. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Jun 13 11:15:01 CEST 2013 on sn-devel-104
* dsdb-tests ldap.py: Add test for usn behaviour on certain changesAndrew Bartlett2013-06-121-54/+155
| | | | | | | | | | | This probes when the usn is updated, and when it is not. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Jun 12 11:54:01 CEST 2013 on sn-devel-104
* dsdb-tests ldap.py: Fix quoting of print statementsAndrew Bartlett2013-06-121-10/+10
| | | | | | | | While python didn't mind (oddly) it really confused my editor. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb: Fix behaviour for when to update the USN when there is no changeAndrew Bartlett2013-06-121-6/+28
| | | | | | | | | | | This handles deletions and replacements with no value, or with an exactly specified value, as well as modifies. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
* dsdb: Allow dsdb_find_dn_by_guid to show deleted DNsAndrew Bartlett2013-06-124-7/+15
| | | | | | | | | This helps us in the KCC as we need to return the deleted DN for the GUID in DsReplicaGetInfo calls (tested for deleted servers against Windows 2008R2). Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb: reset schema->{classes,attributes}_to_remove_size to 0Stefan Metzmacher2013-06-111-1/+3
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Jun 11 11:40:39 CEST 2013 on sn-devel-104
* dsdb: use the correct talloc parent in dsdb_repl_merge_working_schema()Stefan Metzmacher2013-06-111-2/+2
| | | | | | | schema->{classes,attributes} are the DLIST pointer not an array. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Revert "s4-dsdb: Remove strcasecmp() fallback in ↵Andrew Bartlett2013-06-111-0/+7
| | | | | | | | | | | | | replmd_ldb_message_element_attid_sort" This reverts commit d799b25dd3ed0f72ee03949225ba241c5538d7d6. Sometimes the schema just isn't right. A segfault is not the correct answer in those cases. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4:samldb LDB module - MS-SAMR 3.1.1.8.10 "userAccountControl"Matthias Dieter Wallnöfer2013-06-102-17/+147
| | | | | | | | | | | | "UF_LOCKOUT" and "UF_PASSWORD_EXPIRED" are never stored but rather are used for special semantics. "UF_LOCKOUT" performs an account lockout and "UF_PASSWORD_EXPIRED" forces password expiration. Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Jun 10 07:32:35 CEST 2013 on sn-devel-104
* s4:samldb LDB module - permit "userAccountControl" modifications without ↵Matthias Dieter Wallnöfer2013-06-052-2/+58
| | | | | | | | | | | | acct. type Obviously this defaults to UF_NORMAL_ACCOUNT. Some background can be found in MS-SAMR section 3.1.1.8.10. Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Jun 5 03:26:25 CEST 2013 on sn-devel-104
* s4:samldb LDB module - "userAccountControl" = 0 means UF_NORMAL_ACCOUNT on addMatthias Dieter Wallnöfer2013-06-052-21/+37
| | | | | | Windows Server 2008 has changed semantics in comparison to Server 2003. Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb-repl_meta_data: Move TODO comment about conflicts and missing parentsAndrew Bartlett2013-05-281-9/+4
| | | | | | | Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue May 28 18:11:00 CEST 2013 on sn-devel-104
* dsdb-repl_meta_data: Handle renames better, considering only the RDN as ↵Andrew Bartlett2013-05-281-76/+141
| | | | | | | | | | given, and then the parent as given This ignores the full DN as given, because the parent compents might be out of date. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb-linked_attributes: Do not crash if the target GUID can not be foundAndrew Bartlett2013-05-281-0/+15
| | | | | | | | | | Note that we must not give an error when we cannot find the object that should hold the backlink, there really isn't anything we can do in this case. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb-repl: merge the logic from libnet_vampire_cb_apply_schema()Stefan Metzmacher2013-05-231-6/+113
| | | | | | | | | | | This way libnet_vampire_cb_apply_schema() is able to use dsdb_repl_resolve_working_schema(). Pair-Programmed-With: Matthieu Patou <mat@matws.net> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb-repl: split out dsdb_repl_resolve_working_schemaStefan Metzmacher2013-05-231-53/+94
| | | | | | | | | | This can be reused later in other places. Pair-Programmed-With: Matthieu Patou <mat@matws.net> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb-drs: when replicating schema object checks ask for removal of previous ↵Matthieu Patou2013-05-231-3/+4
| | | | | | | | | version if exists (bug #8680) Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb-schema: make deduplication of class and schema possible (bug #8680)Matthieu Patou2013-05-233-10/+113
| | | | | | | | | | | | | | When a class or an attribute is replicated it might already exists in the existing schema, so while replicating the new version of this object we want to get rid of the old version of the object is the current validating schema so that we don't end up having duplicates. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Matthieu Patou <mat@matws.net> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb-schema: schema_fill_possible_inferiors() should rebuild everthingStefan Metzmacher2013-05-231-2/+2
| | | | | | | | | commit cd7f3fd07215a7b8372b6b623faed02ae1310cb1 reverted the change of commit c2853f55fc603d4875bb1e50a1cbf409df0421ea. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix warning by setting the variable from GUID to const GUIDMatthieu Patou2013-05-201-1/+2
| | | | | | Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix more unused varsMatthieu Patou2013-05-201-2/+1
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix a warning about a set but unused variable by actually using itMatthieu Patou2013-05-201-0/+5
| | | | | | Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix warnings about set but unused variablesMatthieu Patou2013-05-202-10/+1
| | | | | | Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* operational: remove double loopsMatthieu Patou2013-05-201-31/+47
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb-schema: remove looping on all schema classes for system_possible_inferriorMatthieu Patou2013-05-201-34/+19
| | | | | | | | The logic to populate possible inferriors and system possible inferriors is the same so instead of looping twice we do both attributes (depending on the type of the class) in the same loop Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb python tests - set the executable flagMatthias Dieter Wallnöfer2013-05-172-0/+0
| | | | | | | Reviewed-by: Matthieu Patou <mat@samba.org> Autobuild-User(master): Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date(master): Fri May 17 15:11:29 CEST 2013 on sn-devel-104
* dsdb: Expand on what the error finding the ntSecurityDescriptor was in acl_readAndrew Bartlett2013-05-161-2/+8
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb-schema: Print clear debug message when we find a OID in our local DB we ↵Andrew Bartlett2013-05-161-0/+1
| | | | | | | | | | | cannot convert We need to work out why we are unable to make a mapping for an OID in our database, because we should not have been able to add it without such a mapping. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb-repl: Allow the name attribute (and name-based schema lookups) to be ↵Andrew Bartlett2013-05-161-12/+19
| | | | | | | | | | skipped in dsdb_repl_make_working_schema() This allows us to use a schema that may only be valid for attributeID based lookups, during the schema load. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
* source4/dsdb/schema/schema_convert_to_ol.c: Fix typo in comment.Karolin Seeger2013-05-151-1/+1
| | | | | Signed-off-by: Karolin Seeger <kseeger@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* source4/dsdb/samdb/ldb_modules/local_password.c: Fix typo in comment.Karolin Seeger2013-05-151-1/+1
| | | | | Signed-off-by: Karolin Seeger <kseeger@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dsdb-drepl: create a new schedulable event for running pending operationsMatthieu Patou2013-05-153-1/+79
| | | | | | | | | | | So instead of running dreplsrv_periodic_schedule when receiving a DRS_REPLICA_SYNC request which will force the DC to look for changes with all the DC it usually replicate to, we reduce it to the DC specified in the DRS_REPLICA_SYNC request. It will allow also to do have the correct options as set by the client who send the DRS_REPLICA_SYNC. Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* dsdb: make the name of non related class more obviousMatthieu Patou2013-05-141-2/+3
| | | | | | Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb: Fix warnings about not set / set but unused / shadowed variablesMatthieu Patou2013-04-197-20/+5
| | | | | | | Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Apr 19 13:15:40 CEST 2013 on sn-devel-104
* dsdb: Check for pointers before we deference them.Andreas Schneider2013-03-051-7/+7
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* dsdb-descriptor: Avoid segfault copying an SD without an owner or groupAndrew Bartlett2013-02-221-4/+12
| | | | | | | | | | | This is an unusual SD, but it does exist is some very old upgraded databases. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Feb 22 11:06:17 CET 2013 on sn-devel-104
* dsdb-descriptor: Spell out security descriptor flags as constantsAndrew Bartlett2013-02-222-2/+2
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ntdb: switch between secrets.tdb and secrets.ntdb depending on 'use ntdb'Rusty Russell2013-02-201-3/+10
| | | | | | | | | | | Since we open with dbwrap, it auto-converts old tdbs (which it will rename to secrets.tdb.bak once it's done). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Wed Feb 20 07:09:19 CET 2013 on sn-devel-104