summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_lsarpc.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-27 21:50:11 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-27 21:50:11 +0000
commit3fc5ec73be6009d50ec1e8e83505572ad16c1943 (patch)
tree66759f75ddb08b8df70199443c38c98b9ed0994b /source3/rpc_client/cli_lsarpc.c
parentd4bf1ca515eb9015970cc339b6b9a2177691350d (diff)
downloadsamba-3fc5ec73be6009d50ec1e8e83505572ad16c1943.tar.gz
samba-3fc5ec73be6009d50ec1e8e83505572ad16c1943.tar.bz2
samba-3fc5ec73be6009d50ec1e8e83505572ad16c1943.zip
further abstraction involving client states. main client-side code
is pretty much independent of SMB client states, which will make it easier to add other transports. (This used to be commit a1ff7e8fc3129ba4a04722f977bc2d3725d13624)
Diffstat (limited to 'source3/rpc_client/cli_lsarpc.c')
-rw-r--r--source3/rpc_client/cli_lsarpc.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 7706d0cd83..c8240a3299 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -39,7 +39,7 @@ BOOL get_domain_sids(const char *myname,
{
POLICY_HND pol;
fstring srv_name;
- struct cli_state cli;
+ struct cli_connection *con = NULL;
BOOL res = True;
fstring dom3;
fstring dom5;
@@ -56,7 +56,7 @@ BOOL get_domain_sids(const char *myname,
return False;
}
- if (!cli_connect_serverlist(&cli, servers))
+ if (!cli_connection_init_list(servers, PIPE_LSARPC, &con))
{
DEBUG(0,("get_domain_sids: unable to initialise client connection.\n"));
return False;
@@ -101,8 +101,7 @@ BOOL get_domain_sids(const char *myname,
res = res ? lsa_close(&pol) : False;
/* close the session */
- cli_ulogoff(&cli);
- cli_shutdown(&cli);
+ cli_connection_unlink(con);
if (res)
{
@@ -136,7 +135,7 @@ BOOL get_trust_sid_and_domain(const char* myname, char *server,
{
POLICY_HND pol;
fstring srv_name;
- struct cli_state cli;
+ struct cli_connection *con = NULL;
BOOL res = True;
BOOL res1 = True;
DOM_SID sid3;
@@ -151,7 +150,7 @@ BOOL get_trust_sid_and_domain(const char* myname, char *server,
ZERO_STRUCT(usr);
pwd_set_nullpwd(&usr.pwd);
- if (!cli_connect_serverlist(&cli, server))
+ if (!cli_connection_init_list(server, PIPE_LSARPC, &con))
{
DEBUG(0,("get_trust_sid: unable to initialise client connection.\n"));
return False;
@@ -179,8 +178,7 @@ BOOL get_trust_sid_and_domain(const char* myname, char *server,
res = res ? lsa_close(&pol) : False;
/* close the session */
- cli_ulogoff(&cli);
- cli_shutdown(&cli);
+ cli_connection_unlink(con);
if (res1)
{
@@ -224,10 +222,9 @@ BOOL lsa_open_policy(const char *server_name, POLICY_HND *hnd,
LSA_Q_OPEN_POL q_o;
LSA_SEC_QOS qos;
BOOL valid_pol = False;
- struct cli_state *cli = NULL;
- uint16 fnum = 0xffff;
+ struct cli_connection *con = NULL;
- if (!cli_state_init(server_name, PIPE_LSARPC, &cli, &fnum))
+ if (!cli_connection_init(server_name, PIPE_LSARPC, &con))
{
return False;
}
@@ -256,7 +253,7 @@ BOOL lsa_open_policy(const char *server_name, POLICY_HND *hnd,
lsa_io_q_open_pol("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, fnum, LSA_OPENPOLICY, &buf, &rbuf))
+ if (rpc_con_pipe_req(con, LSA_OPENPOLICY, &buf, &rbuf))
{
LSA_R_OPEN_POL r_o;
BOOL p;
@@ -277,8 +274,8 @@ BOOL lsa_open_policy(const char *server_name, POLICY_HND *hnd,
memcpy(hnd, r_o.pol.data, sizeof(hnd->data));
valid_pol = register_policy_hnd(hnd) &&
- set_policy_cli_state(hnd, cli, fnum,
- cli_state_free);
+ set_policy_con(hnd, con,
+ cli_connection_unlink);
}
}
@@ -300,10 +297,9 @@ BOOL lsa_open_policy2( const char *server_name, POLICY_HND *hnd,
LSA_SEC_QOS qos;
BOOL valid_pol = False;
- struct cli_state *cli = NULL;
- uint16 fnum = 0xffff;
+ struct cli_connection *con = NULL;
- if (!cli_state_init(server_name, PIPE_LSARPC, &cli, &fnum))
+ if (!cli_connection_init(server_name, PIPE_LSARPC, &con))
{
return False;
}
@@ -352,8 +348,8 @@ BOOL lsa_open_policy2( const char *server_name, POLICY_HND *hnd,
/* ok, at last: we're happy. return the policy handle */
memcpy(hnd, r_o.pol.data, sizeof(hnd->data));
valid_pol = register_policy_hnd(hnd) &&
- set_policy_cli_state(hnd, cli, fnum,
- cli_state_free);
+ set_policy_con(hnd, con,
+ cli_connection_unlink);
}
}