netapi: implement NetFileClose_r.
authorGünther Deschner <gd@samba.org>
Tue, 9 Sep 2008 17:31:03 +0000 (19:31 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 11 Sep 2008 12:36:28 +0000 (14:36 +0200)
Guenther
(This used to be commit 0cbbdf21ed0c9270c00a7fd08f42f6546b9ac9b8)

source3/lib/netapi/file.c

index aa80e8d56ac0c30bbb1482008843ac34a5c3c995..c0edb8e0628bfc6e12b45a5007ddfe80a1105ae5 100644 (file)
 WERROR NetFileClose_r(struct libnetapi_ctx *ctx,
                      struct NetFileClose *r)
 {
-       return WERR_NOT_SUPPORTED;
+       WERROR werr;
+       NTSTATUS status;
+       struct cli_state *cli = NULL;
+       struct rpc_pipe_client *pipe_cli = NULL;
+
+       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;
+       }
+
+       status = rpccli_srvsvc_NetFileClose(pipe_cli, ctx,
+                                           r->in.server_name,
+                                           r->in.fileid,
+                                           &werr);
+       if (!W_ERROR_IS_OK(werr)) {
+               goto done;
+       }
+
+ done:
+       if (!cli) {
+               return werr;
+       }
+
+       return werr;
 }
 
 /****************************************************************