s4-drs: having no SPNs to change is not an error
[ira/wip.git] / source4 / rpc_server / drsuapi / writespn.c
index 7c8ff3332b22f267ac7baa44730636e9a7f821a0..8e20c88fae7dc4fad5a41a9904956b660063ee0e 100644 (file)
@@ -103,6 +103,13 @@ WERROR dcesrv_drsuapi_DsWriteAccountSpn(struct dcesrv_call_state *dce_call, TALL
                                }
                                spn_count++;
                        }
+
+                       if (msg->num_elements == 0) {
+                               DEBUG(2,("No SPNs need changing on %s\n", ldb_dn_get_linearized(msg->dn)));
+                               r->out.res->res1.status = WERR_OK;
+                               return WERR_OK;
+                       }
+
                        for (i=0;i<msg->num_elements;i++) {
                                switch (req->operation) {
                                case DRSUAPI_DS_SPN_OPERATION_ADD: