{
service->system_session_info = system_session(service->task->lp_ctx);
if (!service->system_session_info) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
return WERR_OK;
sdsa->partition = talloc_zero(sdsa, struct dreplsrv_partition);
if (!sdsa->partition) {
talloc_free(sdsa);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
sdsa->partition->dn = ldb_dn_copy(sdsa->partition, nc_dn);
if (!sdsa->partition->dn) {
talloc_free(sdsa);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
sdsa->partition->nc.dn = ldb_dn_alloc_linearized(sdsa->partition, nc_dn);
if (!sdsa->partition->nc.dn) {
talloc_free(sdsa);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
ret = dsdb_find_guid_by_dn(ldb, nc_dn, &sdsa->partition->nc.guid);
if (ret != LDB_SUCCESS) {
sdsa->repsFrom1->other_info = talloc_zero(sdsa, struct repsFromTo1OtherInfo);
if (!sdsa->repsFrom1->other_info) {
talloc_free(sdsa);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
sdsa->repsFrom1->other_info->dns_name = samdb_ntds_msdcs_dns_name(ldb,
&sdsa->repsFrom1->source_dsa_obj_guid);
if (!sdsa->repsFrom1->other_info->dns_name) {
talloc_free(sdsa);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
werr = dreplsrv_out_connection_attach(service, sdsa->repsFrom1, &sdsa->conn);
*/
op->source_dsa = talloc_reference(op, source);
if (!op->source_dsa) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
op->options = options;
subreq = dreplsrv_op_pull_source_send(op, s->task->event_ctx, op);
if (!subreq) {
- werr = WERR_NOMEM;
+ werr = WERR_NOT_ENOUGH_MEMORY;
goto failed;
}
{
service->system_session_info = system_session(service->task->lp_ctx);
if (service->system_session_info == NULL) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
return WERR_OK;
*/
tmp2 = talloc(dest_schema, struct dsdb_class);
if (tmp2 == NULL) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
*tmp2 = *cur_class;
DLIST_ADD(dest_schema->classes, tmp2);
*/
tmp2 = talloc(dest_schema, struct dsdb_attribute);
if (tmp2 == NULL) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
*tmp2 = *cur_attr;
DLIST_ADD(dest_schema->attributes, tmp2);
for (cur = first_object; cur; cur = cur->next_object) {
schema_list_item = talloc(frame, struct schema_list);
if (schema_list_item == NULL) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
schema_list_item->obj = cur;
working_schema = dsdb_schema_copy_shallow(mem_ctx, ldb, initial_schema);
if (!working_schema) {
DEBUG(0,(__location__ ": schema copy failed!\n"));
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
working_schema->resolving_in_progress = true;
TALLOC_CTX *tmp_ctx = talloc_new(objects);
if (!tmp_ctx) {
DEBUG(0,("Failed to start talloc\n"));
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
/* TODO: handle linked attributes */
objects = talloc_array(mem_ctx, struct ldb_message *,
num_objects);
if (objects == NULL) {
- status = WERR_NOMEM;
+ status = WERR_NOT_ENOUGH_MEMORY;
goto cancel;
}
struct drsuapi_DsReplicaObjectIdentifier2,
num_objects);
if (ids == NULL) {
- status = WERR_NOMEM;
+ status = WERR_NOT_ENOUGH_MEMORY;
goto cancel;
}
DEBUG(2, ("Could not parse principal: %s: %s\n",
name, smb_get_krb5_error_message(smb_krb5_context->krb5_context,
ret, mem_ctx)));
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
/* grab cifs/, http/ etc */
info1->status = DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY;
info1->dns_domain_name = talloc_strdup(mem_ctx, dns_name);
if (!info1->dns_domain_name) {
- wret = WERR_NOMEM;
+ wret = WERR_NOT_ENOUGH_MEMORY;
}
krb5_free_principal(smb_krb5_context->krb5_context, principal);
return wret;
new_princ = talloc_asprintf(mem_ctx, "%s/%s", new_service, dns_name);
if (!new_princ) {
krb5_free_principal(smb_krb5_context->krb5_context, principal);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
wret = DsCrackNameOneName(sam_ctx, mem_ctx, format_flags, format_offered, format_desired,
info1->status = DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY;
info1->dns_domain_name = talloc_strdup(mem_ctx, dns_name);
if (!info1->dns_domain_name) {
- wret = WERR_NOMEM;
+ wret = WERR_NOT_ENOUGH_MEMORY;
}
}
krb5_free_principal(smb_krb5_context->krb5_context, principal);
if (ret) {
free(unparsed_name_short);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
/* This may need to be extended for more userPrincipalName variations */
if (!result_filter || !domain_filter) {
free(unparsed_name_short);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
status = DsCrackNameOneFilter(sam_ctx, mem_ctx,
smb_krb5_context,
ldap_guid = ldap_encode_ndr_GUID(mem_ctx, &guid);
if (!ldap_guid) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
result_filter = talloc_asprintf(mem_ctx, "(objectGUID=%s)",
ldap_guid);
ldap_sid = ldap_encode_ndr_dom_sid(mem_ctx,
sid);
if (!ldap_sid) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
result_filter = talloc_asprintf(mem_ctx, "(objectSid=%s)",
ldap_sid);
&smb_krb5_context);
if (ret) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
/* Ensure we reject compleate junk first */
&unparsed_name);
if (ret) {
krb5_free_principal(smb_krb5_context->krb5_context, principal);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
krb5_free_principal(smb_krb5_context->krb5_context, principal);
&smb_krb5_context);
if (ret) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
ret = krb5_parse_name(smb_krb5_context->krb5_context, name, &principal);
KRB5_PRINCIPAL_UNPARSE_NO_REALM, &unparsed_name_short);
if (ret) {
krb5_free_principal(smb_krb5_context->krb5_context, principal);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
component = krb5_princ_component(smb_krb5_context->krb5_context,
if (computer_name == NULL) {
krb5_free_principal(smb_krb5_context->krb5_context, principal);
free(unparsed_name_short);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
result_filter = talloc_asprintf(mem_ctx, "(|(&(servicePrincipalName=%s)(objectClass=user))(&(cn=%s)(objectClass=computer)))",
info1->status = DRSUAPI_DS_NAME_STATUS_OK;
info1->result_name = cracked;
if (!cracked) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
return WERR_OK;
&guid_str_buf);
filter = talloc_asprintf(ar, "(objectGUID=%s)", tmp_str);
- if (!filter) return replmd_replicated_request_werror(ar, WERR_NOMEM);
+ if (!filter) return replmd_replicated_request_werror(ar, WERR_NOT_ENOUGH_MEMORY);
ret = ldb_build_search_req(&search_req,
ldb,
"Failed to form conflict DN for %s\n",
ldb_dn_get_linearized(msg->dn));
- return replmd_replicated_request_werror(ar, WERR_NOMEM);
+ return replmd_replicated_request_werror(ar, WERR_NOT_ENOUGH_MEMORY);
}
ret = dsdb_module_rename(ar->module, ar->search_msg->dn, new_dn,
nmd.ctr.ctr1.array = talloc_array(ar,
struct replPropertyMetaData1,
nmd.ctr.ctr1.count);
- if (!nmd.ctr.ctr1.array) return replmd_replicated_request_werror(ar, WERR_NOMEM);
+ if (!nmd.ctr.ctr1.array) return replmd_replicated_request_werror(ar, WERR_NOT_ENOUGH_MEMORY);
/* first copy the old meta data */
for (i=0; i < omd.ctr.ctr1.count; i++) {
&guid_str_buf);
filter = talloc_asprintf(ar, "(objectGUID=%s)", tmp_str);
- if (!filter) return replmd_replicated_request_werror(ar, WERR_NOMEM);
+ if (!filter) return replmd_replicated_request_werror(ar, WERR_NOT_ENOUGH_MEMORY);
ret = ldb_build_search_req(&search_req,
ldb,
nuv.ctr.ctr2.cursors = talloc_array(ar,
struct drsuapi_DsReplicaCursor2,
nuv.ctr.ctr2.count);
- if (!nuv.ctr.ctr2.cursors) return replmd_replicated_request_werror(ar, WERR_NOMEM);
+ if (!nuv.ctr.ctr2.cursors) return replmd_replicated_request_werror(ar, WERR_NOT_ENOUGH_MEMORY);
/* first copy the old vector */
for (i=0; i < ouv.ctr.ctr2.count; i++) {
* create the change ldb_message
*/
msg = ldb_msg_new(ar);
- if (!msg) return replmd_replicated_request_werror(ar, WERR_NOMEM);
+ if (!msg) return replmd_replicated_request_werror(ar, WERR_NOT_ENOUGH_MEMORY);
msg->dn = ar->search_msg->dn;
ndr_err = ndr_push_struct_blob(&nuv_value, msg, &nuv,
struct repsFromToBlob *trf;
trf = talloc(ar, struct repsFromToBlob);
- if (!trf) return replmd_replicated_request_werror(ar, WERR_NOMEM);
+ if (!trf) return replmd_replicated_request_werror(ar, WERR_NOT_ENOUGH_MEMORY);
ndr_err = ndr_pull_struct_blob(&orf_el->values[i], trf, trf,
(ndr_pull_flags_fn_t)ndr_pull_repsFromToBlob);
if (req->controls) {
req->controls = talloc_memdup(ar, req->controls,
talloc_get_size(req->controls));
- if (!req->controls) return replmd_replicated_request_werror(ar, WERR_NOMEM);
+ if (!req->controls) return replmd_replicated_request_werror(ar, WERR_NOT_ENOUGH_MEMORY);
}
ret = ldb_request_add_control(req, DSDB_CONTROL_REPLICATED_UPDATE_OID, false, NULL);
schema_info = talloc(mem_ctx, struct dsdb_schema_info);
if (!schema_info) {
talloc_free(temp_ctx);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
/* note that we accept revision numbers of zero now - w2k8r2
msg = ldb_msg_new(temp_ctx);
if (!msg) {
talloc_free(temp_ctx);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
msg->dn = schema_dn;
if (ldb_ret != 0) {
talloc_free(temp_ctx);
DEBUG(0,("dsdb_write_prefixes_from_schema_to_ldb: ldb_msg_add_value failed\n"));
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
ldb_ret = dsdb_replace(ldb, msg, DSDB_FLAG_AS_SYSTEM);
get_string_val->length); \
if (!(p)->elem) { \
d_printf("%s: talloc_strndup failed for %s\n", __location__, attr); \
- return WERR_NOMEM; \
+ return WERR_NOT_ENOUGH_MEMORY; \
} \
} \
} while (0)
get_string_list_el->values[get_string_list_counter].length); \
if (!(p)->elem[get_string_list_counter]) { \
d_printf("%s: talloc_strndup failed for %s\n", __location__, attr); \
- return WERR_NOMEM; \
+ return WERR_NOT_ENOUGH_MEMORY; \
} \
(p)->elem[get_string_list_counter+1] = NULL; \
} \
(p)->elem = talloc(mem_ctx, uint32_t); \
if (!(p)->elem) { \
d_printf("%s: talloc failed for %s\n", __location__, attr); \
- return WERR_NOMEM; \
+ return WERR_NOT_ENOUGH_MEMORY; \
} \
*(p)->elem = (uint32_t)_v; \
} \
WERROR status;
struct dsdb_attribute *attr = talloc_zero(schema, struct dsdb_attribute);
if (!attr) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
status = dsdb_attribute_from_ldb(schema, msg, attr);
a = talloc_realloc(schema, schema->attributes_to_remove,
struct dsdb_attribute *, i + 1);
if (a == NULL) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
/* Mark the old attribute as to be removed */
a[i] = discard_const_p(struct dsdb_attribute, a2);
WERROR status;
struct dsdb_class *obj = talloc_zero(schema, struct dsdb_class);
if (!obj) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
GET_STRING_LDB(msg, "cn", obj, obj, cn, false);
c = talloc_realloc(schema, schema->classes_to_remove,
struct dsdb_class *, i + 1);
if (c == NULL) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
/* Mark the old class to be removed */
c[i] = discard_const_p(struct dsdb_class, c2);
prefixes_new = talloc_realloc(pfm, pfm->prefixes, struct dsdb_schema_prefixmap_oid, pfm->length + 1);
if (!prefixes_new) {
talloc_free(bin_oid.data);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
pfm->prefixes = prefixes_new;
ctr->mappings[i].oid.length);
if (!blob.data) {
talloc_free(pfm);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
pfm->prefixes[i].id = ctr->mappings[i].id_prefix;
pfm->prefixes[i].bin_oid = blob;
ctr->mappings = talloc_array(ctr, struct drsuapi_DsReplicaOIDMapping, ctr->num_mappings);
if (!ctr->mappings) {
talloc_free(ctr);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
/* copy entries from schema_prefixMap */
blob = data_blob_dup_talloc(ctr, pfm->prefixes[i].bin_oid);
if (!blob.data) {
talloc_free(ctr);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
ctr->mappings[i].id_prefix = pfm->prefixes[i].id;
ctr->mappings[i].oid.length = blob.length;
attr_list = talloc_realloc(mem_ctx, attr_list, const char *, i+2);
if (!attr_list) {
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
attr_list[i] = cur->lDAPDisplayName;
i++;
goto done;
nomem:
- status = WERR_NOMEM;
+ status = WERR_NOT_ENOUGH_MEMORY;
failed:
done:
talloc_free(mem_ctx);
dn2 = ldb_dn_copy(tmp_ctx, dn);
if (dn == NULL) {
talloc_free(tmp_ctx);
- return WERR_NOMEM;
+ return WERR_NOT_ENOUGH_MEMORY;
}
num_components = ldb_dn_get_comp_num(dn);