s4:dsdb Return correct error on invalid attribute
authorAndrew Bartlett <abartlet@samba.org>
Fri, 25 Sep 2009 23:40:30 +0000 (16:40 -0700)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Fri, 2 Oct 2009 15:57:12 +0000 (17:57 +0200)
This error per the Microsoft testsuite

source4/dsdb/samdb/ldb_modules/objectclass.c

index cc88d6b96d0d6ac16c1807f5efaa3ecd1b7111d0..6d22141a3beaae9b4c9a79f27890183cff061383 100644 (file)
@@ -361,7 +361,8 @@ static int fix_attributes(struct ldb_context *ldb, const struct dsdb_schema *sch
                if (!attribute) {
                        if (strcasecmp(msg->elements[i].name, "clearTextPassword") != 0) {
                                ldb_asprintf_errstring(ldb, "attribute %s is not a valid attribute in schema", msg->elements[i].name);
                if (!attribute) {
                        if (strcasecmp(msg->elements[i].name, "clearTextPassword") != 0) {
                                ldb_asprintf_errstring(ldb, "attribute %s is not a valid attribute in schema", msg->elements[i].name);
-                               return LDB_ERR_UNDEFINED_ATTRIBUTE_TYPE;
+                               /* Apparently Windows sends exactly this behaviour */
+                               return LDB_ERR_NO_SUCH_ATTRIBUTE;
                        }
                } else {
                        msg->elements[i].name = attribute->lDAPDisplayName;
                        }
                } else {
                        msg->elements[i].name = attribute->lDAPDisplayName;