diff options
author | Günther Deschner <gd@samba.org> | 2008-04-10 22:44:00 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-04-10 22:44:00 +0200 |
commit | ef6ed54765b1d8ccaabfb3268f8427cc791b738b (patch) | |
tree | 91b0c0c65d326ea8eb271e1cfed98db9a0e85652 | |
parent | 3d5aecd2b940215c2566b2e429c2cc3803ff0ad4 (diff) | |
download | samba-ef6ed54765b1d8ccaabfb3268f8427cc791b738b.tar.gz samba-ef6ed54765b1d8ccaabfb3268f8427cc791b738b.tar.bz2 samba-ef6ed54765b1d8ccaabfb3268f8427cc791b738b.zip |
Use libnetapi_open_pipe in netapi functions.
Guenther
(This used to be commit 5804d8b112e1da022988c635284eb4799974d4c7)
-rw-r--r-- | source3/lib/netapi/getdc.c | 20 | ||||
-rw-r--r-- | source3/lib/netapi/joindomain.c | 24 | ||||
-rw-r--r-- | source3/lib/netapi/serverinfo.c | 16 | ||||
-rw-r--r-- | source3/lib/netapi/user.c | 15 |
4 files changed, 27 insertions, 48 deletions
diff --git a/source3/lib/netapi/getdc.c b/source3/lib/netapi/getdc.c index 8f882941b3..38aaf0ef85 100644 --- a/source3/lib/netapi/getdc.c +++ b/source3/lib/netapi/getdc.c @@ -50,10 +50,8 @@ WERROR NetGetDCName_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_NETLOGON, - &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_NETLOGON, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -92,12 +90,10 @@ WERROR NetGetAnyDCName_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_NETLOGON, - &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_NETLOGON, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; - }; + } status = rpccli_netr_GetAnyDCName(pipe_cli, ctx, r->in.server_name, @@ -152,10 +148,8 @@ WERROR DsGetDcName_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_NETLOGON, - &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_NETLOGON, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; } diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index 056d8d27e2..8e0a62e820 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -108,10 +108,8 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_WKSSVC, - &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_WKSSVC, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -239,10 +237,8 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_WKSSVC, - &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_WKSSVC, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -292,10 +288,8 @@ WERROR NetGetJoinInformation_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_WKSSVC, - &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_WKSSVC, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -422,10 +416,8 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_WKSSVC, - &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_WKSSVC, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; } diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c index 238b9ca308..58efeb375d 100644 --- a/source3/lib/netapi/serverinfo.c +++ b/source3/lib/netapi/serverinfo.c @@ -75,12 +75,10 @@ WERROR NetServerGetInfo_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, - &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_SRVSVC, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; - }; + } status = rpccli_srvsvc_NetSrvGetInfo(pipe_cli, ctx, r->in.server_name, @@ -177,12 +175,10 @@ WERROR NetServerSetInfo_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, - &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_SRVSVC, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; - }; + } switch (r->in.level) { case 1005: diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c index d9505bc067..31e5faa594 100644 --- a/source3/lib/netapi/user.c +++ b/source3/lib/netapi/user.c @@ -185,9 +185,8 @@ WERROR NetUserAdd_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_SAMR, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -378,9 +377,8 @@ WERROR NetUserDel_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_SAMR, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -602,9 +600,8 @@ WERROR NetUserEnum_r(struct libnetapi_ctx *ctx, goto done; } - pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &status); - if (!pipe_cli) { - werr = ntstatus_to_werror(status); + werr = libnetapi_open_pipe(ctx, cli, PI_SAMR, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { goto done; } |