summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/schema_load.c
AgeCommit message (Collapse)AuthorFilesLines
2013-08-19samdb: Fix CID 1034910 Dereference before null checkVolker Lendecke1-3/+3
strncmp("tdb://", sam_name, 6) dereferences sam_name. Check for NULL before that. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-08-23s4-dsdb: Remove unused variablesAndrew Bartlett1-5/+0
2012-08-23s4-dsdb: Do not use a possibly-old loadparm context in schema reloadAndrew Bartlett1-7/+3
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
2012-08-17s4-dsdb: Ensure we always free tmp_ctx in schema refresh checkAndrew Bartlett1-0/+2
This was found based on a log provided by Ricky Nance <ricky.nance@weaubleau.k12.mo.us>. Thanks Ricky! In that log, over 2.5 days this particular allocation was repeated: 1715099 talloc_new: ../source4/dsdb/samdb/ldb_modules/schema_load.c:120 contains 0 bytes in 1 blocks Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Aug 17 06:21:18 CEST 2012 on sn-devel-104
2012-08-11s4-dsdb: Take more care in handling of global schema memoryAndrew Bartlett1-1/+3
This reworks dsdb_replicated_objects_commit() to have a proper local tmp_ctx and to be more careful about what schema is set (only setting a global schema if the original schema was global). In particular, the new working_schema is not given a talloc reference to the old schema. This ensures that the old schema can go away when no longer used. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Aug 11 10:31:57 CEST 2012 on sn-devel-104
2012-08-11s4-dsdb: Use only the replication USN for schema reload.Andrew Bartlett1-60/+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
2012-06-22s4-dsdb: Check for key SCHEMA_SEQ_NUM in metadata.tdb updatesMatthieu Patou1-2/+184
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.
2012-06-22s4-dsdb: Add/Update SCHEMA_SEQ_NUM key in the metadata.tdb after schemaUpdateNowMatthieu Patou1-2/+2
The idea is to signal to other process accessing the database that the schema was forced to be reloaded and so they should reload as well.
2012-06-22dsdb-schema: do not reload more often than schema_reload_intervalMatthieu Patou1-2/+37
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.
2012-04-18s4-schema: remove unused variableMatthieu Patou1-4/+0
2011-09-05s4-schema consolidate schema handlingAndrew Bartlett1-21/+5
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
2011-03-19source4/dsdb/samdb: Fix prototypes for all functions.Jelmer Vernooij1-1/+1
2011-01-17s4-dsdb: pass parent request to dsdb_module_*() functions Andrew Tridgell1-3/+5
this preserves the request hierarchy for dsdb_module_*() calls inside dsdb ldb modules Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-12-06s4-schema_load: Strip a pointless checkKamen Mazdrashki1-3/+1
If *schema is NULL, then dsdb_schema_from_ldb_results() call should have failed
2010-11-16s4-schema_load: Don't clean in_transaction flag until transaction is really ↵Kamen Mazdrashki1-7/+6
finished Autobuild-User: Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date: Tue Nov 16 11:00:35 UTC 2010 on sn-devel-104
2010-11-01s4-ldb: enable version checking in dsdb ldb modulesAndrew Tridgell1-0/+1
2010-11-01s4-dsdb: convert the rest of the ldb modules to the new module typeAndrew Tridgell1-1/+6
2010-09-25ldb: mark the location of a lot more ldb requestsAndrew Tridgell1-0/+1
2010-09-02s4:dsdb Don't reload the schema against OpenLDAP backendAndrew Bartlett1-3/+9
The schema should be considered read-only when we are using the OL backend, as we can't update the backend schema in real time anyway. Andrew Bartlett
2010-07-08s4-source4/dsdb/samdb/ldb_modules/schema_load.c Use DSDB_FLAG_NEXT_MODULE flagKamen Mazdrashki1-1/+2
2010-07-07s4-dsdb: use ldb_operr() in the dsdb codeAndrew Tridgell1-4/+2
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_load LDB module - fix a segfault condition on schema refreshMatthias Dieter Wallnöfer1-0/+5
The schema refresh operation itself starts requests from the top of the LDB modules stack (see call "dsdb_schema_set_attributes" - search operations). This doesn't work well when these do perform "dsdb_get_schema" calls. Since the new schema isn't marked as "refreshed" atm (but in fact it still is - we didn't terminate the reload/refresh yet) we could perform other calls to "dsdb_schema_refresh" and run into serious trouble (segfault).
2010-07-03s4:schema_load.c - jump to "failed" on an error conditionMatthias Dieter Wallnöfer1-3/+2
2010-07-02s4-source4/dsdb/samdb/ldb_modules/schema_load.c: Use DSDB_FLAG_NEXT_MODULE flagKamen Mazdrashki1-1/+2
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-05-18Finish removal of iconv_convenience in public API's.Jelmer Vernooij1-1/+0
2010-04-13Revert "s4:prefer "samdb_*_dn" basedn calls over the "ldb_get_*_dn" functions"Matthias Dieter Wallnöfer1-1/+1
We should use the "ldb_get_*_basedn" calls since they are available in the LDB library.
2010-04-10s4:schema Try to fix OpenLDAP backend after schema reload support.Andrew Bartlett1-4/+2
If we can't get @REPLCHANGED, default to a value of 0. Andrew Bartlett
2010-03-22s4:dsdb Add a shortcut sequence number for schema reloadsAndrew Bartlett1-14/+79
This uses the ldb sequence number, in a hope to detect an unchanged schema quicker. Andrew Bartlett
2010-03-22s4:dsdb Rework schema loading and add schema reloadingAndrew Bartlett1-105/+126
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 Change dsdb_get_schema() callers to use new talloc argumentAndrew Bartlett1-1/+1
This choses an appropriate talloc context to attach the schema too, long enough lived to ensure it does not go away before the operation compleates. Andrew Bartlett
2010-01-13s4:dsdb/schema_load: add a TODO about schema reloadingStefan Metzmacher1-1/+11
metze
2010-01-08s4-dsdb: improve error messages in schema and pdc_fsmo modulesAndrew Tridgell1-4/+4
We want to incorporate the error messages from the modules further down the stack.
2010-01-05s4:schema_load.c - TypoMatthias Dieter Wallnöfer1-1/+1
2009-11-17s4:dsdb Use the new flags to dsdb_module_search in schema_loadAndrew Bartlett1-1/+3
This loads the defaultObjectCategory DN as an extended DN, so we can apply it, with the associated GUID, when setting this on records in the objectClass module. Previously we would not store the extended DN components for objectCategory. Andrew Bartlett
2009-10-26s4-ldb: fixed request handling for schemaUpdateNow opAndrew Tridgell1-1/+1
2009-10-23s4:dsdb Split schema loading and schema data managementAndrew Bartlett1-0/+258
By splitting the module this way, we can load the schema at startup, after the partitions module is operational, but we leave the 'mess with details of entries in the partitions' module to operate only on the partitions module. Loading the schema later allows us to set the @ATTRIBUTES correctly on all the databases. Andrew Bartlett