diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-11-24 10:22:10 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-11-24 10:41:15 +1100 |
commit | dcee196f3e5d5673282aaa19fbbb7696d2c1aa0a (patch) | |
tree | ee37ce5f952e231eb65b9ef56954a4f889a3cd58 /source4/dsdb/samdb/ldb_modules | |
parent | cec473e72826af09fdf84eee2731ad0c2b193dfc (diff) | |
download | samba-dcee196f3e5d5673282aaa19fbbb7696d2c1aa0a.tar.gz samba-dcee196f3e5d5673282aaa19fbbb7696d2c1aa0a.tar.bz2 samba-dcee196f3e5d5673282aaa19fbbb7696d2c1aa0a.zip |
s4:operational LDB module - Prevent the modification of operational attributes
(merged by Andrew Bartlett)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/operational.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c index e48f91bac0..46d4745068 100644 --- a/source4/dsdb/samdb/ldb_modules/operational.c +++ b/source4/dsdb/samdb/ldb_modules/operational.c @@ -434,8 +434,24 @@ static int operational_init(struct ldb_module *ctx) return LDB_SUCCESS; } +static int operational_modify(struct ldb_module *module, struct ldb_request *req) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(search_sub); i++) { + if (ldb_msg_find_element(req->op.mod.message, search_sub[i].attr) != NULL) { + /* operational attributes cannot be changed! */ + return LDB_ERR_CONSTRAINT_VIOLATION; + } + } + + /* No operational attribute will be changed -> go on */ + return ldb_next_request(module, req); +} + const struct ldb_module_ops ldb_operational_module_ops = { .name = "operational", .search = operational_search, + .modify = operational_modify, .init_context = operational_init }; |