summaryrefslogtreecommitdiffstats
path: root/source4/dsdb/schema/schema_init.c
Commit message (Collapse)AuthorAgeFilesLines
* dsdb: Do not refresh the schema using the wrong event contextAndrew Bartlett2014-06-111-2/+0
| | | | | | | | | | | | | | | | 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-111-8/+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-schema: make deduplication of class and schema possible (bug #8680)Matthieu Patou2013-05-231-5/+67
| | | | | | | | | | | | | | 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>
* s4-dsdb: Do not use a possibly-old loadparm context in schema reloadAndrew Bartlett2012-08-231-12/+14
| | | | | | | | 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: 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-schema: keep track of the timestamp of the most recently changed/created ↵Matthieu Patou2012-06-221-0/+1
| | | | object
* s4-schema: rename dsdb_attribute_from_ldb to dsdb_set_attribute_from_ldb ↵Matthieu Patou2012-04-181-7/+28
| | | | and dsdb_class_from_ldb to dsdb_set_class_from_ldb
* 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-151-2/+15
| | | | | | | By default schema updates are not allowed anymore, as we don't have complete validation code to prevent database corruption. metze
* 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-schema: add systemFlags to dsdb classes objectsMatthieu Patou2011-07-211-0/+1
|
* ldb: use #include <ldb.h> for ldbAndrew Tridgell2011-02-101-2/+2
| | | | | | | | thi ensures we are using the header corresponding to the version of ldb we're linking against. Otherwise we could use the system ldb for link and the in-tree one for include Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-dsdb_schema: Copy info needed for Schema refresh in dsdb_schema_copy_shallowKamen Mazdrashki2010-12-181-0/+4
| | | | | | | | Just 'refresh_fn' and 'loaded_from_module' are copied. I left 'reload_seq_number' set to 0 intentionally, so that this Schema cache will looks like a very old one to ,refresh_fn'. This way, if this shallow copy is attached to LDB, it will be refreshed as soon as possible by 'refresh_fn'.
* s4-dsdb_schema: We need base_dn in Schema's shallow copy tooKamen Mazdrashki2010-12-151-1/+7
|
* s4-dsdb/schema: Add Schema shallow copy functionKamen Mazdrashki2010-12-011-0/+57
|
* s4-dsdb: give the DN on a shema attribute failureAndrew Tridgell2010-11-071-1/+1
|
* s4-dsdb_schema: Use DRSUAPI_ATTID_INVALID instead of 0xFFFFFFFF magic valueKamen Mazdrashki2010-11-011-3/+3
| | | | | Autobuild-User: Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date: Mon Nov 1 00:36:20 UTC 2010 on sn-devel-104
* s4-schema_init: we should be able to resolve Syntax OIDs with prefixMap we haveKamen Mazdrashki2010-10-291-3/+3
| | | | | If Syntax OID is not in the prefixMap then we are getting an unknown Attribute Syntax (which we can't handle anyway)
* s4-prefixmap: Use WERR_NOT_FOUND when OID is not found in current prefixMapKamen Mazdrashki2010-10-261-1/+1
| | | | | | rather than WERR_DS_NO_MSDS_INTID. WERR_DS_NO_MSDS_INTID is intended to be used for msDsIntId attribute values handling
* s4-schema_init: Print more info about syntax we fail to recognizeKamen Mazdrashki2010-10-201-2/+4
| | | | | Autobuild-User: Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date: Wed Oct 20 13:54:01 UTC 2010 on sn-devel-104
* s4:dsdb/schema/schema_init.c - remove a duplicated "talloc_free"Matthias Dieter Wallnöfer2010-10-191-1/+0
|
* s4:dsdb - remove "samdb_result_uint", "samdb_result_int64", ↵Matthias Dieter Wallnöfer2010-10-151-3/+3
| | | | | | | | | "samdb_result_uint64" and "samdb_result_string" We have ldb_msg_find_attr_as_* calls which do exactly the same. Therefore this reduces only code redundancies. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s4-schema: use dsdb_schema_info_blob_is_valid() to verify schemaInfo blobKamen Mazdrashki2010-09-171-9/+6
| | | | instead of parsing it.
* s4:cosmetic - the SID attribute is called objectSid - not objectSIDMatthias Dieter Wallnöfer2010-09-131-1/+1
|
* s4-dsdb: use ldb_operr() in the dsdb codeAndrew Tridgell2010-07-071-5/+4
| | | | | | | this replaces "return LDB_ERR_OPERATIONS_ERROR" with "return ldb_operr(ldb)" in places in the dsdb code where we don't already explicitly set an error string. This should make is much easier to track down dsdb module bugs that result in an operations error.
* s4:dsdb Fix possible schema segfaults for DRS-replication based schemaAndrew Bartlett2010-06-301-17/+13
| | | | | | | | | The problem here is that if the schema has been modified on the source domain, there may be attributes that appear over DRS with 0 values (to indicate that any existing values on the target should be deleted). This would confuse the previous version of this macro. Andrew Bartlett
* s4:dsdb Use the schema from our local provision to decode the schemaAndrew Bartlett2010-06-151-367/+0
| | | | | | | | | | | | | | This works on the assumption that the schema partition can only contain schema objects. We may need to pass down some kind of 'relax' to the DRS -> LDB conversion code, so that it allows incomplete conversions, so that we don't fail if a new attribute is present, and we can't decode it. This would then be resolved the second time we do the conversion. Andrew Bartlett Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
* s4:dsdb Provide a function to convert from DRS prefix maps to the LDB prefixmapAndrew Bartlett2010-06-121-12/+21
| | | | | | | This allows us to push a prefixmap directly into the schema we generate in the provision code. Andrew Bartlett
* s4:dsdb Add more debugs to help track down failures to parse the prefixmapAndrew Bartlett2010-06-121-5/+20
|
* Finish removal of iconv_convenience in public API's.Jelmer Vernooij2010-05-181-15/+6
|
* s4/dsdb: Use default schemaInfo value when no such value is givenKamen Mazdrashki2010-04-291-12/+2
| | | | | | Having no value for schemaInfo is totally OK as it turns out. In such cases, we should use a default value with all fields set to 0.
* Revert "s4:prefer "samdb_*_dn" basedn calls over the "ldb_get_*_dn" functions"Matthias Dieter Wallnöfer2010-04-131-2/+2
| | | | | We should use the "ldb_get_*_basedn" calls since they are available in the LDB library.
* s4/dsdb: Let caller to control if valid invocationId is critical or ↵Kamen Mazdrashki2010-04-091-1/+1
| | | | zero-guid is acceptable
* s4/dsdb: Use dsdb_schema_info object to create default schemaInfo valuesKamen Mazdrashki2010-04-091-3/+16
|
* s4/dsdb: Use dsdb_schema_info object to verify schema_info blobsKamen Mazdrashki2010-04-091-14/+12
|
* s4:schema Expand the schema structureAndrew Bartlett2010-03-221-0/+2
| | | | | | | We now store the location of the schema in the schema, and provide hooks for a future schema reloading mechanism. Andrew Bartlett
* s4:schema - Change also here counters to "unsigned" where neededMatthias Dieter Wallnöfer2010-03-071-4/+5
| | | | | | Counters which are used in the way "for (i = 0; array[i] != NULL; i++)" I modified to "unsigned" since for sure we don't want to have negative array indexes there.
* s4-dsdb: change samdb_replace() to dsdb_replace() and allow for dsdb_flagsAndrew Tridgell2010-02-161-2/+3
| | | | This allows for controls to be added easily where they are needed.
* s4-schema: added some debug for bad attributesAndrew Tridgell2010-01-081-0/+8
|
* s4/dsdb_schema: Load msDS-IntId value separately when loading from LDBKamen Mazdrashki2010-01-081-0/+3
| | | | | This way we have consistent behavior when loading from DRSUAPI and from LDB.
* Revert "s4-schema: Set ATTID in schema cache from "msDS-IntId""Kamen Mazdrashki2010-01-081-13/+8
| | | | This reverts commit 4e8ad284f5813413fdec8426f11e24570d22549b.
* s4/dsdb_schema: fetch msDS-IntId value during SCHEMA replicationKamen Mazdrashki2010-01-081-0/+4
|
* s4/dsdb_schema: GET_UINT32_DS() macro to use supplied default value instead of 0Kamen Mazdrashki2010-01-081-14/+14
|
* s4-drs: Save prefix map using LDB_CONTROL_AS_SYSTEM controlKamen Mazdrashki2009-12-211-1/+1
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s4-schema: Set ATTID in schema cache from "msDS-IntId"Kamen Mazdrashki2009-12-211-8/+13
| | | | | | | | | According to http://msdn.microsoft.com/en-us/library/cc223224%28PROT.13%29.aspx some Attributes OIDs may not use prefixMap. Setting ATTID in Schema Cache here should work, although this code snippet should be moved in separate function. Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s4-dsdb: simplify schema code using new GUID functionsAndrew Tridgell2009-12-101-6/+2
|
* s4:dsdb Load objectGUID and extended DN defaultObjectCategory into the schemaAndrew Bartlett2009-11-171-35/+25
| | | | | | | | | | | | | | The load of defaultObjectCategory as an extended DN means we need to use the common parsing functions I just split out, rather than the GET_DS_DN macro. The objectGUIDs are loaded so that we can create the extended DN when we load from LDIF (and are loaded for the other cases for consistency). Also adapt callers to API changes needed for common parsing code Andrew Bartlett
* s4:dsdb/schema Simplify schema loading from ldb messagesAndrew Bartlett2009-11-121-62/+47
| | | | It turns out that we always add the class/attribute to the schema.
* s4/drs: Refactor to be more SAMBA.Coding style compliantKamen Mazdrashki2009-11-061-1/+2
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>