summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema/schema_set.c
AgeCommit message (Collapse)AuthorFilesLines
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.
2008-09-12Fix failure to load the schema on read-only DB.Andrew Bartlett1-23/+13
This also tries to simplify the logic in the schema -> @ATTRIBUTES and @INDEXES code. Andrew Bartlett (This used to be commit a383b8bf88a5681f9c9c6839ba645c872a735051)
2008-09-11Remove the complexity of transactions from the attributes-setting code.Andrew Bartlett1-16/+1
I think it is just too complex and error prone to init and cancel transactions during the module init code. Instead, this isn't prone to races as it will always achieve a steady state (eventually), and most cases will never do the write. Andrew Bartlett (This used to be commit d60977cc7f89f89f34187f310c91d1ab7db6ccf2)
2008-08-21Stop every ldb startup doing a write to the database.Andrew Bartlett1-0/+7
Something in the search stack adds a distinguisedName record, which isn't in the message we generate. So we compare, fail and rewrite the record - every time ldb starts up... Andrew Bartlett (This used to be commit 44775d1ed4a4b8edc66a06e2b3710aba6a0dd019)
2008-08-21Set both attributes and indexes into the database on schema load.Andrew Bartlett1-18/+142
This ensures that a rudementary schema is always present (for bootstrapping), and that the indexes are maintained equal to the schema (rather than hard-coded). Andrew Bartlett (This used to be commit 747d683b0d92c3b1cde67245d514977a2c87dc44)
2008-08-20Apply attributes (and their syntax) from the schema into ldbAndrew Bartlett1-0/+49
This changes the @ATTRIBUTES record to be for bootstrapping only, before we find the schema. Andrew Bartlett (This used to be commit 358477fcc041d5fb2e6ac5641c2f899cc49cfb69)
2008-08-20Split schema_init.c into smaller bits.Andrew Bartlett1-0/+254
This should make schema manipulation a little easier to follow. Andrew Bartlett (This used to be commit 300ed83526e75d834bd23ddd1c1c26ebe2555e0f)