s3-rpc: Avoid including every pipe's client and server stubs everywhere in samba.
[kamenim/samba.git] / source3 / lib / netapi / share.c
index e6aed360647311ea5a1fd61dd9d2615d1dbac25b..65bcd9a3a26f65f7c10f303d282bd32c32354ab1 100644 (file)
@@ -23,6 +23,7 @@
 #include "lib/netapi/netapi.h"
 #include "lib/netapi/netapi_private.h"
 #include "lib/netapi/libnetapi.h"
+#include "../librpc/gen_ndr/cli_srvsvc.h"
 
 /****************************************************************
 ****************************************************************/
@@ -181,7 +182,6 @@ WERROR NetShareAdd_r(struct libnetapi_ctx *ctx,
 {
        WERROR werr;
        NTSTATUS status;
-       struct cli_state *cli = NULL;
        struct rpc_pipe_client *pipe_cli = NULL;
        union srvsvc_NetShareInfo info;
 
@@ -201,7 +201,6 @@ WERROR NetShareAdd_r(struct libnetapi_ctx *ctx,
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
                                   &ndr_table_srvsvc.syntax_id,
-                                  &cli,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -227,10 +226,6 @@ WERROR NetShareAdd_r(struct libnetapi_ctx *ctx,
        }
 
  done:
-       if (!cli) {
-               return werr;
-       }
-
        return werr;
 }
 
@@ -251,7 +246,6 @@ WERROR NetShareDel_r(struct libnetapi_ctx *ctx,
 {
        WERROR werr;
        NTSTATUS status;
-       struct cli_state *cli = NULL;
        struct rpc_pipe_client *pipe_cli = NULL;
 
        if (!r->in.net_name) {
@@ -260,7 +254,6 @@ WERROR NetShareDel_r(struct libnetapi_ctx *ctx,
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
                                   &ndr_table_srvsvc.syntax_id,
-                                  &cli,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -277,10 +270,6 @@ WERROR NetShareDel_r(struct libnetapi_ctx *ctx,
        }
 
  done:
-       if (!cli) {
-               return werr;
-       }
-
        return werr;
 }
 
@@ -301,7 +290,6 @@ WERROR NetShareEnum_r(struct libnetapi_ctx *ctx,
 {
        WERROR werr;
        NTSTATUS status;
-       struct cli_state *cli = NULL;
        struct rpc_pipe_client *pipe_cli = NULL;
        struct srvsvc_NetShareInfoCtr info_ctr;
        struct srvsvc_NetShareCtr0 ctr0;
@@ -329,7 +317,6 @@ WERROR NetShareEnum_r(struct libnetapi_ctx *ctx,
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
                                   &ndr_table_srvsvc.syntax_id,
-                                  &cli,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -387,10 +374,6 @@ WERROR NetShareEnum_r(struct libnetapi_ctx *ctx,
        }
 
  done:
-       if (!cli) {
-               return werr;
-       }
-
        return werr;
 }
 
@@ -411,7 +394,6 @@ WERROR NetShareGetInfo_r(struct libnetapi_ctx *ctx,
 {
        WERROR werr;
        NTSTATUS status;
-       struct cli_state *cli = NULL;
        struct rpc_pipe_client *pipe_cli = NULL;
        union srvsvc_NetShareInfo info;
        uint32_t num_entries = 0;
@@ -436,7 +418,6 @@ WERROR NetShareGetInfo_r(struct libnetapi_ctx *ctx,
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
                                   &ndr_table_srvsvc.syntax_id,
-                                  &cli,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -463,10 +444,6 @@ WERROR NetShareGetInfo_r(struct libnetapi_ctx *ctx,
        }
 
  done:
-       if (!cli) {
-               return werr;
-       }
-
        return werr;
 }
 
@@ -487,7 +464,6 @@ WERROR NetShareSetInfo_r(struct libnetapi_ctx *ctx,
 {
        WERROR werr;
        NTSTATUS status;
-       struct cli_state *cli = NULL;
        struct rpc_pipe_client *pipe_cli = NULL;
        union srvsvc_NetShareInfo info;
 
@@ -512,7 +488,6 @@ WERROR NetShareSetInfo_r(struct libnetapi_ctx *ctx,
 
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
                                   &ndr_table_srvsvc.syntax_id,
-                                  &cli,
                                   &pipe_cli);
        if (!W_ERROR_IS_OK(werr)) {
                goto done;
@@ -539,10 +514,6 @@ WERROR NetShareSetInfo_r(struct libnetapi_ctx *ctx,
        }
 
  done:
-       if (!cli) {
-               return werr;
-       }
-
        return werr;
 }