diff options
Diffstat (limited to 'source3/rpc_client/cli_lsarpc.c')
-rw-r--r-- | source3/rpc_client/cli_lsarpc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index 03a5cad709..9ba13552bc 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -87,7 +87,7 @@ BOOL do_lsa_open_policy(struct cli_state *cli, return False; } else { /* ok, at last: we're happy. return the policy handle */ - memcpy(hnd, r_o.pol.data, sizeof(hnd->data)); + *hnd = r_o.pol; } prs_mem_free(&rbuf); @@ -207,7 +207,6 @@ BOOL do_lsa_close(struct cli_state *cli, POLICY_HND *hnd) prs_struct buf; LSA_Q_CLOSE q_c; LSA_R_CLOSE r_c; - int i; if (hnd == NULL) return False; @@ -252,12 +251,11 @@ BOOL do_lsa_close(struct cli_state *cli, POLICY_HND *hnd) /* check that the returned policy handle is all zeros */ - for (i = 0; i < sizeof(r_c.pol.data); i++) { - if (r_c.pol.data[i] != 0) { - DEBUG(0,("LSA_CLOSE: non-zero handle returned\n")); - prs_mem_free(&rbuf); - return False; - } + if (IVAL(&r_c.pol.data1,0) || IVAL(&r_c.pol.data2,0) || SVAL(&r_c.pol.data3,0) || + SVAL(&r_c.pol.data4,0) || IVAL(r_c.pol.data5,0) || IVAL(r_c.pol.data5,4) ) { + DEBUG(0,("LSA_CLOSE: non-zero handle returned\n")); + prs_mem_free(&rbuf); + return False; } prs_mem_free(&rbuf); |