s4:objectguid LDB module - objectGUIDs cannot be specified on add operations
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 7 Nov 2010 19:09:51 +0000 (20:09 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 7 Nov 2010 20:30:16 +0000 (21:30 +0100)
source4/dsdb/samdb/ldb_modules/objectguid.c

index 28d253a0d165aee18c6fc73b075b080069665f50..497ef1863b62c946dad60fad764cfc62f891c63c 100644 (file)
@@ -128,6 +128,7 @@ static int objectguid_add(struct ldb_module *module, struct ldb_request *req)
        struct ldb_context *ldb;
        struct ldb_request *down_req;
        struct ldb_message *msg;
+       struct ldb_message_element *el;
        struct GUID guid;
        uint64_t seq_num;
        int ret;
@@ -143,8 +144,11 @@ static int objectguid_add(struct ldb_module *module, struct ldb_request *req)
                return ldb_next_request(module, req);
        }
 
-       if (ldb_msg_find_element(req->op.add.message, "objectGUID") != NULL) {
-               return ldb_next_request(module, req);
+       el = ldb_msg_find_element(req->op.add.message, "objectGUID");
+       if (el != NULL) {
+               ldb_set_errstring(ldb,
+                                 "objectguid: objectGUID must not be specified!");
+               return LDB_ERR_UNWILLING_TO_PERFORM;
        }
 
        ac = talloc(req, struct og_context);