/*
*/
werror = dns_lookup_records(dns, mem_ctx, dn, &ans, &acount);
+ if (W_ERROR_EQUAL(werror, WERR_DNS_ERROR_NAME_DOES_NOT_EXIST)) {
+ return DNS_ERR(NAME_ERROR);
+ }
W_ERROR_NOT_OK_RETURN(werror);
if (acount == 0) {
/*
*/
werror = dns_lookup_records(dns, mem_ctx, dn, &ans, &acount);
+ if (W_ERROR_EQUAL(werror, WERR_DNS_ERROR_NAME_DOES_NOT_EXIST)) {
+ return DNS_ERR(NXRRSET);
+ }
if (W_ERROR_EQUAL(werror, DNS_ERR(NAME_ERROR))) {
return DNS_ERR(NXRRSET);
}
/*
*/
werror = dns_lookup_records(dns, mem_ctx, dn, &ans, &acount);
+ if (W_ERROR_EQUAL(werror, WERR_DNS_ERROR_NAME_DOES_NOT_EXIST)) {
+ werror = WERR_OK;
+ }
if (W_ERROR_EQUAL(werror, DNS_ERR(NAME_ERROR))) {
werror = WERR_OK;
- ans = NULL;
- acount = 0;
}
for (i = 0; i < acount; i++) {
*final_result = false;
werror = dns_lookup_records(dns, mem_ctx, dn, &ans, &acount);
+ if (W_ERROR_EQUAL(werror, WERR_DNS_ERROR_NAME_DOES_NOT_EXIST)) {
+ return DNS_ERR(NXRRSET);
+ }
if (W_ERROR_EQUAL(werror, DNS_ERR(NAME_ERROR))) {
return DNS_ERR(NXRRSET);
}
W_ERROR_NOT_OK_RETURN(werror);
werror = dns_lookup_records(dns, mem_ctx, dn, &recs, &rcount);
- if (W_ERROR_EQUAL(werror, DNS_ERR(NAME_ERROR))) {
- recs = NULL;
- rcount = 0;
+ if (W_ERROR_EQUAL(werror, WERR_DNS_ERROR_NAME_DOES_NOT_EXIST)) {
needs_add = true;
werror = WERR_OK;
}
+ if (W_ERROR_EQUAL(werror, DNS_ERR(NAME_ERROR))) {
+ werror = WERR_OK;
+ }
W_ERROR_NOT_OK_RETURN(werror);
if (update->rr_class == zone->question_class) {
struct ldb_message *msg = NULL;
struct dnsp_DnssrvRpcRecord *recs;
+ *records = NULL;
+ *rec_count = 0;
+
ret = dsdb_search_one(dns->samdb, mem_ctx, &msg, dn,
LDB_SCOPE_BASE, attrs, 0, "%s", "(objectClass=dnsNode)");
+ if (ret == LDB_ERR_NO_SUCH_OBJECT) {
+ return WERR_DNS_ERROR_NAME_DOES_NOT_EXIST;
+ }
if (ret != LDB_SUCCESS) {
/* TODO: we need to check if there's a glue record we need to
* create a referral to */
el = ldb_msg_find_element(msg, attrs[0]);
if (el == NULL) {
- *records = NULL;
- *rec_count = 0;
return DNS_ERR(NAME_ERROR);
}
if (needs_add) {
return WERR_OK;
}
- /* No entries left, delete the dnsNode object */
- ret = ldb_delete(dns->samdb, msg->dn);
- if (ret != LDB_SUCCESS) {
- DEBUG(0, ("Deleting record failed; %d\n", ret));
- return DNS_ERR(SERVER_FAILURE);
- }
- return WERR_OK;
+ /* TODO: Delete object? */
+ el->flags = LDB_FLAG_MOD_DELETE;
}
if (needs_add) {