From 49eea105fd99f43ee508f278865c655683b9be58 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 8 Aug 2001 03:18:49 +0000 Subject: Factored out common rpc pipe initialisation and shutdown code. (This used to be commit 04d978258ba2fea702232c815e140ab12364e8e7) --- source3/libsmb/cli_srvsvc.c | 51 +-------------------------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) (limited to 'source3/libsmb/cli_srvsvc.c') diff --git a/source3/libsmb/cli_srvsvc.c b/source3/libsmb/cli_srvsvc.c index 8209d9301f..042a9c44ff 100644 --- a/source3/libsmb/cli_srvsvc.c +++ b/source3/libsmb/cli_srvsvc.c @@ -29,56 +29,7 @@ struct cli_state *cli_svrsvc_initialise(struct cli_state *cli, char *system_name, struct ntuser_creds *creds) { - struct in_addr dest_ip; - struct nmb_name calling, called; - fstring dest_host; - extern pstring global_myname; - struct ntuser_creds anon; - - /* Initialise cli_state information */ - - if (!cli_initialise(cli)) { - return NULL; - } - - if (!creds) { - ZERO_STRUCT(anon); - anon.pwd.null_pwd = 1; - creds = &anon; - } - - cli_init_creds(cli, creds); - - /* Establish a SMB connection */ - - if (!resolve_srv_name(system_name, dest_host, &dest_ip)) { - return NULL; - } - - make_nmb_name(&called, dns_to_netbios_name(dest_host), 0x20); - make_nmb_name(&calling, dns_to_netbios_name(global_myname), 0); - - if (!cli_establish_connection(cli, dest_host, &dest_ip, &calling, - &called, "IPC$", "IPC", False, True)) { - return NULL; - } - - /* Open a NT session thingy */ - - if (!cli_nt_session_open(cli, PIPE_SRVSVC)) { - cli_shutdown(cli); - return NULL; - } - - return cli; -} - -/* Shut down a SMB connection to the srvsvc pipe */ - -void cli_srvsvc_shutdown(struct cli_state *cli) -{ - if (cli->fd != -1) cli_ulogoff(cli); - cli_shutdown(cli); + return cli_pipe_initialise(cli, system_name, PIPE_SRVSVC, creds); } uint32 cli_srvsvc_net_srv_get_info(struct cli_state *cli, TALLOC_CTX *mem_ctx, -- cgit