diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-08-18 14:05:25 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:38:42 -0500 |
commit | 0b56ff1ea3bab9f5aebf43e3dfc4847b3f912553 (patch) | |
tree | 188f46328aa6f39329c2b4b64ee3742cb0ab6432 /source3/nsswitch | |
parent | f3828606bd7b826dbbb8a56b61750914ea10ecc5 (diff) | |
download | samba-0b56ff1ea3bab9f5aebf43e3dfc4847b3f912553.tar.gz samba-0b56ff1ea3bab9f5aebf43e3dfc4847b3f912553.tar.bz2 samba-0b56ff1ea3bab9f5aebf43e3dfc4847b3f912553.zip |
r17605: Some C++ warnings
(This used to be commit 05268d7a731861b10ce8556fd32a004808383923)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/winbindd_async.c | 6 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_cred_cache.c | 2 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_dual.c | 6 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_group.c | 24 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_misc.c | 6 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_pam.c | 10 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_sid.c | 9 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_user.c | 11 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_util.c | 2 |
9 files changed, 48 insertions, 28 deletions
diff --git a/source3/nsswitch/winbindd_async.c b/source3/nsswitch/winbindd_async.c index 75424db656..696f3501ef 100644 --- a/source3/nsswitch/winbindd_async.c +++ b/source3/nsswitch/winbindd_async.c @@ -1532,7 +1532,8 @@ static void winbindd_uid2sid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const char *sid) = c; + void (*cont)(void *priv, BOOL succ, const char *sid) = + (void (*)(void *, BOOL, const char *))c; if (!success) { DEBUG(5, ("Could not trigger uid2sid\n")); @@ -1587,7 +1588,8 @@ static void winbindd_gid2sid_recv(TALLOC_CTX *mem_ctx, BOOL success, struct winbindd_response *response, void *c, void *private_data) { - void (*cont)(void *priv, BOOL succ, const char *sid) = c; + void (*cont)(void *priv, BOOL succ, const char *sid) = + (void (*)(void *, BOOL, const char *))c; if (!success) { DEBUG(5, ("Could not trigger gid2sid\n")); diff --git a/source3/nsswitch/winbindd_cred_cache.c b/source3/nsswitch/winbindd_cred_cache.c index f5003ac8c6..688c8828d3 100644 --- a/source3/nsswitch/winbindd_cred_cache.c +++ b/source3/nsswitch/winbindd_cred_cache.c @@ -249,7 +249,7 @@ NTSTATUS add_ccache_to_list(const char *princ_name, #ifdef HAVE_MLOCK size_t len = strlen(pass)+1; - new_entry->pass = TALLOC_ZERO(mem_ctx, len); + new_entry->pass = (char *)TALLOC_ZERO(mem_ctx, len); NT_STATUS_HAVE_NO_MEMORY(new_entry->pass); #ifdef DEBUG_PASSWORD diff --git a/source3/nsswitch/winbindd_dual.c b/source3/nsswitch/winbindd_dual.c index 874b480214..32d85688b6 100644 --- a/source3/nsswitch/winbindd_dual.c +++ b/source3/nsswitch/winbindd_dual.c @@ -524,7 +524,8 @@ static void account_lockout_policy_handler(struct timed_event *te, const struct timeval *now, void *private_data) { - struct winbindd_child *child = private_data; + struct winbindd_child *child = + (struct winbindd_child *)private_data; struct winbindd_methods *methods; SAM_UNK_INFO_12 lockout_policy; @@ -823,7 +824,8 @@ static BOOL fork_domain_child(struct winbindd_child *child) * structure needs to be fetched via the * winbindd_cache. Hmm. That needs fixing... */ - if (write_data(state.sock, (void *)&state.response.result, + if (write_data(state.sock, + (const char *)&state.response.result, sizeof(state.response.result)) != sizeof(state.response.result)) { DEBUG(0, ("Could not write result\n")); diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c index 5cab6eb663..80d103336a 100644 --- a/source3/nsswitch/winbindd_group.c +++ b/source3/nsswitch/winbindd_group.c @@ -168,7 +168,7 @@ static BOOL fill_grent_mem(struct winbindd_domain *domain, /* Allocate buffer */ if (!buf && buf_len != 0) { - if (!(buf = SMB_MALLOC(buf_len))) { + if (!(buf = (char *)SMB_MALLOC(buf_len))) { DEBUG(1, ("out of memory\n")); result = False; goto done; @@ -730,7 +730,7 @@ void winbindd_getgrent(struct winbindd_cli_state *state) break; } - name_list = ent->sam_entries; + name_list = (struct acct_info *)ent->sam_entries; if (!(domain = find_domain_from_name(ent->domain_name))) { @@ -813,7 +813,8 @@ void winbindd_getgrent(struct winbindd_cli_state *state) if (result) { /* Append to group membership list */ - gr_mem_list = SMB_REALLOC( gr_mem_list, gr_mem_list_len + gr_mem_len); + gr_mem_list = (char *)SMB_REALLOC( + gr_mem_list, gr_mem_list_len + gr_mem_len); if (!gr_mem_list && (group_list[group_list_ndx].num_gr_mem != 0)) { DEBUG(0, ("out of memory\n")); @@ -941,7 +942,8 @@ void winbindd_list_groups(struct winbindd_cli_state *state) /* Allocate some memory for extra data. Note that we limit account names to sizeof(fstring) = 128 characters. */ - extra_data = SMB_REALLOC(extra_data, sizeof(fstring) * total_entries); + extra_data = (char *)SMB_REALLOC( + extra_data, sizeof(fstring) * total_entries); if (!extra_data) { DEBUG(0,("failed to enlarge buffer!\n")); @@ -1072,7 +1074,8 @@ void winbindd_getgroups(struct winbindd_cli_state *state) static void getgroups_usersid_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type) { - struct getgroups_state *s = private_data; + struct getgroups_state *s = + (struct getgroups_state *)private_data; if ((!success) || ((type != SID_NAME_USER) && (type != SID_NAME_COMPUTER))) { @@ -1089,7 +1092,8 @@ static void getgroups_usersid_recv(void *private_data, BOOL success, static void getgroups_tokensids_recv(void *private_data, BOOL success, DOM_SID *token_sids, size_t num_token_sids) { - struct getgroups_state *s = private_data; + struct getgroups_state *s = + (struct getgroups_state *)private_data; /* We need at least the user sid and the primary group in the token, * otherwise it's an error */ @@ -1111,7 +1115,8 @@ static void getgroups_tokensids_recv(void *private_data, BOOL success, static void getgroups_sid2gid_recv(void *private_data, BOOL success, gid_t gid) { - struct getgroups_state *s = private_data; + struct getgroups_state *s = + (struct getgroups_state *)private_data; if (success) add_gid_to_array_unique(NULL, gid, @@ -1181,7 +1186,8 @@ void winbindd_getusersids(struct winbindd_cli_state *state) static void getusersids_recv(void *private_data, BOOL success, DOM_SID *sids, size_t num_sids) { - struct winbindd_cli_state *state = private_data; + struct winbindd_cli_state *state = + (struct winbindd_cli_state *)private_data; char *ret = NULL; unsigned ofs, ret_size = 0; size_t i; @@ -1198,7 +1204,7 @@ static void getusersids_recv(void *private_data, BOOL success, DOM_SID *sids, } /* build the reply */ - ret = SMB_MALLOC(ret_size); + ret = (char *)SMB_MALLOC(ret_size); if (!ret) { DEBUG(0, ("malloc failed\n")); request_error(state); diff --git a/source3/nsswitch/winbindd_misc.c b/source3/nsswitch/winbindd_misc.c index d43617f778..9fb05d9df6 100644 --- a/source3/nsswitch/winbindd_misc.c +++ b/source3/nsswitch/winbindd_misc.c @@ -301,7 +301,8 @@ void winbindd_show_sequence(struct winbindd_cli_state *state) static void sequence_recv(void *private_data, BOOL success) { - struct sequence_state *state = private_data; + struct sequence_state *state = + (struct sequence_state *)private_data; uint32 seq = DOM_SEQUENCE_NONE; if ((success) && (state->response->result == WINBINDD_OK)) @@ -422,7 +423,8 @@ void winbindd_domain_info(struct winbindd_cli_state *state) static void domain_info_init_recv(void *private_data, BOOL success) { - struct domain_info_state *istate = private_data; + struct domain_info_state *istate = + (struct domain_info_state *)private_data; struct winbindd_cli_state *state = istate->cli_state; struct winbindd_domain *domain = istate->domain; diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c index 6af8e31bc0..66d297090b 100644 --- a/source3/nsswitch/winbindd_pam.c +++ b/source3/nsswitch/winbindd_pam.c @@ -104,7 +104,7 @@ static NTSTATUS append_info3_as_ndr(TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } memset( state->response.extra_data.data, '\0', size ); - prs_copy_all_data_out(state->response.extra_data.data, &ps); + prs_copy_all_data_out((char *)state->response.extra_data.data, &ps); state->response.length += size; prs_mem_free(&ps); return NT_STATUS_OK; @@ -1370,9 +1370,10 @@ done: state->response.extra_data.data = afs_createtoken_str(afsname, cell); - if (state->response.extra_data.data != NULL) + if (state->response.extra_data.data != NULL) { state->response.length += - strlen(state->response.extra_data.data)+1; + strlen((const char *)state->response.extra_data.data)+1; + } no_token: TALLOC_FREE(afsname); @@ -1622,7 +1623,8 @@ enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain, result = NT_STATUS_NO_MEMORY; goto done; } - state->response.length += strlen(state->response.extra_data.data)+1; + state->response.length += + strlen((const char *)state->response.extra_data.data)+1; } if (state->request.flags & WBFLAG_PAM_USER_SESSION_KEY) { diff --git a/source3/nsswitch/winbindd_sid.c b/source3/nsswitch/winbindd_sid.c index f38246cfbd..194104915a 100644 --- a/source3/nsswitch/winbindd_sid.c +++ b/source3/nsswitch/winbindd_sid.c @@ -328,7 +328,8 @@ void winbindd_uid_to_sid(struct winbindd_cli_state *state) static void uid2sid_recv(void *private_data, BOOL success, const char *sid) { - struct winbindd_cli_state *state = private_data; + struct winbindd_cli_state *state = + (struct winbindd_cli_state *)private_data; struct uid2sid_state *uid2sid_state; if (success) { @@ -472,7 +473,8 @@ void winbindd_gid_to_sid(struct winbindd_cli_state *state) static void gid2sid_recv(void *private_data, BOOL success, const char *sid) { - struct winbindd_cli_state *state = private_data; + struct winbindd_cli_state *state = + (struct winbindd_cli_state *)private_data; struct gid2sid_state *gid2sid_state; if (success) { @@ -562,7 +564,8 @@ static void gid2sid_lookupname_recv(void *private_data, BOOL success, static void gid2sid_idmap_set_mapping_recv(void *private_data, BOOL success) { - struct gid2sid_state *state = private_data; + struct gid2sid_state *state = + (struct gid2sid_state *)private_data; /* don't fail if we can't store it */ diff --git a/source3/nsswitch/winbindd_user.c b/source3/nsswitch/winbindd_user.c index f08efa044f..98df77c0f2 100644 --- a/source3/nsswitch/winbindd_user.c +++ b/source3/nsswitch/winbindd_user.c @@ -362,7 +362,8 @@ void winbindd_getpwnam(struct winbindd_cli_state *state) static void getpwnam_name2sid_recv(void *private_data, BOOL success, const DOM_SID *sid, enum SID_NAME_USE type) { - struct winbindd_cli_state *state = private_data; + struct winbindd_cli_state *state = + (struct winbindd_cli_state *)private_data; if (!success) { DEBUG(5, ("Could not lookup name for user %s\n", @@ -382,7 +383,8 @@ static void getpwnam_name2sid_recv(void *private_data, BOOL success, static void getpwuid_recv(void *private_data, BOOL success, const char *sid) { - struct winbindd_cli_state *state = private_data; + struct winbindd_cli_state *state = + (struct winbindd_cli_state *)private_data; DOM_SID user_sid; if (!success) { @@ -692,7 +694,7 @@ void winbindd_getpwent(struct winbindd_cli_state *state) break; } - name_list = ent->sam_entries; + name_list = (struct getpwent_user *)ent->sam_entries; /* Lookup user info */ @@ -778,7 +780,8 @@ void winbindd_list_users(struct winbindd_cli_state *state) /* Allocate some memory for extra data */ total_entries += num_entries; - extra_data = SMB_REALLOC(extra_data, sizeof(fstring) * total_entries); + extra_data = (char *)SMB_REALLOC( + extra_data, sizeof(fstring) * total_entries); if (!extra_data) { DEBUG(0,("failed to enlarge buffer!\n")); diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 27a00ef0fc..acaca16f0a 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -236,7 +236,7 @@ static void trustdom_recv(void *private_data, BOOL success) return; } - p = response->extra_data.data; + p = (char *)response->extra_data.data; while ((p != NULL) && (*p != '\0')) { char *q, *sidstr, *alt_name; |