fs = fopen(file_name,"r");
if(fs == NULL)
return errno;
- line_buf = malloc(4096);
+ line_buf = (char *)malloc(4096);
if(line_buf == NULL) {
fclose(fs);
return -ENOMEM;
exit(1);
} else {
got_user = 1;
- user_name = calloc(1 + length,1);
+ user_name = (char *)calloc(1 + length,1);
/* BB adding free of user_name string before exit,
not really necessary but would be cleaner */
strncpy(user_name,temp_val, length);
exit(1);
} else {
if(mountpassword == NULL) {
- mountpassword = calloc(65,1);
+ mountpassword = (char *)calloc(65,1);
} else
memset(mountpassword,0,64);
if(mountpassword) {
exit(1);
} else {
if(domain_name == NULL) {
- domain_name = calloc(65,1);
+ domain_name = (char *)calloc(65,1);
} else
memset(domain_name,0,64);
if(domain_name) {
char c;
if(mountpassword == NULL)
- mountpassword = calloc(65,1);
+ mountpassword = (char *)calloc(65,1);
else
memset(mountpassword, 0, 64);
if(percent_char) {
*percent_char = ',';
if(mountpassword == NULL)
- mountpassword = calloc(65,1);
+ mountpassword = (char *)calloc(65,1);
if(mountpassword) {
if(got_password)
printf("\nmount.cifs warning - password specified twice\n");
if (value)
word_len += 1 + strlen(value);
- out = realloc(out, out_len + word_len + 2);
+ out = (char *)realloc(out, out_len + word_len + 2);
if (out == NULL) {
perror("malloc");
exit(1);
return;
}
- new_pass_buf = malloc(len+number_of_commas+1);
+ new_pass_buf = (char *)malloc(len+number_of_commas+1);
if(new_pass_buf == NULL)
return;
len = strlen(domainnm);
/* reset domainm to new buffer, and copy
domain name into it */
- domainnm = malloc(len+1);
+ domainnm = (char *)malloc(len+1);
if(domainnm == NULL)
return NULL;
share = strchr(unc_name,':');
if(share) {
free_share_name = 1;
- *punc_name = malloc(length+3);
+ *punc_name = (char *)malloc(length+3);
if(*punc_name == NULL) {
/* put the original string back if
no memory left */
break;
case 'p':
if(mountpassword == NULL)
- mountpassword = calloc(65,1);
+ mountpassword = (char *)calloc(65,1);
if(mountpassword) {
got_password = 1;
strncpy(mountpassword,optarg,64);
if (getenv("PASSWD")) {
if(mountpassword == NULL)
- mountpassword = calloc(65,1);
+ mountpassword = (char *)calloc(65,1);
if(mountpassword) {
strncpy(mountpassword,getenv("PASSWD"),64);
got_password = 1;
}
/* BB save off path and pop after mount returns? */
- resolved_path = malloc(PATH_MAX+1);
+ resolved_path = (char *)malloc(PATH_MAX+1);
if(resolved_path) {
/* Note that if we can not canonicalize the name, we get
another chance to see if it is valid when we chdir to it */
optlen += strlen(ipaddr) + 4;
if(mountpassword)
optlen += strlen(mountpassword) + 6;
- options = malloc(optlen + 10 + 64 /* space for commas in password */ + 8 /* space for domain= , domain name itself was counted as part of the length username string above */);
+ options = (char *)malloc(optlen + 10 + 64 /* space for commas in password */ + 8 /* space for domain= , domain name itself was counted as part of the length username string above */);
if(options == NULL) {
printf("Could not allocate memory for mount options\n");
mountent.mnt_fsname = share_name;
mountent.mnt_dir = mountpoint;
mountent.mnt_type = CONST_DISCARD(char *,"cifs");
- mountent.mnt_opts = malloc(220);
+ mountent.mnt_opts = (char *)malloc(220);
if(mountent.mnt_opts) {
char * mount_user = getusername();
memset(mountent.mnt_opts,0,200);
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"));
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"));
#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
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;
* 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"));
/* 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;
break;
}
- name_list = ent->sam_entries;
+ name_list = (struct acct_info *)ent->sam_entries;
if (!(domain =
find_domain_from_name(ent->domain_name))) {
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"));
/* 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"));
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))) {
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 */
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,
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;
}
/* build the reply */
- ret = SMB_MALLOC(ret_size);
+ ret = (char *)SMB_MALLOC(ret_size);
if (!ret) {
DEBUG(0, ("malloc failed\n"));
request_error(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))
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;
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;
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);
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) {
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) {
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) {
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 */
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",
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) {
break;
}
- name_list = ent->sam_entries;
+ name_list = (struct getpwent_user *)ent->sam_entries;
/* Lookup user info */
/* 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"));
return;
}
- p = response->extra_data.data;
+ p = (char *)response->extra_data.data;
while ((p != NULL) && (*p != '\0')) {
char *q, *sidstr, *alt_name;