summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema/schema_set.c
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2012-05-22 16:25:50 -0700
committerMatthieu Patou <mat@matws.net>2012-06-22 23:22:03 -0700
commit9374ee1ba1dc1df3d5cdab1755ca9bfac338a4ae (patch)
tree3b4fc97d82c4def0487ccbcca19554c7f337d250 /source4/dsdb/schema/schema_set.c
parent2d20a918db646e9e48f296a46f1d672563730e03 (diff)
downloadsamba-9374ee1ba1dc1df3d5cdab1755ca9bfac338a4ae.tar.gz
samba-9374ee1ba1dc1df3d5cdab1755ca9bfac338a4ae.tar.bz2
samba-9374ee1ba1dc1df3d5cdab1755ca9bfac338a4ae.zip
s4-schema: keep track of the timestamp of the most recently changed/created object
Diffstat (limited to 'source4/dsdb/schema/schema_set.c')
-rw-r--r--source4/dsdb/schema/schema_set.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index 8a4361058b..286a8a3f23 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -665,6 +665,8 @@ int dsdb_schema_fill_extended_dn(struct ldb_context *ldb, struct dsdb_schema *sc
WERROR dsdb_schema_set_el_from_ldb_msg(struct ldb_context *ldb, struct dsdb_schema *schema,
struct ldb_message *msg)
{
+ const char* tstring;
+ time_t ts;
if (samdb_find_attribute(ldb, msg,
"objectclass", "attributeSchema") != NULL) {
return dsdb_set_attribute_from_ldb(ldb, schema, msg);
@@ -672,7 +674,14 @@ WERROR dsdb_schema_set_el_from_ldb_msg(struct ldb_context *ldb, struct dsdb_sche
"objectclass", "classSchema") != NULL) {
return dsdb_set_class_from_ldb(schema, msg);
}
-
+ tstring = ldb_msg_find_attr_as_string(msg, "whenChanged", NULL);
+ /* keep a trace of the ts of the most recently changed object */
+ if (tstring) {
+ ts = ldb_string_to_time(tstring);
+ if (ts > schema->ts_last_change) {
+ schema->ts_last_change = ts;
+ }
+ }
/* Don't fail on things not classes or attributes */
return WERR_OK;
}
@@ -753,6 +762,7 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb,
goto failed;
}
+ schema->ts_last_change = 0;
/* load the attribute and class definitions out of df */
while ((ldif = ldb_ldif_read_string(ldb, &df))) {
talloc_steal(mem_ctx, ldif);