s4-drsuapi Allow DsAddEntry of normal objects
authorAndrew Bartlett <abartlet@samba.org>
Fri, 26 Aug 2011 06:06:31 +0000 (16:06 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 26 Aug 2011 13:34:21 +0000 (15:34 +0200)
We previously only allowed objects of class ntDSDSA

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Aug 26 15:34:21 CEST 2011 on sn-devel-104

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