mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
werror: replace WERR_NOMEM with WERR_NOT_ENOUGH_MEMORY in source3/lib/netapi/
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
29b9b1c04d
commit
db1c5d721b
@ -86,7 +86,7 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
|
||||
|
||||
auth_info = user_auth_info_init(ctx);
|
||||
if (!auth_info) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
auth_info->signing_state = SMB_SIGNING_IPC_DEFAULT;
|
||||
set_cmdline_auth_info_use_kerberos(auth_info, ctx->use_kerberos);
|
||||
@ -126,7 +126,7 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
|
||||
|
||||
p = talloc_zero(ctx, struct client_ipc_connection);
|
||||
if (p == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
p->cli = cli_ipc;
|
||||
|
@ -69,7 +69,7 @@ WERROR NetGetDCName_r(struct libnetapi_ctx *ctx,
|
||||
}
|
||||
|
||||
if (NetApiBufferAllocate(strlen_m_term(dcname), &buffer)) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
memcpy(buffer, dcname, strlen_m_term(dcname));
|
||||
@ -122,7 +122,7 @@ WERROR NetGetAnyDCName_r(struct libnetapi_ctx *ctx,
|
||||
}
|
||||
|
||||
if (NetApiBufferAllocate(strlen_m_term(dcname), &buffer)) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
memcpy(buffer, dcname, strlen_m_term(dcname));
|
||||
|
@ -722,7 +722,7 @@ static WERROR map_group_info_to_buffer(TALLOC_CTX *mem_ctx,
|
||||
break;
|
||||
case 3:
|
||||
if (!sid_compose(&sid, domain_sid, rid)) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
info3.grpi3_name = info->name.string;
|
||||
@ -1315,7 +1315,7 @@ static WERROR convert_samr_disp_groups_to_GROUP_INFO_3_buffer(TALLOC_CTX *mem_ct
|
||||
struct dom_sid sid;
|
||||
|
||||
if (!sid_compose(&sid, domain_sid, groups->entries[i].rid)) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
g3[i].grpi3_name = talloc_strdup(mem_ctx,
|
||||
@ -1824,7 +1824,7 @@ WERROR NetGroupSetUsers_r(struct libnetapi_ctx *ctx,
|
||||
|
||||
lsa_names = talloc_array(ctx, struct lsa_String, r->in.num_entries);
|
||||
if (!lsa_names) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -361,7 +361,7 @@ WERROR NetGetJoinInformation_l(struct libnetapi_ctx *ctx,
|
||||
*r->out.name_buffer = talloc_strdup(ctx, lp_workgroup());
|
||||
}
|
||||
if (!*r->out.name_buffer) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
switch (lp_server_role()) {
|
||||
|
@ -39,7 +39,7 @@ static NET_API_STATUS libnetapi_init_private_context(struct libnetapi_ctx *ctx)
|
||||
|
||||
priv = talloc_zero(ctx, struct libnetapi_private_ctx);
|
||||
if (!priv) {
|
||||
return W_ERROR_V(WERR_NOMEM);
|
||||
return W_ERROR_V(WERR_NOT_ENOUGH_MEMORY);
|
||||
}
|
||||
|
||||
ctx->private_data = priv;
|
||||
@ -108,7 +108,7 @@ NET_API_STATUS libnetapi_net_init(struct libnetapi_ctx **context)
|
||||
ctx = talloc_zero(frame, struct libnetapi_ctx);
|
||||
if (!ctx) {
|
||||
TALLOC_FREE(frame);
|
||||
return W_ERROR_V(WERR_NOMEM);
|
||||
return W_ERROR_V(WERR_NOT_ENOUGH_MEMORY);
|
||||
}
|
||||
|
||||
BlockSignals(True, SIGPIPE);
|
||||
@ -121,7 +121,7 @@ NET_API_STATUS libnetapi_net_init(struct libnetapi_ctx **context)
|
||||
if (!ctx->username) {
|
||||
TALLOC_FREE(frame);
|
||||
fprintf(stderr, "libnetapi_init: out of memory\n");
|
||||
return W_ERROR_V(WERR_NOMEM);
|
||||
return W_ERROR_V(WERR_NOT_ENOUGH_MEMORY);
|
||||
}
|
||||
|
||||
status = libnetapi_init_private_context(ctx);
|
||||
@ -233,7 +233,7 @@ NET_API_STATUS libnetapi_set_username(struct libnetapi_ctx *ctx,
|
||||
ctx->username = talloc_strdup(ctx, username ? username : "");
|
||||
|
||||
if (!ctx->username) {
|
||||
return W_ERROR_V(WERR_NOMEM);
|
||||
return W_ERROR_V(WERR_NOT_ENOUGH_MEMORY);
|
||||
}
|
||||
return NET_API_STATUS_SUCCESS;
|
||||
}
|
||||
@ -244,7 +244,7 @@ NET_API_STATUS libnetapi_set_password(struct libnetapi_ctx *ctx,
|
||||
TALLOC_FREE(ctx->password);
|
||||
ctx->password = talloc_strdup(ctx, password);
|
||||
if (!ctx->password) {
|
||||
return W_ERROR_V(WERR_NOMEM);
|
||||
return W_ERROR_V(WERR_NOT_ENOUGH_MEMORY);
|
||||
}
|
||||
return NET_API_STATUS_SUCCESS;
|
||||
}
|
||||
@ -255,7 +255,7 @@ NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx,
|
||||
TALLOC_FREE(ctx->workgroup);
|
||||
ctx->workgroup = talloc_strdup(ctx, workgroup);
|
||||
if (!ctx->workgroup) {
|
||||
return W_ERROR_V(WERR_NOMEM);
|
||||
return W_ERROR_V(WERR_NOT_ENOUGH_MEMORY);
|
||||
}
|
||||
return NET_API_STATUS_SUCCESS;
|
||||
}
|
||||
@ -312,7 +312,7 @@ NET_API_STATUS libnetapi_set_error_string(struct libnetapi_ctx *ctx,
|
||||
va_end(args);
|
||||
|
||||
if (!ctx->error_string) {
|
||||
return W_ERROR_V(WERR_NOMEM);
|
||||
return W_ERROR_V(WERR_NOT_ENOUGH_MEMORY);
|
||||
}
|
||||
return NET_API_STATUS_SUCCESS;
|
||||
}
|
||||
@ -359,7 +359,7 @@ NET_API_STATUS NetApiBufferAllocate(uint32_t byte_count,
|
||||
|
||||
buf = talloc_size(NULL, byte_count);
|
||||
if (!buf) {
|
||||
return W_ERROR_V(WERR_NOMEM);
|
||||
return W_ERROR_V(WERR_NOT_ENOUGH_MEMORY);
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -44,7 +44,7 @@ static WERROR NetServerGetInfo_l_101(struct libnetapi_ctx *ctx,
|
||||
|
||||
*buffer = (uint8_t *)talloc_memdup(ctx, &i, sizeof(i));
|
||||
if (!*buffer) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
return WERR_OK;
|
||||
@ -61,7 +61,7 @@ static WERROR NetServerGetInfo_l_1005(struct libnetapi_ctx *ctx,
|
||||
info1005.sv1005_comment = lp_server_string(ctx);
|
||||
*buffer = (uint8_t *)talloc_memdup(ctx, &info1005, sizeof(info1005));
|
||||
if (!*buffer) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
return WERR_OK;
|
||||
|
@ -1461,7 +1461,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_USER(TALLOC_CTX *mem_ctx,
|
||||
info->entries[i].idx;
|
||||
|
||||
if (!user[i].usri1_name) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1503,7 +1503,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_MACHINE(TALLOC_CTX *mem_ctx,
|
||||
info->entries[i].idx;
|
||||
|
||||
if (!machine[i].usri2_name) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1545,7 +1545,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_GROUP(TALLOC_CTX *mem_ctx,
|
||||
info->entries[i].idx;
|
||||
|
||||
if (!group[i].grpi3_name) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3087,7 +3087,7 @@ WERROR NetUserGetGroups_r(struct libnetapi_ctx *ctx,
|
||||
|
||||
rids = talloc_array(ctx, uint32_t, rid_array->count);
|
||||
if (!rids) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -3274,7 +3274,7 @@ WERROR NetUserSetGroups_r(struct libnetapi_ctx *ctx,
|
||||
|
||||
lsa_names = talloc_array(ctx, struct lsa_String, r->in.num_entries);
|
||||
if (!lsa_names) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -3630,20 +3630,20 @@ WERROR NetUserGetLocalGroups_r(struct libnetapi_ctx *ctx,
|
||||
}
|
||||
|
||||
if (!sid_compose(&user_sid, domain_sid, user_rids.ids[0])) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
sid_array.num_sids = rid_array->count + 1;
|
||||
sid_array.sids = talloc_array(ctx, struct lsa_SidPtr, sid_array.num_sids);
|
||||
if (!sid_array.sids) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
sid_array.sids[0].sid = dom_sid_dup(ctx, &user_sid);
|
||||
if (!sid_array.sids[0].sid) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -3651,13 +3651,13 @@ WERROR NetUserGetLocalGroups_r(struct libnetapi_ctx *ctx,
|
||||
struct dom_sid sid;
|
||||
|
||||
if (!sid_compose(&sid, domain_sid, rid_array->rids[i].rid)) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
sid_array.sids[i+1].sid = dom_sid_dup(ctx, &sid);
|
||||
if (!sid_array.sids[i+1].sid) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@ -3679,7 +3679,7 @@ WERROR NetUserGetLocalGroups_r(struct libnetapi_ctx *ctx,
|
||||
for (i=0; i < domain_rids.count; i++) {
|
||||
if (!add_rid_to_array_unique(ctx, domain_rids.ids[i],
|
||||
&rids, &num_rids)) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@ -3701,7 +3701,7 @@ WERROR NetUserGetLocalGroups_r(struct libnetapi_ctx *ctx,
|
||||
for (i=0; i < builtin_rids.count; i++) {
|
||||
if (!add_rid_to_array_unique(ctx, builtin_rids.ids[i],
|
||||
&rids, &num_rids)) {
|
||||
werr = WERR_NOMEM;
|
||||
werr = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user