diff options
author | Tim Potter <tpot@samba.org> | 2001-08-08 03:18:49 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-08-08 03:18:49 +0000 |
commit | 04d978258ba2fea702232c815e140ab12364e8e7 (patch) | |
tree | 0fe3785fe24a4ba7e632ddcc174199c9b1ca2a4d /source/libsmb/cli_dfs.c | |
parent | 78207d0fc8c4641fbd8f63f469c4135357edfad8 (diff) | |
download | samba-04d978258ba2fea702232c815e140ab12364e8e7.tar.gz samba-04d978258ba2fea702232c815e140ab12364e8e7.tar.xz samba-04d978258ba2fea702232c815e140ab12364e8e7.zip |
Factored out common rpc pipe initialisation and shutdown code.
Diffstat (limited to 'source/libsmb/cli_dfs.c')
-rw-r--r-- | source/libsmb/cli_dfs.c | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/source/libsmb/cli_dfs.c b/source/libsmb/cli_dfs.c index 830681effb9..a16c76658fd 100644 --- a/source/libsmb/cli_dfs.c +++ b/source/libsmb/cli_dfs.c @@ -26,56 +26,7 @@ struct cli_state *cli_dfs_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_NETDFS)) { - cli_shutdown(cli); - return NULL; - } - - return cli; -} - -/* Shut down a SMB connection to the DFS pipe */ - -void cli_dfs_shutdown(struct cli_state *cli) -{ - if (cli->fd != -1) cli_ulogoff(cli); - cli_shutdown(cli); + return cli_pipe_initialise(cli, system_name, PIPE_NETDFS, creds); } /* Query DFS support */ |