s4:objectclass_attrs LDB module - simplify the invoke of the "dSHeuristics" checker
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 3 Nov 2010 15:21:37 +0000 (16:21 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 3 Nov 2010 15:36:42 +0000 (16:36 +0100)
It's always invoked on add and modify operations.

source4/dsdb/samdb/ldb_modules/objectclass_attrs.c

index 120357cf9ec4b0f793f2c228409ecfcc585b1e92..f609e9210b56457f8f55110da310a4db70a46b8f 100644 (file)
@@ -200,14 +200,15 @@ static int attr_handler(struct oc_context *ac)
                                talloc_free(res);
                        }
                }
-/* dSHeuristics syntax check */
-               if ((ac->req->operation == LDB_ADD || ac->req->operation == LDB_MODIFY) &&
-                   (ldb_attr_cmp(attr->lDAPDisplayName, "dSHeuristics") == 0)) {
+
+               /* "dSHeuristics" syntax check */
+               if (ldb_attr_cmp(attr->lDAPDisplayName, "dSHeuristics") == 0) {
                        ret = oc_validate_dsheuristics(&(msg->elements[i]));
                        if (ret != LDB_SUCCESS) {
                                return ret;
                        }
                }
+
                /* Substitute the attribute name to match in case */
                msg->elements[i].name = attr->lDAPDisplayName;
        }