summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/schema
Commit message (Collapse)AuthorAgeFilesLines
* dsdb: Do not refresh the schema using the wrong event contextAndrew Bartlett2014-06-113-29/+74
| | | | | | | | | | | | | | | | What we now do is have the refresh function and module be on a seperate object to the schema, only referring to the data and not excuting on the original ldb and event loop. That is, we never use another ldb context when calling the refresh function, by binding the refresh handler to the ldb and not the schema. Andrew Bartlett Change-Id: I5c323dda743cf5858badd01147fda6227599bc16 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* dsdb: Do not store a struct ldb_dn in struct schema_dataAndrew Bartlett2014-06-113-14/+0
| | | | | | | | | | | | The issue is that the DN contains a pointer to the ldb it belongs to, and if this is not kept around long enough, we might reference memory after it is de-allocated. Andrew Bartlett Change-Id: I040a6c37a3164b3309f370e32e598dd56b1a1bbb Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* dsdb: Convert the full string from UTF16 to UTF8, including embedded NULLsAndrew Bartlett2013-09-261-1/+1
| | | | | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=8077 Note that this doesn't fix the userParameters problem completely, but it doesn't truncate the userParameters value anymore. 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 Sep 26 22:05:12 CEST 2013 on sn-devel-104
* dsdb: Use WERR_DS_ATT_NOT_DEF_IN_SCHEMA for failed schema lookupsAndrew Bartlett2013-09-221-28/+28
| | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@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-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>
* 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>
* 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>
* 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>
* dsdb-schema: make sure we build [system]PossibleInferiors completelyStefan Metzmacher2013-01-211-0/+4
| | | | | | | | | Otherwise callers like dsdb_schema_copy_shallow() will corrupt the talloc hierarchie. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb-schema: make sure use clean caches in schema_inferiors.cStefan Metzmacher2013-01-212-28/+32
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* dsdb-schema: make schema_subclasses_order_recurse() staticStefan Metzmacher2013-01-211-3/+3
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb/schema: fix dsdb_schema_set_el_from_ldb_msg() (bug #9470)Stefan Metzmacher2012-12-071-7/+7
| | | | | | | We should always update the ts_last_change. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s4-dsdb: Do not use a possibly-old loadparm context in schema reloadAndrew Bartlett2012-08-232-12/+15
| | | | | | | | The loadparm context on the schema DB might have gone away already. Pre-cache the schema refresh interval at load time to avoid worrying about this. Andrew Bartlett
* s4:dsdb_sort_objectClass_attr - simplify memory context handlingMatthias Dieter Wallnöfer2012-08-221-9/+19
| | | | | | | Do only require the out memory context and build the temporary one in the body of the function. This greatly simplifies the callers. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s4:dsdb_sort_objectClass_attr - use "data_blob_string_const" for setting valuesMatthias Dieter Wallnöfer2012-08-221-6/+1
| | | | | | | As shown in commit c8e6d8b487 this looks easier and in any case we can treat schema context data like global data. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s4-dsdb: Add mem_ctx argument to samdb_ntds_settings_dnAndrew Bartlett2012-08-141-1/+1
| | | | | | | | | | | | | | As this value is calculated new each time, we need to give it a context to live on. If the value is the forced value during provision, a reference is taken. This was responsible for the memory leak in the replication process. In the example I was given, this DN appeared in memory 13596 times! Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Aug 14 10:05:14 CEST 2012 on sn-devel-104
* s4-dsdb: Improve memory handling in dsdb_schema_from_ldb_results() by adding ↵Andrew Bartlett2012-08-141-2/+14
| | | | a tmp_ctx
* s4-dsdb: Use only the replication USN for schema reload.Andrew Bartlett2012-08-111-6/+0
| | | | | | | | | | | This way we do not track both the partition seq number and the replication USN for schema reload purposes. We only need one indication of actual data change, and the replication per-partition sequence number is no more expensive to obtain than the ldb per-partition sequence number. Andrew Bartlett
* s4-dsdb: Explain better what records are written during schema setAndrew Bartlett2012-08-101-7/+16
| | | | | | This is controlled by setting write_indices_and_attributes. Andrew Bartlett
* s4-schema: improve the documentation of the dsdb_schema structureMatthieu Patou2012-06-221-4/+6
|
* s4-dsdb: Check for key SCHEMA_SEQ_NUM in metadata.tdb updatesMatthieu Patou2012-06-221-1/+8
| | | | | | | If the value has changed then reload the schema, this means that now the schema is only reloaded on a periodical basis or if we have been asked explicitly to do it and not necesserly if the schema partition has changed.
* s4-schema: keep track of the timestamp of the most recently changed/created ↵Matthieu Patou2012-06-223-1/+13
| | | | object
* s4-schema: generalized time use its own syntax nowMatthieu Patou2012-06-221-1/+0
|
* dsdb-schema: do not reload more often than schema_reload_intervalMatthieu Patou2012-06-221-0/+1
| | | | | | | | | | | | | Samba 4 use to try to reload the schema every time dsdb_get_schema was called (which could be 20+ time per ldb request). Now we only reload at most every xx seconds (xx being the value of dsdb:"schema_reload_interval" or 120). The timestamp of the last reloaded schema is kept in the dsdb_schema object. There is also a timestamp in the ldb_context, that is used by the LDAP server to know if it has to reload the schema after handling the request. This is used to allow that the schema will be immediately reload after a schemaUpdateNow request has been issued, the reload can't occur in the handling of the LDAP request itself because we have a transaction autostarted.
* Add some debug for FOOBAR return case as they are hard to diagnoseMatthieu Patou2012-04-291-0/+3
| | | | | Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Sun Apr 29 09:08:15 CEST 2012 on sn-devel-104
* s4-schema: rename dsdb_attribute_from_ldb to dsdb_set_attribute_from_ldb ↵Matthieu Patou2012-04-183-11/+32
| | | | and dsdb_class_from_ldb to dsdb_set_class_from_ldb
* s4:dsdb - move "objectclass_sort()" out from the objectclass LDB module into ↵Matthias Dieter Wallnöfer2012-04-111-0/+164
| | | | | | | | | | the schema code This allows it to be useful for the dbchecker utility in respect to object class problems. Fix up the API to only work with standardised LDB "ldb_message_element" structures which do allow much easier interoperations. As a consequence this leads to some changes in the objectclass module as well.
* s4:schema/schema_query.c - fix a commentMatthias Dieter Wallnöfer2012-04-111-1/+1
|
* s4:schema/schema_init.c - better use "ldb_attr_cmp" instead of "strcasecmp"Matthias Dieter Wallnöfer2012-04-111-1/+1
| | | | LDB convention
* s4:dsdb/schema: add "dsdb:schema update allowed" option to enable schema updatesStefan Metzmacher2011-11-153-2/+17
| | | | | | | By default schema updates are not allowed anymore, as we don't have complete validation code to prevent database corruption. metze
* s4:param/provision: pass schema_dn to provision_get_schema()Stefan Metzmacher2011-11-151-1/+1
| | | | metze
* s4:dsdb/schema: pass and remember the schema_dn in dsdb_set_schema_from_ldif()Stefan Metzmacher2011-11-151-3/+11
| | | | metze
* s3:utils change data_blob_dup_talloc() to take a DATA_BLOB by valueGregor Beck2011-10-122-4/+4
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s4-dsdb: fixed one_way_link calculationAndrew Tridgell2011-10-071-1/+2
| | | | | | we need to check for the other end of the link, not the current linkID Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-schema consolidate schema handlingAndrew Bartlett2011-09-051-24/+32
| | | | | | | It also creates a single routine dsdb_load_ldb_results_into_schema() to handle cases where the schema is in the form of an ldb_result. Andrew Bartlett
* s4-dsdb: fixed calls to ldb_val_string_cmp()Andrew Tridgell2011-08-251-2/+2
| | | | wrong order of arguments
* move schema_fill_constructed() call to dsdb_setup_sorted_accessors()Andrew Bartlett2011-08-091-5/+7
|
* s4-dsdb Remove unused schema functionAndrew Bartlett2011-08-091-18/+0
|
* s4-dsdb: added SAMDB_INDEXING_VERSION to @INDEXLISTAndrew Tridgell2011-08-091-0/+11
| | | | | | | | this can be used to force re-indexing of samdb when we change something that affects index comparison, in this case the canonicalisation of booleans Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-dsdb: fixed booling conversion to check value lengthAndrew Tridgell2011-08-091-11/+14
| | | | | | this ensures we don't look past the end of the data Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-dsdb: add auto-normalisation of attributesAndrew Tridgell2011-08-092-3/+10
| | | | | | | | | | | | | | | this auto-normalises some attributes when they are added/modified. The list that we auto-normalise is currently: Boolean INT32 INTEGER UTC_TIME This fixes a problem with groupType being stored in an unnormalised form Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-dsdb: ensure we setup the dn_format field in schema attributesAndrew Tridgell2011-08-092-31/+40
| | | | | | this ensures we setup dn_format when we do runtime schema changes Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-dsdb: added dn_format attribute of a dsdb_attributeAndrew Tridgell2011-08-042-2/+14
| | | | | | | this is faster than string comparisons during searches at runtime Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
* s4-dsdb: setup a one_way_link attribute on schema attributesAndrew Tridgell2011-08-042-0/+30
| | | | | | | this allows us to quickly determine if a DN is a one way link Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
* update/add my copyrightMatthieu Patou2011-07-211-0/+1
|
* s4-schema: add systemFlags to dsdb classes objectsMatthieu Patou2011-07-212-0/+2
|
* dsdb: fixed special case of zero NTTIMEAndrew Tridgell2011-07-131-0/+20
| | | | | | we can't convert 0 NTTIME via a unix time_t Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-schema: avoid segfaulting if id3.guid is NULLMatthieu Patou2011-06-221-2/+1
|