s4-drsuapi Allow DsAddEntry of normal objects
[amitay/samba.git] / source4 / rpc_server / drsuapi / addentry.c
index 5f030a095113aafe353b4bc6412b3e0c9a17cd41..fc78b875c771e87c6b0e15d30f60ca9586098731 100644 (file)
@@ -61,11 +61,16 @@ static WERROR drsuapi_add_SPNs(struct drsuapi_bind_state *b_state,
                ret = ldb_search(b_state->sam_ctx, mem_ctx, &res,
                                 dn, LDB_SCOPE_BASE, attrs,
                                 "(objectClass=ntDSDSA)");
-               if (ret != LDB_SUCCESS || res->count < 1) {
+               if (ret != LDB_SUCCESS) {
                        DEBUG(0,(__location__ ": Failed to find dn '%s'\n", dn_string));
                        return WERR_DS_DRA_INTERNAL_ERROR;
                }
 
+               if (res->count < 1) {
+                       /* we only add SPNs for nTDSDSA objects */
+                       continue;
+               }
+
                ref_dn = samdb_result_dn(b_state->sam_ctx, mem_ctx, res->msgs[0], "serverReference", NULL);
                if (ref_dn == NULL) {
                        /* we only add SPNs for objects with a