s3-libnetapi: pass down ndr_interface_table to libnetapi_open_pipe().
authorGünther Deschner <gd@samba.org>
Fri, 17 May 2013 14:10:13 +0000 (16:10 +0200)
committerAndreas Schneider <asn@samba.org>
Mon, 5 Aug 2013 08:29:59 +0000 (10:29 +0200)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/lib/netapi/cm.c
source3/lib/netapi/group.c
source3/lib/netapi/joindomain.c
source3/lib/netapi/localgroup.c
source3/lib/netapi/netapi_private.h
source3/lib/netapi/user.c

index 786fd949571d7cae117bb42a4ea62f82e1c4af64..310b6d202650ed6251f7e038277d5b745ada02b1 100644 (file)
@@ -234,7 +234,7 @@ static NTSTATUS pipe_cm_open(TALLOC_CTX *ctx,
 
 WERROR libnetapi_open_pipe(struct libnetapi_ctx *ctx,
                           const char *server_name,
-                          const struct ndr_syntax_id *interface,
+                          const struct ndr_interface_table *table,
                           struct rpc_pipe_client **presult)
 {
        struct rpc_pipe_client *result = NULL;
@@ -251,10 +251,10 @@ WERROR libnetapi_open_pipe(struct libnetapi_ctx *ctx,
                return werr;
        }
 
-       status = pipe_cm_open(ctx, ipc, interface, &result);
+       status = pipe_cm_open(ctx, ipc, &table->syntax_id, &result);
        if (!NT_STATUS_IS_OK(status)) {
                libnetapi_set_error_string(ctx, "failed to open PIPE %s: %s",
-                       get_pipe_name_from_syntax(talloc_tos(), interface),
+                       get_pipe_name_from_syntax(talloc_tos(), &table->syntax_id),
                        get_friendly_nt_error_msg(status));
                return WERR_DEST_NOT_FOUND;
        }
@@ -277,7 +277,7 @@ WERROR libnetapi_get_binding_handle(struct libnetapi_ctx *ctx,
 
        *binding_handle = NULL;
 
-       result = libnetapi_open_pipe(ctx, server_name, &table->syntax_id, &pipe_cli);
+       result = libnetapi_open_pipe(ctx, server_name, table, &pipe_cli);
        if (!W_ERROR_IS_OK(result)) {
                return result;
        }
index 9813f7eacb3639b975e0f710e07a48c9864c79e7..38ed6df84d238f2bedcee1dfbc697362fcf8081d 100644 (file)
@@ -76,7 +76,7 @@ WERROR NetGroupAdd_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -272,7 +272,7 @@ WERROR NetGroupDel_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -475,7 +475,7 @@ WERROR NetGroupSetInfo_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -745,7 +745,7 @@ WERROR NetGroupGetInfo_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -885,7 +885,7 @@ WERROR NetGroupAddUser_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -1029,7 +1029,7 @@ WERROR NetGroupDelUser_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -1332,7 +1332,7 @@ WERROR NetGroupEnum_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -1479,7 +1479,7 @@ WERROR NetGroupGetUsers_r(struct libnetapi_ctx *ctx,
 
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -1655,7 +1655,7 @@ WERROR NetGroupSetUsers_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
index b6fb57ae0260496c03fae33c79ad781138b376d0..d8e624fde5c8fc4a369467593485435266847034 100644 (file)
@@ -116,7 +116,7 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx,
        DATA_BLOB session_key;
 
        werr = libnetapi_open_pipe(ctx, r->in.server,
-                                  &ndr_table_wkssvc.syntax_id,
+                                  &ndr_table_wkssvc,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -257,7 +257,7 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx,
        DATA_BLOB session_key;
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_wkssvc.syntax_id,
+                                  &ndr_table_wkssvc,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -313,7 +313,7 @@ WERROR NetGetJoinInformation_r(struct libnetapi_ctx *ctx,
        struct dcerpc_binding_handle *b;
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_wkssvc.syntax_id,
+                                  &ndr_table_wkssvc,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -455,7 +455,7 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx,
        DATA_BLOB session_key;
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_wkssvc.syntax_id,
+                                  &ndr_table_wkssvc,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -508,7 +508,7 @@ WERROR NetRenameMachineInDomain_r(struct libnetapi_ctx *ctx,
        DATA_BLOB session_key;
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_wkssvc.syntax_id,
+                                  &ndr_table_wkssvc,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
index 1a544adecd34e6d549058514a4489e2e2405fbfe..6501eddcc63b9afccbdb336641a0f7093f8f7b2e 100644 (file)
@@ -179,7 +179,7 @@ WERROR NetLocalGroupAdd_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -313,7 +313,7 @@ WERROR NetLocalGroupDel_r(struct libnetapi_ctx *ctx,
        ZERO_STRUCT(alias_handle);
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -493,7 +493,7 @@ WERROR NetLocalGroupGetInfo_r(struct libnetapi_ctx *ctx,
        ZERO_STRUCT(alias_handle);
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -672,7 +672,7 @@ WERROR NetLocalGroupSetInfo_r(struct libnetapi_ctx *ctx,
        ZERO_STRUCT(alias_handle);
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -822,7 +822,7 @@ WERROR NetLocalGroupEnum_r(struct libnetapi_ctx *ctx,
        ZERO_STRUCT(alias_handle);
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -1135,7 +1135,7 @@ static WERROR NetLocalGroupModifyMembers_r(struct libnetapi_ctx *ctx,
 
        if (r->in.level == 3) {
                werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                          &ndr_table_lsarpc.syntax_id,
+                                          &ndr_table_lsarpc,
                                           &lsa_pipe);
                if (!W_ERROR_IS_OK(werr)) {
                        goto done;
@@ -1154,7 +1154,7 @@ static WERROR NetLocalGroupModifyMembers_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
index 62aa7ef55e1453aa06163b2d3b480466c17a42b2..897cf3d0b3839cf6bb5c25ec6745054adaf31bd1 100644 (file)
@@ -61,7 +61,7 @@ NET_API_STATUS libnetapi_get_debuglevel(struct libnetapi_ctx *ctx, char **debugl
 WERROR libnetapi_shutdown_cm(struct libnetapi_ctx *ctx);
 WERROR libnetapi_open_pipe(struct libnetapi_ctx *ctx,
                           const char *server_name,
-                          const struct ndr_syntax_id *interface,
+                          const struct ndr_interface_table *table,
                           struct rpc_pipe_client **presult);
 WERROR libnetapi_get_binding_handle(struct libnetapi_ctx *ctx,
                                    const char *server_name,
index df3914cb4fcb57e72b1b9806d5a481ac60eb20f0..a2d6c79789d2ede80492cfbe485483f19e85e19d 100644 (file)
@@ -400,7 +400,7 @@ WERROR NetUserAdd_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -552,7 +552,7 @@ WERROR NetUserDel_r(struct libnetapi_ctx *ctx,
        ZERO_STRUCT(user_handle);
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
 
        if (!W_ERROR_IS_OK(werr)) {
@@ -1314,7 +1314,7 @@ WERROR NetUserEnum_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -1622,7 +1622,7 @@ WERROR NetQueryDisplayInformation_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -1756,7 +1756,7 @@ WERROR NetUserGetInfo_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -1920,7 +1920,7 @@ WERROR NetUserSetInfo_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -2371,7 +2371,7 @@ WERROR NetUserModalsGet_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -2856,7 +2856,7 @@ WERROR NetUserModalsSet_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -2991,7 +2991,7 @@ WERROR NetUserGetGroups_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -3166,7 +3166,7 @@ WERROR NetUserSetGroups_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -3491,7 +3491,7 @@ WERROR NetUserGetLocalGroups_r(struct libnetapi_ctx *ctx,
        }
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
-                                  &ndr_table_samr.syntax_id,
+                                  &ndr_table_samr,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;