1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

28 Commits

Author SHA1 Message Date
Matthieu Patou
1521bb95a7 dsdb-schema: do not reload more often than schema_reload_interval
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-06-22 23:16:04 -07:00
Matthieu Patou
9887d390b1 s4-schema: remove unused variable 2012-04-18 00:07:01 +02:00
Andrew Bartlett
1afeb4e391 s4-schema consolidate schema handling
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-09-05 11:19:25 +02:00
Jelmer Vernooij
8b271e4328 source4/dsdb/samdb: Fix prototypes for all functions. 2011-03-19 03:20:05 +01:00
Andrew Tridgell
87f3151047 s4-dsdb: pass parent request to dsdb_module_*() functions
this preserves the request hierarchy for dsdb_module_*() calls inside
dsdb ldb modules

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-01-17 05:23:04 +01:00
Kamen Mazdrashki
be27a9dc42 s4-schema_load: Strip a pointless check
If *schema is NULL, then dsdb_schema_from_ldb_results()
call should have failed
2010-12-06 00:18:47 +02:00
Kamen Mazdrashki
cce662763e s4-schema_load: Don't clean in_transaction flag until transaction is really finished
Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Tue Nov 16 11:00:35 UTC 2010 on sn-devel-104
2010-11-16 11:00:35 +00:00
Andrew Tridgell
9103047782 s4-ldb: enable version checking in dsdb ldb modules 2010-11-01 13:05:04 +00:00
Andrew Tridgell
7eb2eed156 s4-dsdb: convert the rest of the ldb modules to the new module type 2010-11-01 18:55:19 +11:00
Andrew Tridgell
85ba79063f ldb: mark the location of a lot more ldb requests 2010-09-25 10:38:45 -07:00
Andrew Bartlett
379d073444 s4:dsdb Don't reload the schema against OpenLDAP backend
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-09-02 10:40:34 +10:00
Kamen Mazdrashki
8c7a6a8dc7 s4-source4/dsdb/samdb/ldb_modules/schema_load.c Use DSDB_FLAG_NEXT_MODULE flag 2010-07-08 02:38:32 +03:00
Andrew Tridgell
87df785a68 s4-dsdb: use ldb_operr() in the dsdb code
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-07 20:14:55 +10:00
Matthias Dieter Wallnöfer
326aac06f5 s4:schema_load LDB module - fix a segfault condition on schema refresh
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-03 15:28:57 +02:00
Matthias Dieter Wallnöfer
de81160e75 s4:schema_load.c - jump to "failed" on an error condition 2010-07-03 12:35:16 +02:00
Kamen Mazdrashki
bf373d5c29 s4-source4/dsdb/samdb/ldb_modules/schema_load.c: Use DSDB_FLAG_NEXT_MODULE flag
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-02 10:07:57 +10:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Matthias Dieter Wallnöfer
ad9e407357 Revert "s4:prefer "samdb_*_dn" basedn calls over the "ldb_get_*_dn" functions"
We should use the "ldb_get_*_basedn" calls since they are available in the LDB
library.
2010-04-13 08:55:15 +02:00
Andrew Bartlett
4074739fe7 s4:schema Try to fix OpenLDAP backend after schema reload support.
If we can't get @REPLCHANGED, default to a value of 0.

Andrew Bartlett
2010-04-10 21:40:59 +10:00
Andrew Bartlett
f8019ff793 s4:dsdb Add a shortcut sequence number for schema reloads
This uses the ldb sequence number, in a hope to detect an unchanged
schema quicker.

Andrew Bartlett
2010-03-22 20:24:41 +11:00
Andrew Bartlett
fe3e1af901 s4:dsdb Rework schema loading and add schema reloading
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-22 20:24:41 +11:00
Andrew Bartlett
2de07761e0 s4:dsdb Change dsdb_get_schema() callers to use new talloc argument
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-03-16 19:26:03 +11:00
Stefan Metzmacher
f715414afa s4:dsdb/schema_load: add a TODO about schema reloading
metze
2010-01-13 16:03:53 +01:00
Andrew Tridgell
c4fa4d1162 s4-dsdb: improve error messages in schema and pdc_fsmo modules
We want to incorporate the error messages from the modules further
down the stack.
2010-01-08 13:03:03 +11:00
Matthias Dieter Wallnöfer
c051008540 s4:schema_load.c - Typo 2010-01-05 20:55:46 +01:00
Andrew Bartlett
6710becbd4 s4:dsdb Use the new flags to dsdb_module_search in schema_load
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-11-17 10:38:01 +11:00
Andrew Tridgell
a4f86c07e5 s4-ldb: fixed request handling for schemaUpdateNow op 2009-10-26 08:38:03 +11:00
Andrew Bartlett
e5b86d2674 s4:dsdb Split schema loading and schema data management
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
2009-10-23 15:41:00 +11:00