summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/serverinfo.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-04-10 22:04:04 +0200
committerGünther Deschner <gd@samba.org>2008-04-10 22:04:04 +0200
commitaeb7f7db4014695eb6510cc7a713db4c6228bd1f (patch)
tree01fa3c8dc3429ba5622b66ba516f370c20a5c735 /source3/lib/netapi/serverinfo.c
parentdeb6362f1f1ac12d6e2a245370ca36accc9506b1 (diff)
downloadsamba-aeb7f7db4014695eb6510cc7a713db4c6228bd1f.tar.gz
samba-aeb7f7db4014695eb6510cc7a713db4c6228bd1f.tar.bz2
samba-aeb7f7db4014695eb6510cc7a713db4c6228bd1f.zip
Use libnetapi_open_ipc_connection in libnetapi.
Guenther (This used to be commit d9f19fc61586d606393368799dee9757c169d602)
Diffstat (limited to 'source3/lib/netapi/serverinfo.c')
-rw-r--r--source3/lib/netapi/serverinfo.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c
index fb5d9402cf..238b9ca308 100644
--- a/source3/lib/netapi/serverinfo.c
+++ b/source3/lib/netapi/serverinfo.c
@@ -70,18 +70,8 @@ WERROR NetServerGetInfo_r(struct libnetapi_ctx *ctx,
WERROR werr;
union srvsvc_NetSrvInfo info;
- status = cli_full_connection(&cli, NULL, r->in.server_name,
- NULL, 0,
- "IPC$", "IPC",
- ctx->username,
- ctx->workgroup,
- ctx->password,
- CLI_FULL_CONNECTION_USE_KERBEROS |
- CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS,
- Undefined, NULL);
-
- if (!NT_STATUS_IS_OK(status)) {
- werr = ntstatus_to_werror(status);
+ werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli);
+ if (!W_ERROR_IS_OK(werr)) {
goto done;
}
@@ -109,10 +99,6 @@ WERROR NetServerGetInfo_r(struct libnetapi_ctx *ctx,
}
done:
- if (cli) {
- cli_shutdown(cli);
- }
-
return werr;
}
@@ -186,18 +172,8 @@ WERROR NetServerSetInfo_r(struct libnetapi_ctx *ctx,
WERROR werr;
union srvsvc_NetSrvInfo info;
- status = cli_full_connection(&cli, NULL, r->in.server_name,
- NULL, 0,
- "IPC$", "IPC",
- ctx->username,
- ctx->workgroup,
- ctx->password,
- CLI_FULL_CONNECTION_USE_KERBEROS |
- CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS,
- Undefined, NULL);
-
- if (!NT_STATUS_IS_OK(status)) {
- werr = ntstatus_to_werror(status);
+ werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli);
+ if (!W_ERROR_IS_OK(werr)) {
goto done;
}
@@ -229,9 +205,5 @@ WERROR NetServerSetInfo_r(struct libnetapi_ctx *ctx,
}
done:
- if (cli) {
- cli_shutdown(cli);
- }
-
return werr;
}