summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema/schema_set.c
AgeCommit message (Collapse)AuthorFilesLines
2010-10-12torture/becomedc: Add test for global schema, use samdb_connect().Jelmer Vernooij1-1/+6
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Tue Oct 12 18:35:33 UTC 2010 on sn-devel-104
2010-10-10s4-dsdb: Make dsdb_setup_sorted_accessors() publicKamen Mazdrashki1-2/+2
We are going to need it while converting DRS schema.
2010-08-11s4-dsdb: fix attributes_by_msDS_IntId index sortingKamen Mazdrashki1-1/+5
2010-07-19s4-dsdb: use ldb_msg_normalize() in source4/dsdb/schema/schema_set.cKamen Mazdrashki1-5/+4
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19s4-dsdb/schema/schema_set.c: fix trailing spaces and comments spellingKamen Mazdrashki1-30/+38
Few comments split on several lines also... (Sorry Metze, I know you hate reviewing "and this, and that" type of patches, but those are just cosmetics) Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19s4-dsdb: use ldb_msg_difference() in source4/dsdb/schema/schema_set.cKamen Mazdrashki1-2/+10
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-07s4-dsdb: use ldb_operr() in the dsdb codeAndrew Tridgell1-7/+6
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.
2010-07-03s4:schema_set.c - Fix a commentMatthias Dieter Wallnöfer1-1/+2
2010-07-03s4:dsdb_schema_set_attributes - remove unneeded filter criteriasMatthias Dieter Wallnöfer1-2/+4
We already choose the right entry by specifying the right basedn with scope "LDB_SCOPE_BASE".
2010-07-03s4:schema_set.c - fix typoMatthias Dieter Wallnöfer1-1/+3
2010-07-02s4/schema: remove unnecessary deletion of dsdb_schema cached pointerAnatoliy Atanasov1-3/+0
This is needed so we can find and free old schemas based using the cached pointer
2010-07-02s4:dsdb Ensure we free old schema copiesAndrew Bartlett1-6/+25
It was reported by aatanasov that we kept around one whole schema per modification made. This does not fix that, but I hope moves us closer to a fix The most important part of the fix is that: - if (schema_out != schema_in) { - talloc_unlink(schema_in, ldb); - } was the wrong way around. This is now handled in the schema_set calls. Andrew Bartlett
2010-06-30s4:schema/schema_set.c - free LDB message diffsAnatoliy Atanasov1-0/+2
Especially the "free"s after "ldb_msg_diff" are very important since the diff message is allocated on the long-living LDB context. Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2010-06-21s4/dsdb: msg_idx->dn should be allocated in msg_idx mem contextKamen Mazdrashki1-1/+1
2010-06-21s4/dsdb: Move schema accessors cleanup in separate functionKamen Mazdrashki1-18/+21
This way dsdb_setup_sorted_accessors() will free memory allocated for accessor arrays correctly in case of failure,
2010-06-21s4/dsdb-schema: Index attributes on msDS-IntId valueKamen Mazdrashki1-2/+23
O(n) search for dsdb_attribute by msDS-IntId value was replaced by binary-search in ordered index. I've choosen the approach of separate index on msDS-IntId values as I think it is more clear what we are searching for. And it should little bit faster as we can clearly determine in which index to perform the search based on ATTID value - ATTIDs based on prefixMap and ATTIDs based on msDS-IntId are in separate ranges. Other way to implement this index was to merge msDS-IntId values in attributeID_id index. This led me to a shorted but not so obvious implementation.
2010-06-12s4:dsdb Simplfy match of objectclass in dsdb_schema_set_el_from_ldb_msgAndrew Bartlett1-17/+4
There is no need to do a full ldb_match_msg() for a simple case insensitive string. Andrew Bartlett
2010-06-12s4:dsdb Put back the reference and set_attributes in dsdb_reference_schemaAndrew Bartlett1-0/+9
I'm not sure why I removed these in fe3e1af901c970f738bee92baac5d7d4f5736e17 Andrew Bartlett
2010-05-18Finish removal of iconv_convenience in public API's.Jelmer Vernooij1-1/+1
2010-04-29s4/dsdb: Use default schemaInfo value when no such value is givenKamen Mazdrashki1-4/+1
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.
2010-04-09s4/dsdb: Let caller to control if valid invocationId is critical or ↵Kamen Mazdrashki1-1/+1
zero-guid is acceptable
2010-04-09s4/dsdb: Use dsdb_schema_info object to create default schemaInfo valuesKamen Mazdrashki1-4/+6
2010-03-22s4:dsdb Rework schema loading and add schema reloadingAndrew Bartlett1-25/+55
This commit reworks Samba4's schema loading code to detect when it needs to reload the schema. This is done by watching the @REPLCHANGED special DN. The reload happens by means of a callback, which is only set when the schema is loaded from the ldb - not when loaded from an LDIF file or DRS. We also rework the global schema handling - instead of storing the pointer to the global schema in each ldb, we store a flag indicating that the global schema should be returned at run time. This makes it much easier to switch to a new global schema. Andrew Bartlett
2010-03-16s4:dsdb Add a memory context for dsdb_get_schema()Andrew Bartlett1-3/+9
When specified, we talloc_reference onto this context to ensure that pointers found in it are valid for the life of the objects they are placed into. (Such as the string form of LDAP attributes). Andrew Bartlett
2010-03-07s4:schema - Change also here counters to "unsigned" where neededMatthias Dieter Wallnöfer1-1/+1
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.
2010-02-16s4-dsdb: change samdb_replace() to dsdb_replace() and allow for dsdb_flagsAndrew Tridgell1-2/+2
This allows for controls to be added easily where they are needed.
2010-02-13s4-dsdb: use TYPESAFE_QSORT() in dsdb codeAndrew Tridgell1-16/+9
2009-12-21s4-schema: fixed the sorting of schema attributesAndrew Tridgell1-3/+9
another case of unsigned int subtracting breaking sorts. This one surfaced now as attributeID_id now can be larger than 2^31
2009-12-10s4-schema: use GUID_to_ndr_blob()Andrew Tridgell1-4/+4
2009-11-17s4:schema Add the GUID to each defaultObjectCategory when loading from LDIFAndrew Bartlett1-0/+49
This makes these full extended DNs, so we set the right values into the database, even before we actually set the schema objects themselves. Andrew Bartlett
2009-11-12s4:dsdb/schema Allow a schema set when bound against a remote LDAP serverAndrew Bartlett1-3/+3
2009-11-12s4:dsdb/schema Simplify schema loading from ldb messagesAndrew Bartlett1-36/+34
It turns out that we always add the class/attribute to the schema.
2009-10-12s4:schema Add some error checking to the schema loadAndrew Bartlett1-1/+4
2009-09-15s4-dsdb: use DLIST_ADD() not DLIST_ADD_END()Andrew Tridgell1-2/+2
Using DLIST_ADD_END() to construct a long list is very inefficient (it is O(n^2). These lists are not ordered, so using DLIST_ADD() is much better.
2009-08-17s4:schema Allow a schema load on an unconnected databaseAndrew Bartlett1-5/+6
This helps ensure we don't load the schema too often in the provision (allowing a reference in of the schema before the modules load). Andrew Bartlett
2009-08-17s4:schema Provide a way to reference a loaded schema between ldbsAndrew Bartlett1-11/+19
This allows us to load the schema against one ldb context, but apply it to another. This will be useful in the provision script, as we need the schema before we start the LDAP server backend. Adnrew Bartlett
2009-08-07use talloc with the global schema consistentlyAndrew Tridgell1-1/+2
Before this change, the first opener of the sam ldb context would become the owner of the global schema, then the autofree context got a reference to the schema. Any subsequent opens of the sam ldb also got a reference. This meant that the talloc hierarchy was inconsistent between the first sam ldb open and subsequent opens. With this change the autofree context becomes the owner of the global schema, and all ldb contexts get a reference.
2009-07-08Fix for schemaUpdateNow commandAnatoliy Atanasov1-3/+3
2009-07-01fixed the reference to the global_schemaAndrew Tridgell1-2/+3
2009-06-18Fix build with system LDB.Jelmer Vernooij1-1/+1
2009-05-28enable one-level indexing in sam.ldbAndrew Tridgell1-0/+5
2009-04-08Make the schema_inferiors generation code to compileAndrew Bartlett1-0/+19
Sadly it still segfaults at this stage Andrew Bartlett
2009-04-03s4:schema Don't free mem_ctx before it is initilisedAndrew Bartlett1-1/+0
2009-04-02major upgrade to the ldb attribute handlingAndrew Tridgell1-29/+178
This is all working towards supporting the full WSPP schema without a major performance penalty. We now use binary searches when looking up classes and attributes. We also avoid the loop loading the attributes into ldb, by adding a hook to override the ldb attribute search function in a module. The attributes can thus be loaded once, and then saved as part of the global schema. Also added support for a few more key attribute syntaxes, as needed for the full schema.
2009-03-05Remove ad2oLschema, insted call it directly from provision-backendAndrew Bartlett1-1/+1
This removes a level of indirection via external binaries in the provision-backend code, and also makes better use of our internal code for loading schema from an LDIF file. Remaining to do: Sort the output again, as the load from LDIF is unsorted (also needed because the normal LDB load from sorted input is too slow anyway, and is only needed here). Andrew Bartlett
2009-02-23Fix headers, ldb_includes.h is a private header,Simo Sorce1-0/+1
do not reference it from ldb.h
2009-01-30Fix all other modules to use ldb_module.h instead of ldb_private.hSimo Sorce1-3/+1
The only 2 modules escaping the rule so far are rootdse and partitions
2008-10-18Add TALLOC_CTX pointer to strhex_to_data_blob for consistency with SambaJelmer Vernooij1-2/+1
3.
2008-10-11Fix include paths to new location of libutil.Jelmer Vernooij1-1/+1
2008-09-23Merge ldb_search() and ldb_search_exp_fmt() into a simgle function.Simo Sorce1-2/+2
The previous ldb_search() interface made it way too easy to leak results, and being able to use a printf-like expression turns to be really useful.