s4:samldb LDB module - deny "objectSid" modifications
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 31 Oct 2010 21:31:53 +0000 (22:31 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 1 Nov 2010 11:34:21 +0000 (12:34 +0100)
The same as with Windows

source4/dsdb/samdb/ldb_modules/samldb.c

index 2b3129cd998d530bbe87f05513b1c04edbed9902..89fa6b23e187250713c8ddb29e1aa9849ff0ef2e 100644 (file)
@@ -1768,6 +1768,13 @@ static int samldb_modify(struct ldb_module *module, struct ldb_request *req)
 
        ldb = ldb_module_get_ctx(module);
 
+       /* make sure that "objectSid" is not specified */
+       el = ldb_msg_find_element(req->op.mod.message, "objectSid");
+       if (el != NULL) {
+               ldb_set_errstring(ldb,
+                                 "samldb: objectSid must not be specified!");
+               return LDB_ERR_UNWILLING_TO_PERFORM;
+       }
        /* make sure that "sAMAccountType" is not specified */
        el = ldb_msg_find_element(req->op.mod.message, "sAMAccountType");
        if (el != NULL) {