summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema/schema_init.c
AgeCommit message (Collapse)AuthorFilesLines
2010-01-08s4-schema: added some debug for bad attributesAndrew Tridgell1-0/+8
2010-01-08s4/dsdb_schema: Load msDS-IntId value separately when loading from LDBKamen Mazdrashki1-0/+3
This way we have consistent behavior when loading from DRSUAPI and from LDB.
2010-01-08Revert "s4-schema: Set ATTID in schema cache from "msDS-IntId""Kamen Mazdrashki1-13/+8
This reverts commit 4e8ad284f5813413fdec8426f11e24570d22549b.
2010-01-08s4/dsdb_schema: fetch msDS-IntId value during SCHEMA replicationKamen Mazdrashki1-0/+4
2010-01-08s4/dsdb_schema: GET_UINT32_DS() macro to use supplied default value instead of 0Kamen Mazdrashki1-14/+14
2009-12-21s4-drs: Save prefix map using LDB_CONTROL_AS_SYSTEM controlKamen Mazdrashki1-1/+1
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-21s4-schema: Set ATTID in schema cache from "msDS-IntId"Kamen Mazdrashki1-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>
2009-12-10s4-dsdb: simplify schema code using new GUID functionsAndrew Tridgell1-6/+2
2009-11-17s4:dsdb Load objectGUID and extended DN defaultObjectCategory into the schemaAndrew Bartlett1-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
2009-11-12s4:dsdb/schema Simplify schema loading from ldb messagesAndrew Bartlett1-62/+47
It turns out that we always add the class/attribute to the schema.
2009-11-06s4/drs: Refactor to be more SAMBA.Coding style compliantKamen Mazdrashki1-1/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: Remove unused structures and functionsKamen Mazdrashki1-88/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: remove unused num_prefixes and prefixes from dsdb_schemaKamen Mazdrashki1-3/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: dsdb_create_prefix_mapping() refactoredKamen Mazdrashki1-11/+9
TODO: this function may be refactored further. Actually we don't need to look up for the OID supplied, but just call sdb_schema_pfm_make_attid() - it will search for the OID anyway and add it if necessary Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: dsdb_write_prefixes_from_schema_to_ldb() refactoredKamen Mazdrashki1-39/+35
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: dsdb_read_prefixes_from_ldb() refactoredKamen Mazdrashki1-54/+13
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: refactor dsdb_load_oid_mappings_ldb() to use ↵Kamen Mazdrashki1-33/+29
_dsdb_prefixmap_from_ldb_val() Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: Load prefixMap from ldb_val moved in separate functionKamen Mazdrashki1-0/+35
It is to be used later in several places when we need such conversion. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: dsdb_schema_pfm_from_drsuapi_pfm() to accept partial drsuapi_prefixMapKamen Mazdrashki1-1/+1
"partial drsuapi_prefixMap" is a prefix map without last entry being special - i.e. map that does not contains schema_info entry. Test for dsdb_schema_pfm_from_drsuapi_pfm() were also extended to cover both 'full' and 'partial' map conversion. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: dsdb_map_int2oid() replaced by dsdb_schema_pfm_oid_from_attid()Kamen Mazdrashki1-25/+6
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: dsdb_map_oid2int() replaced by dsdb_schema_pfm_make_attid()Kamen Mazdrashki1-12/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: dsdb_verify_oid_mappings_drsuapi() replaced by ↵Kamen Mazdrashki1-71/+0
dsdb_schema_pfm_contains_drsuapi_pfm() dsdb_schema_pfm_contains_drsuapi_pfm() is part of reimplemented prefixMap interface. This name was choosen to clearly show, that this a week verification in case we want to determine if remote schema is changed. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: dsdb_get_oid_mappings_drsuapi() to use new prefixMap interfaceKamen Mazdrashki1-34/+3
dsdb_get_oid_mappings_drsuapi() just need to call dsdb_drsuapi_pfm_from_schema_pfm() to get filled-in DRSUAPI prefixMap. Perhaps it won't be bad to rename this function to have more expressive name in the future Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-06s4/drs: dsdb_load_oid_mappings_drsuapi() -> dsdb_load_prefixmap_from_drsuapi()Kamen Mazdrashki1-52/+13
Also, dsdb_load_oid_mappings_drsuapi() was reimplemented to use dsdb_schema_pfm_from_drsuapi_pfm() function to load drsuapi_prefixMap into schema->prefixmap Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-10-16s4/drs: Propagate redefinition of drsuapi_DsReplicaOID into code baseKamen Mazdrashki1-61/+105
The biggest change is that 'oid' field is transmited in binary format. Also the field name is changed to 'binary_oid' so that field format to be clear for callers. After those changes, Samba4 should work the way it works before - i.e. no added value here but we should not fail when partial-oid is part of prefixMap transmited from Win server. Also, thre is a bug in this patch - partial-binary-OIDs are not handled correctly. Partial-binary-OIDs received during replication will be encoded, but not handled correctly.
2009-10-12s4:dsdb Make dsdb_read_prefixes_from_ldb staticAndrew Bartlett1-1/+3
2009-10-12s4:dsdb Search for the schema with dsdb_module_search(), in schema_fsmoAndrew Bartlett1-110/+1
This avoids using an ldb_search(), which would run from the top of the module stack. This will help us load the schema before the partitions are initialised. Andrew Bartlett
2009-09-22s4-ldb: added a bunch more debug for DC joinAndrew Tridgell1-0/+4
These additional debug messages were added to help us track down w2k8->s4 domain join
2009-09-21s4:ldb Add 'single-value' support to LDB.Andrew Bartlett1-0/+4
This is currently only triggered via Samba4's schema code.
2009-09-21s4-schema: don't trace the schema load (too verbose)Andrew Tridgell1-12/+24
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-26s4:schema Rework dsdb_write_prefixes_from_schema_to_ldb() to use tallocAndrew Bartlett1-14/+20
This changes dsdb_write_prefixes_from_schema_to_ldb() to use an internal talloc hirarchy, so we can safely give it a NULL context from the python. It also fixes manual construction of the ldb_message - we now use the right helper functions. Andrew Bartlett
2009-08-26s4:scheam quiet a 'const' warningAndrew Bartlett1-1/+1
2009-08-26s4:dsdb Rework dsdb_write_prefixes_to_ldb() to take a schemaAndrew Bartlett1-14/+13
The aim is to create a function that is more easily wrapped for python, so that we can write the updated prefixMap in an upgrade script. Andrew Bartlett
2009-08-24s4:dsdb use talloc_strndup() in GET_STRING_LDB() rather than walk off the endAndrew Bartlett1-7/+17
The problem is that samdb_result_string() and ldb_msg_find_attr_as_string() both simply cast the string, rather than ensuring the return value is NULL terminated. This may be best regarded as a flaw in LDB, but fixing it there is going to be more difficult. Andrew Bartlett
2009-08-17make sure we update the current schema->prefixes when we add a new prefixAndrew Tridgell1-0/+9
This triggered a failure in the updateNow schema test, as the current global schema was not being updated when a new schema element was added
2009-07-08Fix for schemaUpdateNow commandAnatoliy Atanasov1-1/+1
2009-07-02we can't use the unique index code for samAccountNameAndrew Tridgell1-1/+1
Using ldb unique indexes for samAccountName doesn't work with DRS as the other DC may send us a deleted record (tombstone record), which has the same samAccountName as an existing record. That would then create two records in the same partition with the same samAccountName. So we needed to put back the logic in samldb.c which explicitly checked whether a samAccountName already exists on add
2009-07-02fixed the pull of drs schema elementsAndrew Tridgell1-33/+20
The previous code incorrectly assumed that attributes such as subClassOf come over the wire as strings. In fact they come over as 32 bit integers which refer to goversIDs. We have to post-process these as it sometimes happens that a governsID comes over the wire before the record that defines what it means.
2009-06-01mark samAccountName, objectGUID and objectSID as unique indexedAndrew Tridgell1-0/+20
2009-04-02major upgrade to the ldb attribute handlingAndrew Tridgell1-3/+56
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-31possibleInferiors is a generated attribute - we can't pull it over DRSAndrew Tridgell1-2/+0
or from ldb
2009-03-11s4:schema Don't rely on objectCategory 'magic' when loading the schemaAndrew Bartlett1-2/+2
The short-to-long name canonicalisation rules use the schema, so clearly they won't work when loading it. Andrew Bartlett
2009-03-06Load the schema with a more efficient single searchAndrew Bartlett1-93/+15
This search uses the index, and is not recursive, so should avoid the major performance problem with the current sorted schema load. The ad2oLschema code (recently moved to provision-backend) no longer needs the schema to be sorted. Andrew Bartlett
2009-03-04Pull in all the schema information during DRS schema fetchAndrew Bartlett1-9/+38
This includes things such as allowed attributes, which were not populated into the schema structure before. Andrew Bartlett
2009-03-01s4: Use same function signature for convert_* as s3.Jelmer Vernooij1-4/+3
2009-03-01Add allow_badcharcnv argument to all conversion function, forJelmer Vernooij1-1/+1
consistency with Samba 3.
2008-11-16s4:dsdb/schema: use pointers for rangeLower and rangeUpper.Stefan Metzmacher1-4/+39
This makes clear there's an value stored in the schema, as they can be '0'. metze
2008-10-24Remove iconv_convenience argument from convert_string{,talloc}() butJelmer Vernooij1-1/+1
make them wrappers around convert_string{,talloc}_convenience().
2008-10-18Add TALLOC_CTX pointer to strhex_to_data_blob for consistency with SambaJelmer Vernooij1-4/+2
3.