summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-07 23:59:13 +0000
committerJeremy Allison <jra@samba.org>2001-03-07 23:59:13 +0000
commit393bede7db6af546431cd5255e465b7b7b0e7c81 (patch)
tree44a95a722eba6f412e50efc34e2233baa31fe987 /source3/rpc_client
parent2b22019e426c4bb7a5745a326c302a4e19aa5ff2 (diff)
downloadsamba-393bede7db6af546431cd5255e465b7b7b0e7c81.tar.gz
samba-393bede7db6af546431cd5255e465b7b7b0e7c81.tar.bz2
samba-393bede7db6af546431cd5255e465b7b7b0e7c81.zip
Sync up handle creation with 2.2 branch. We can now join AS/U domains and
authenticate against them. Big/little endian issues fixed. Jeremy. (This used to be commit 0e6a34510ed598eaec7fe71a9c91fda528a4675c)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_lsarpc.c14
-rw-r--r--source3/rpc_client/cli_reg.c14
-rw-r--r--source3/rpc_client/cli_samr.c6
3 files changed, 14 insertions, 20 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);
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c
index 96e27c5ce6..32439e9b5d 100644
--- a/source3/rpc_client/cli_reg.c
+++ b/source3/rpc_client/cli_reg.c
@@ -126,7 +126,7 @@ BOOL do_reg_open_hklm(struct cli_state *cli, uint16 unknown_0, uint32 level,
}
/* 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);
@@ -187,7 +187,7 @@ BOOL do_reg_open_hku(struct cli_state *cli, uint16 unknown_0, uint32 level,
}
/* 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);
@@ -755,7 +755,7 @@ BOOL do_reg_create_key(struct cli_state *cli, POLICY_HND *hnd,
return False;
}
- memcpy(key, r_o.key_pol.data, sizeof(key->data));
+ *key = r_o.key_pol;
prs_mem_free(&rbuf);
@@ -1003,7 +1003,7 @@ BOOL do_reg_open_entry(struct cli_state *cli, POLICY_HND *hnd,
return False;
}
- memcpy(key_hnd, r_o.pol.data, sizeof(key_hnd->data));
+ *key_hnd = r_o.pol;
prs_mem_free(&rbuf);
@@ -1019,7 +1019,6 @@ BOOL do_reg_close(struct cli_state *cli, POLICY_HND *hnd)
prs_struct buf;
REG_Q_CLOSE q_c;
REG_R_CLOSE r_c;
- int i;
if (hnd == NULL)
return False;
@@ -1066,12 +1065,11 @@ BOOL do_reg_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) {
+ 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) ) {
prs_mem_free(&rbuf);
DEBUG(0,("REG_CLOSE: non-zero handle returned\n"));
return False;
- }
}
prs_mem_free(&rbuf);
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index dbc10f7682..f8c10abae1 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -765,7 +765,6 @@ BOOL do_samr_close(struct cli_state *cli, POLICY_HND *hnd)
prs_struct rdata;
SAMR_Q_CLOSE_HND q_c;
SAMR_R_CLOSE_HND r_c;
- int i;
if (hnd == NULL)
return False;
@@ -810,12 +809,11 @@ BOOL do_samr_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) {
+ 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,("SAMR_CLOSE_HND: non-zero handle returned\n"));
prs_mem_free(&rdata);
return False;
- }
}
prs_mem_free(&rdata);