werror: replace WERR_NOMEM with WERR_NOT_ENOUGH_MEMORY in source3/lib/netapi/
authorGünther Deschner <gd@samba.org>
Thu, 3 Dec 2015 14:24:14 +0000 (15:24 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 27 Sep 2016 22:04:18 +0000 (00:04 +0200)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/netapi/cm.c
source3/lib/netapi/getdc.c
source3/lib/netapi/group.c
source3/lib/netapi/joindomain.c
source3/lib/netapi/netapi.c
source3/lib/netapi/serverinfo.c
source3/lib/netapi/user.c

index 37632af241b3039e47dfe106b5cb24a14ebd273d..a98cf7f078d76a630ae1a8754c2f555af511a6f5 100644 (file)
@@ -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;
index ae976f1f02d3febfd71ba5a630ac7ec6d52c1552..2d47ee458400a7cf397a9148f8d91d8c826d8a2b 100644 (file)
@@ -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));
index 6d9b248968a539585de04d8d1d625bb084b9a477..bfe652eede7710724d7c3286fd694e60f18abb72 100644 (file)
@@ -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;
        }
 
index dc224b6191613128f5add19e375eee9f947bc5c0..f90a03070d6decdeee2deee9e0821ad24f36b015 100644 (file)
@@ -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()) {
index fd062795561cc5e0cd1d06d470e6c614efbe4664..35dbcc7a21864df8c9eee686b928f181c5ce48e4 100644 (file)
@@ -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:
index 3c7306c26020d84d20f637b77597ae0ff6aa02b2..35238e5b8c84477a9c42c6b46a4efc420a9ae7e0 100644 (file)
@@ -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;
index bb598beab64f2f42d4352967589faeafec104924..19f6f7c196f576563676dee12b210af15706e80d 100644 (file)
@@ -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;
                }
        }