diff options
author | Luke Leighton <lkcl@samba.org> | 1999-10-25 17:10:54 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-10-25 17:10:54 +0000 |
commit | fdf6383cbec457e3e38b50bcc801661767fa4c0d (patch) | |
tree | f95cb6b6622c51984dede97bfdacd9fcf0215860 /source3 | |
parent | 2adba4bfbbe360cd8c1eca1b90354fd63c503dd0 (diff) | |
download | samba-fdf6383cbec457e3e38b50bcc801661767fa4c0d.tar.gz samba-fdf6383cbec457e3e38b50bcc801661767fa4c0d.tar.bz2 samba-fdf6383cbec457e3e38b50bcc801661767fa4c0d.zip |
signed / unsigned and typecast issues
(This used to be commit 6e22bf912cb981d91834c63098d41f5f8abaa594)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/proto.h | 6 | ||||
-rw-r--r-- | source3/rpc_client/cli_samr.c | 26 | ||||
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 110 | ||||
-rw-r--r-- | source3/rpcclient/cmd_samr.c | 22 |
4 files changed, 83 insertions, 81 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 872c9f6afb..60ed7f721d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1900,17 +1900,17 @@ BOOL samr_enum_dom_groups(struct cli_state *cli, uint16 fnum, POLICY_HND *pol, uint32 start_idx, uint32 size, struct acct_info **sam, - int *num_sam_groups); + uint32 *num_sam_groups); BOOL samr_enum_dom_aliases(struct cli_state *cli, uint16 fnum, POLICY_HND *pol, uint32 start_idx, uint32 size, struct acct_info **sam, - int *num_sam_aliases); + uint32 *num_sam_aliases); uint32 samr_enum_dom_users(struct cli_state *cli, uint16 fnum, POLICY_HND *pol, uint32 *start_idx, uint16 acb_mask, uint16 unk_1, uint32 size, struct acct_info **sam, - int *num_sam_users); + uint32 *num_sam_users); BOOL samr_connect(struct cli_state *cli, uint16 fnum, char *srv_name, uint32 unknown_0, POLICY_HND *connect_pol); diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c index d3f4f3c052..a1faade6db 100644 --- a/source3/rpc_client/cli_samr.c +++ b/source3/rpc_client/cli_samr.c @@ -550,7 +550,7 @@ BOOL samr_enum_dom_groups(struct cli_state *cli, uint16 fnum, POLICY_HND *pol, uint32 start_idx, uint32 size, struct acct_info **sam, - int *num_sam_groups) + uint32 *num_sam_groups) { prs_struct data; prs_struct rdata; @@ -591,7 +591,7 @@ BOOL samr_enum_dom_groups(struct cli_state *cli, uint16 fnum, if (p) { - int i; + uint32 i; int name_idx = 0; *num_sam_groups = r_e.num_entries2; @@ -639,7 +639,7 @@ BOOL samr_enum_dom_aliases(struct cli_state *cli, uint16 fnum, POLICY_HND *pol, uint32 start_idx, uint32 size, struct acct_info **sam, - int *num_sam_aliases) + uint32 *num_sam_aliases) { prs_struct data; prs_struct rdata; @@ -680,7 +680,7 @@ BOOL samr_enum_dom_aliases(struct cli_state *cli, uint16 fnum, if (p) { - int i; + uint32 i; int name_idx = 0; *num_sam_aliases = r_e.num_entries2; @@ -728,7 +728,7 @@ uint32 samr_enum_dom_users(struct cli_state *cli, uint16 fnum, POLICY_HND *pol, uint32 *start_idx, uint16 acb_mask, uint16 unk_1, uint32 size, struct acct_info **sam, - int *num_sam_users) + uint32 *num_sam_users) { uint32 status = 0x0; prs_struct data; @@ -776,9 +776,9 @@ uint32 samr_enum_dom_users(struct cli_state *cli, uint16 fnum, if (p) { - int i = (*num_sam_users); - int j = 0; - int name_idx = 0; + uint32 i = (*num_sam_users); + uint32 j = 0; + uint32 name_idx = 0; (*num_sam_users) += r_e.num_entries2; (*sam) = (struct acct_info*) Realloc((*sam), @@ -1908,7 +1908,7 @@ BOOL samr_query_lookup_names(struct cli_state *cli, uint16 fnum, if (r_o.ptr_rids != 0 && r_o.ptr_types != 0 && r_o.num_types1 == r_o.num_rids1) { - int i; + uint32 i; valid_query = True; *num_rids = r_o.num_rids1; @@ -1994,12 +1994,12 @@ BOOL samr_query_lookup_rids(struct cli_state *cli, uint16 fnum, if (r_o.ptr_names != 0 && r_o.ptr_types != 0 && r_o.num_types1 == r_o.num_names1) { - int i; + uint32 i; valid_query = True; *num_names = r_o.num_names1; - (*names) = malloc((*num_names) * sizeof(**names)); + (*names) = (char**)malloc((*num_names) * sizeof(**names)); for (i = 0; (*names) != NULL && i < r_o.num_names1; i++) { fstring tmp; @@ -2007,7 +2007,7 @@ BOOL samr_query_lookup_rids(struct cli_state *cli, uint16 fnum, (*names)[i] = strdup(tmp); } - (*type) = malloc((*num_names) * sizeof(**type)); + (*type) = (uint32*)malloc((*num_names) * sizeof(**type)); for (i = 0; (*type) != NULL && i < r_o.num_types1; i++) { (*type)[i] = r_o.type[i]; @@ -2459,7 +2459,7 @@ BOOL samr_close(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd) if (p) { /* check that the returned policy handle is all zeros */ - int i; + uint32 i; valid_close = True; for (i = 0; i < sizeof(r_c.pol.data); i++) diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 073e0c7577..e111484676 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -726,7 +726,7 @@ reads or writes a SAM_SID_STUFF structure. ********************************************************************/ static BOOL sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth) { - int i; + uint32 i; if (stf == NULL) return False; @@ -1217,7 +1217,7 @@ BOOL make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, uint32 next_idx, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status) { - int i; + uint32 i; if (r_u == NULL) return False; @@ -1234,8 +1234,8 @@ BOOL make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, r_u->num_entries2 = num_sam_entries; r_u->num_entries3 = num_sam_entries; - r_u->sam = Realloc(NULL, r_u->num_entries2 * sizeof(r_u->sam[0])); - r_u->uni_acct_name = Realloc(NULL, r_u->num_entries2 * sizeof(r_u->uni_acct_name[0])); + r_u->sam = (SAM_ENTRY*)Realloc(NULL, r_u->num_entries2 * sizeof(r_u->sam[0])); + r_u->uni_acct_name = (UNISTR2*)Realloc(NULL, r_u->num_entries2 * sizeof(r_u->uni_acct_name[0])); if (r_u->sam == NULL || r_u->uni_acct_name == NULL) { @@ -1271,7 +1271,7 @@ reads or writes a structure. ********************************************************************/ BOOL samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth) { - int i; + uint32 i; if (r_u == NULL) return False; @@ -1294,8 +1294,8 @@ BOOL samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct if (ps->io) { - r_u->sam = Realloc(NULL, r_u->num_entries2 * sizeof(r_u->sam[0])); - r_u->uni_acct_name = Realloc(NULL, r_u->num_entries2 * sizeof(r_u->uni_acct_name[0])); + r_u->sam = (SAM_ENTRY*)Realloc(NULL, r_u->num_entries2 * sizeof(r_u->sam[0])); + r_u->uni_acct_name = (UNISTR2*)Realloc(NULL, r_u->num_entries2 * sizeof(r_u->uni_acct_name[0])); } if ((r_u->sam == NULL || r_u->uni_acct_name == NULL) && r_u->num_entries2 != 0) @@ -1386,7 +1386,7 @@ BOOL make_sam_dispinfo_1(SAM_DISPINFO_1 *sam, uint32 *num_entries, uint32 len_sam_name, len_sam_full, len_sam_desc; uint32 max_entries, max_data_size; uint32 dsize = 0; - int i; + uint32 i; if (sam == NULL || num_entries == NULL || data_size == NULL) return False; @@ -1424,7 +1424,7 @@ reads or writes a structure. ********************************************************************/ static BOOL sam_io_sam_dispinfo_1(char *desc, SAM_DISPINFO_1 *sam, uint32 num_entries, prs_struct *ps, int depth) { - int i; + uint32 i; if (sam == NULL) return False; @@ -1465,7 +1465,7 @@ BOOL make_sam_dispinfo_2(SAM_DISPINFO_2 *sam, uint32 *num_entries, uint32 len_sam_name, len_sam_desc; uint32 max_entries, max_data_size; uint32 dsize = 0; - int i; + uint32 i; if (sam == NULL || num_entries == NULL || data_size == NULL) return False; @@ -1501,7 +1501,7 @@ reads or writes a structure. ********************************************************************/ static BOOL sam_io_sam_dispinfo_2(char *desc, SAM_DISPINFO_2 *sam, uint32 num_entries, prs_struct *ps, int depth) { - int i; + uint32 i; if (sam == NULL) return False; @@ -1541,7 +1541,7 @@ BOOL make_sam_dispinfo_3(SAM_DISPINFO_3 *sam, uint32 *num_entries, uint32 len_sam_name, len_sam_desc; uint32 max_entries, max_data_size; uint32 dsize = 0; - int i; + uint32 i; if (sam == NULL || num_entries == NULL || data_size == NULL) return False; @@ -1575,9 +1575,9 @@ BOOL make_sam_dispinfo_3(SAM_DISPINFO_3 *sam, uint32 *num_entries, /******************************************************************* reads or writes a structure. ********************************************************************/ -static BOOL sam_io_sam_dispinfo_3(char *desc, SAM_DISPINFO_3 *sam, int num_entries, prs_struct *ps, int depth) +static BOOL sam_io_sam_dispinfo_3(char *desc, SAM_DISPINFO_3 *sam, uint32 num_entries, prs_struct *ps, int depth) { - int i; + uint32 i; if (sam == NULL) return False; @@ -1618,7 +1618,7 @@ BOOL make_sam_dispinfo_4(SAM_DISPINFO_4 *sam, uint32 *num_entries, uint32 len_sam_name; uint32 max_entries, max_data_size; uint32 dsize = 0; - int i; + uint32 i; if (sam == NULL || num_entries == NULL || data_size == NULL) return False; @@ -1650,9 +1650,9 @@ BOOL make_sam_dispinfo_4(SAM_DISPINFO_4 *sam, uint32 *num_entries, /******************************************************************* reads or writes a structure. ********************************************************************/ -static BOOL sam_io_sam_dispinfo_4(char *desc, SAM_DISPINFO_4 *sam, int num_entries, prs_struct *ps, int depth) +static BOOL sam_io_sam_dispinfo_4(char *desc, SAM_DISPINFO_4 *sam, uint32 num_entries, prs_struct *ps, int depth) { - int i; + uint32 i; if (sam == NULL) return False; @@ -1690,7 +1690,7 @@ BOOL make_sam_dispinfo_5(SAM_DISPINFO_5 *sam, uint32 *num_entries, uint32 len_sam_name; uint32 max_entries, max_data_size; uint32 dsize = 0; - int i; + uint32 i; if (sam == NULL || num_entries == NULL || data_size == NULL) return False; @@ -1722,9 +1722,9 @@ BOOL make_sam_dispinfo_5(SAM_DISPINFO_5 *sam, uint32 *num_entries, /******************************************************************* reads or writes a structure. ********************************************************************/ -static BOOL sam_io_sam_dispinfo_5(char *desc, SAM_DISPINFO_5 *sam, int num_entries, prs_struct *ps, int depth) +static BOOL sam_io_sam_dispinfo_5(char *desc, SAM_DISPINFO_5 *sam, uint32 num_entries, prs_struct *ps, int depth) { - int i; + uint32 i; if (sam == NULL) return False; @@ -2556,7 +2556,7 @@ reads or writes a structure. ********************************************************************/ BOOL samr_io_r_query_groupmem(char *desc, SAMR_R_QUERY_GROUPMEM *r_u, prs_struct *ps, int depth) { - int i; + uint32 i; if (r_u == NULL) return False; @@ -2578,7 +2578,7 @@ BOOL samr_io_r_query_groupmem(char *desc, SAMR_R_QUERY_GROUPMEM *r_u, prs_struc prs_uint32("num_rids", ps, depth, &(r_u->num_rids)); if (r_u->num_rids != 0) { - r_u->rid = Realloc(r_u->rid, + r_u->rid = (uint32*)Realloc(r_u->rid, sizeof(r_u->rid[0]) * r_u->num_rids); if (r_u->rid == NULL) @@ -2600,7 +2600,7 @@ BOOL samr_io_r_query_groupmem(char *desc, SAMR_R_QUERY_GROUPMEM *r_u, prs_struc if (r_u->num_attrs != 0) { - r_u->attr = Realloc(r_u->attr, + r_u->attr = (uint32*)Realloc(r_u->attr, sizeof(r_u->attr[0]) * r_u->num_attrs); if (r_u->attr == NULL) @@ -2716,7 +2716,7 @@ reads or writes a structure. ********************************************************************/ BOOL samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth) { - int i; + uint32 i; if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_usergroups"); @@ -2735,7 +2735,7 @@ BOOL samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_s { prs_uint32("num_entries2", ps, depth, &(r_u->num_entries2)); - r_u->gid = malloc(r_u->num_entries2 * sizeof(r_u->gid[0])); + r_u->gid = (DOM_GID*)malloc(r_u->num_entries2 * sizeof(r_u->gid[0])); if (r_u->gid == NULL) { return False; @@ -2805,7 +2805,7 @@ BOOL make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, uint32 num_sam_entries, DOMAIN_GRP *grps, uint32 status) { - int i; + uint32 i; if (r_u == NULL) return False; @@ -2857,7 +2857,7 @@ reads or writes a structure. ********************************************************************/ BOOL samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth) { - int i; + uint32 i; if (r_u == NULL) return False; @@ -2948,7 +2948,7 @@ BOOL make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, uint32 num_sam_entries, LOCAL_GRP *alss, uint32 status) { - int i; + uint32 i; if (r_u == NULL) return False; @@ -3000,7 +3000,7 @@ reads or writes a structure. ********************************************************************/ BOOL samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth) { - int i; + uint32 i; if (r_u == NULL) return False; @@ -3273,7 +3273,7 @@ reads or writes a SAMR_Q_QUERY_USERALIASES structure. BOOL samr_io_q_query_useraliases(char *desc, SAMR_Q_QUERY_USERALIASES *q_u, prs_struct *ps, int depth) { fstring tmp; - int i; + uint32 i; if (q_u == NULL) return False; @@ -3291,15 +3291,15 @@ BOOL samr_io_q_query_useraliases(char *desc, SAMR_Q_QUERY_USERALIASES *q_u, prs if (q_u->num_sids2 != 0) { - q_u->ptr_sid = Realloc(q_u->ptr_sid, sizeof(q_u->ptr_sid[0]) * - q_u->num_sids2); + q_u->ptr_sid = (uint32*)Realloc(q_u->ptr_sid, + sizeof(q_u->ptr_sid[0]) * q_u->num_sids2); if (q_u->ptr_sid == NULL) { samr_free_q_query_useraliases(q_u); return False; } - q_u->sid = Realloc(q_u->sid, + q_u->sid = (DOM_SID2*)Realloc(q_u->sid, sizeof(q_u->sid[0]) * q_u->num_sids2); if (q_u->sid == NULL) { @@ -3388,7 +3388,7 @@ reads or writes a structure. BOOL samr_io_r_query_useraliases(char *desc, SAMR_R_QUERY_USERALIASES *r_u, prs_struct *ps, int depth) { fstring tmp; - int i; + uint32 i; if (r_u == NULL) return False; prs_debug(ps, depth, desc, "samr_io_r_query_useraliases"); @@ -3402,7 +3402,7 @@ BOOL samr_io_r_query_useraliases(char *desc, SAMR_R_QUERY_USERALIASES *r_u, prs if (r_u->num_entries != 0) { - r_u->rid = Realloc(r_u->rid, + r_u->rid = (uint32*)Realloc(r_u->rid, sizeof(r_u->rid[0]) * r_u->num_entries); if (r_u->rid == NULL) { @@ -3526,7 +3526,7 @@ reads or writes a structure. ********************************************************************/ BOOL samr_io_q_lookup_rids(char *desc, SAMR_Q_LOOKUP_RIDS *q_u, prs_struct *ps, int depth) { - int i; + uint32 i; fstring tmp; if (q_u == NULL) return False; @@ -3546,7 +3546,7 @@ BOOL samr_io_q_lookup_rids(char *desc, SAMR_Q_LOOKUP_RIDS *q_u, prs_struct *ps, if (q_u->num_rids2 != 0) { - q_u->rid = Realloc(q_u->rid, sizeof(q_u->rid[0]) * + q_u->rid = (uint32*)Realloc(q_u->rid, sizeof(q_u->rid[0]) * q_u->num_rids2); if (q_u->rid == NULL) { @@ -3593,7 +3593,7 @@ BOOL make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u, uint32 num_names, fstring *name, uint8 *type, uint32 status) { - int i; + uint32 i; if (r_u == NULL || name == NULL || type == NULL) return False; DEBUG(5,("make_samr_r_lookup_rids\n")); @@ -3610,19 +3610,19 @@ BOOL make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u, if (num_names != 0) { - r_u->hdr_name = malloc(num_names * sizeof(r_u->hdr_name[0])); + r_u->hdr_name = (UNIHDR*)malloc(num_names * sizeof(r_u->hdr_name[0])); if (r_u->hdr_name == NULL) { samr_free_r_lookup_rids(r_u); return False; } - r_u->uni_name = malloc(num_names * sizeof(r_u->uni_name[0])); + r_u->uni_name = (UNISTR2*)malloc(num_names * sizeof(r_u->uni_name[0])); if (r_u->uni_name == NULL) { samr_free_r_lookup_rids(r_u); return False; } - r_u->type = malloc(r_u->num_types2 * sizeof(r_u->type[0])); + r_u->type = (uint32*)malloc(r_u->num_types2 * sizeof(r_u->type[0])); if (r_u->type == NULL) { samr_free_r_lookup_rids(r_u); @@ -3659,7 +3659,7 @@ reads or writes a structure. ********************************************************************/ BOOL samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS *r_u, prs_struct *ps, int depth) { - int i; + uint32 i; fstring tmp; if (r_u == NULL) return False; @@ -3674,15 +3674,15 @@ BOOL samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS *r_u, prs_struct *ps, if (r_u->ptr_names != 0 && r_u->num_names1 != 0) { - r_u->hdr_name = Realloc(r_u->hdr_name, r_u->num_names2 * - sizeof(r_u->hdr_name[0])); + r_u->hdr_name = (UNIHDR*)Realloc(r_u->hdr_name, + r_u->num_names2 * sizeof(r_u->hdr_name[0])); if (r_u->hdr_name == NULL) { return False; } - r_u->uni_name = Realloc(r_u->uni_name, r_u->num_names2 * - sizeof(r_u->uni_name[0])); + r_u->uni_name = (UNISTR2*)Realloc(r_u->uni_name, + r_u->num_names2 * sizeof(r_u->uni_name[0])); if (r_u->uni_name == NULL) { free(r_u->hdr_name); @@ -3710,7 +3710,7 @@ BOOL samr_io_r_lookup_rids(char *desc, SAMR_R_LOOKUP_RIDS *r_u, prs_struct *ps, if (r_u->ptr_types != 0 && r_u->num_types1 != 0) { - r_u->type = Realloc(r_u->type, r_u->num_types2 * + r_u->type = (uint32*)Realloc(r_u->type, r_u->num_types2 * sizeof(r_u->type[0])); if (r_u->type == NULL) { @@ -4137,7 +4137,7 @@ reads or writes a structure. ********************************************************************/ BOOL samr_io_r_query_aliasmem(char *desc, SAMR_R_QUERY_ALIASMEM *r_u, prs_struct *ps, int depth) { - int i; + uint32 i; uint32 ptr_sid[MAX_LOOKUP_SIDS]; if (r_u == NULL) return False; @@ -4186,7 +4186,7 @@ BOOL make_samr_q_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u, POLICY_HND *pol, uint32 flags, uint32 num_names, char **name) { - int i; + uint32 i; if (q_u == NULL) return False; DEBUG(5,("make_samr_q_lookup_names\n")); @@ -4214,7 +4214,7 @@ reads or writes a structure. ********************************************************************/ BOOL samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *ps, int depth) { - int i; + uint32 i; if (q_u == NULL) return False; @@ -4256,7 +4256,7 @@ makes a SAMR_R_LOOKUP_NAMES structure. BOOL make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, uint32 num_rids, uint32 *rid, uint8 *type, uint32 status) { - int i; + uint32 i; if (r_u == NULL) return False; DEBUG(5,("make_samr_r_lookup_names\n")); @@ -4300,7 +4300,7 @@ reads or writes a structure. ********************************************************************/ BOOL samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth) { - int i; + uint32 i; fstring tmp; if (r_u == NULL) return False; @@ -5355,7 +5355,8 @@ BOOL samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps } case 24: { - q_u->info.id = Realloc(NULL, sizeof(*q_u->info.id24)); + q_u->info.id = (SAM_USER_INFO_24*)Realloc(NULL, + sizeof(*q_u->info.id24)); if (q_u->info.id == NULL) { DEBUG(2,("samr_io_q_query_userinfo: info pointer not initialised\n")); @@ -5366,7 +5367,8 @@ BOOL samr_io_q_set_userinfo(char *desc, SAMR_Q_SET_USERINFO *q_u, prs_struct *ps } case 23: { - q_u->info.id = Realloc(NULL, sizeof(*q_u->info.id23)); + q_u->info.id = (SAM_USER_INFO_23*)Realloc(NULL, + sizeof(*q_u->info.id23)); if (q_u->info.id == NULL) { DEBUG(2,("samr_io_q_query_userinfo: info pointer not initialised\n")); diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index ea44db0205..a226608680 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -458,7 +458,7 @@ void cmd_sam_add_aliasmem(struct client_info *info) while (next_token(NULL, tmp, NULL, sizeof(tmp))) { num_names++; - names = Realloc(names, num_names * sizeof(char*)); + names = (char**)Realloc(names, num_names * sizeof(char*)); if (names == NULL) { DEBUG(0,("Realloc returned NULL\n")); @@ -960,7 +960,7 @@ void cmd_sam_add_groupmem(struct client_info *info) uint32 type[MAX_LOOKUP_SIDS]; uint32 num_rids; uint32 num_group_rids; - int i; + uint32 i; DOM_SID sid_1_5_20; string_to_sid(&sid_1_5_20, "S-1-5-32"); @@ -984,7 +984,7 @@ void cmd_sam_add_groupmem(struct client_info *info) while (res && next_token(NULL, tmp, NULL, sizeof(tmp))) { num_names++; - names = Realloc(names, num_names * sizeof(char*)); + names = (char**)Realloc(names, num_names * sizeof(char*)); if (names == NULL) { DEBUG(0,("Realloc returned NULL\n")); @@ -1227,13 +1227,13 @@ static void req_group_info(struct client_info *info, uint16 fnum, user_rid, &num_groups, &gid) && gid != NULL) { - int i; + uint32 i; uint32 num_names; uint32 *rid_mem = NULL; char **name = NULL; uint32 *type = NULL; - rid_mem = malloc(num_groups * sizeof(rid_mem[0])); + rid_mem = (uint32*)malloc(num_groups * sizeof(rid_mem[0])); if (rid_mem == NULL) { @@ -1277,8 +1277,8 @@ static void req_alias_info(struct client_info *info, uint16 fnum, uint32 *ptr_sid; DOM_SID2 *als_sid; - ptr_sid = malloc(sizeof(ptr_sid[0]) * 1); - als_sid = malloc(sizeof(als_sid[0]) * 1); + ptr_sid = (uint32*) malloc(sizeof(ptr_sid[0]) * 1); + als_sid = (DOM_SID2*)malloc(sizeof(als_sid[0]) * 1); make_dom_sid2(&als_sid[0], sid1); sid_append_rid(&als_sid[0].sid, user_rid); @@ -1362,7 +1362,7 @@ int msrpc_sam_enum_users(struct client_info *info, fstring sid; DOM_SID sid1; DOM_SID sid_1_5_20; - int user_idx; + uint32 user_idx; BOOL res = True; BOOL res1 = True; uint32 start_idx = 0x0; @@ -1907,11 +1907,11 @@ void cmd_sam_enum_aliases(struct client_info *info) char **names = NULL; int num_names = 0; DOM_SID **sids = NULL; - int i; + uint32 i; if (num_aliases != 0) { - sids = malloc(num_aliases * sizeof(DOM_SID*)); + sids = (DOM_SID**)malloc(num_aliases * sizeof(DOM_SID*)); } res3 = sids != NULL; @@ -1994,7 +1994,7 @@ static void req_groupmem_info(struct client_info *info, uint16 fnum, group_rid, &num_mem, &rid_mem, &attr_mem)) { BOOL res3 = True; - int num_names = 0; + uint32 num_names = 0; char **name = NULL; uint32 *type = NULL; |