size_t len = response->length - sizeof(struct winbindd_response);
prs_struct ps;
if (len > 0) {
- info3_ndr = response->extra_data;
+ info3_ndr = response->extra_data.data;
if (!prs_init(&ps, len, mem_ctx, UNMARSHALL)) {
return NT_STATUS_NO_MEMORY;
}
nt_status = NT_STATUS(response.data.auth.nt_status);
- if (result == NSS_STATUS_SUCCESS && response.extra_data) {
+ if (result == NSS_STATUS_SUCCESS && response.extra_data.data) {
if (NT_STATUS_IS_OK(nt_status)) {
if (NT_STATUS_IS_OK(nt_status = get_info3_from_ndr(mem_ctx, &response, &info3))) {
nt_status = make_server_info_info3(mem_ctx,
nt_status = NT_STATUS_NO_LOGON_SERVERS;
}
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
return nt_status;
}
AC_CHECK_SIZEOF(int,cross)
AC_CHECK_SIZEOF(long,cross)
+AC_CHECK_SIZEOF(long long,cross)
AC_CHECK_SIZEOF(short,cross)
AC_C_CONST
#endif
#endif
+/*
+ * check for 8 byte long long
+ */
+
+#if !defined(uint64)
+#if (SIZEOF_LONG == 8)
+#define uint64 unsigned long
+#elif (SIZEOF_LONG_LONG == 8)
+#define uint64 unsigned long long
+#endif /* don't lie. If we don't have it, then don't use it */
+#endif
+
+
/*
* Types for devices, inodes and offsets.
*/
/* Return group list. Don't forget to free the group list
when finished. */
- *groups = (gid_t *)response.extra_data;
+ *groups = (gid_t *)response.extra_data.data;
return response.data.num_entries;
}
/* Free any allocated extra_data */
if (response)
- SAFE_FREE(response->extra_data);
+ SAFE_FREE(response->extra_data.data);
}
/* Initialise a request structure */
request.flags = WBFLAG_RECURSE;
if (winbindd_request_response(WINBINDD_PRIV_PIPE_DIR, &request, &response) == NSS_STATUS_SUCCESS) {
int fd;
- if ((fd = winbind_named_pipe_sock(response.extra_data)) != -1) {
+ if ((fd = winbind_named_pipe_sock(response.extra_data.data)) != -1) {
close(winbindd_fd);
winbindd_fd = fd;
}
}
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
return winbindd_fd;
#else
the server. This has no meaning in the client's address space
so we clear it out. */
- response->extra_data = NULL;
+ response->extra_data.data = NULL;
/* Read variable length response */
/* Mallocate memory for extra data */
- if (!(response->extra_data = malloc(extra_data_len))) {
+ if (!(response->extra_data.data = malloc(extra_data_len))) {
return -1;
}
- if ((result2 = read_sock(response->extra_data, extra_data_len))
+ if ((result2 = read_sock(response->extra_data.data, extra_data_len))
== -1) {
free_response(response);
return -1;
}
if ((request->extra_len != 0) &&
- (write_sock(request->extra_data, request->extra_len, request->flags & WBFLAG_RECURSE) == -1)) {
+ (write_sock(request->extra_data.data, request->extra_len, request->flags & WBFLAG_RECURSE) == -1)) {
return NSS_STATUS_UNAVAIL;
}
return False;
for (i = 0; i < response.data.num_entries; i++)
- d_printf("%d\n", (int)((gid_t *)response.extra_data)[i]);
+ d_printf("%d\n", (int)((gid_t *)response.extra_data.data)[i]);
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
return True;
}
if (result != NSS_STATUS_SUCCESS)
return False;
- s = response.extra_data;
+ s = response.extra_data.data;
for (i = 0; i < response.data.num_entries; i++) {
d_printf("%s\n", s);
s += strlen(s) + 1;
}
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
return True;
}
return False;
if (response.data.num_entries != 0)
- printf("%s", (char *)response.extra_data);
+ printf("%s", (char *)response.extra_data.data);
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
return True;
}
/* Display response */
- if (response.extra_data) {
- const char *extra_data = (char *)response.extra_data;
+ if (response.extra_data.data) {
+ const char *extra_data = (char *)response.extra_data.data;
fstring name;
char *p;
d_printf("%s\n", name);
}
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
}
return True;
/* Display response */
- if (response.extra_data) {
- char *extra_data = (char *)response.extra_data;
+ if (response.extra_data.data) {
+ char *extra_data = (char *)response.extra_data.data;
d_printf("%s", extra_data);
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
}
return True;
if (result != NSS_STATUS_SUCCESS)
return False;
- if (response.extra_data == NULL) {
+ if (response.extra_data.data == NULL) {
d_fprintf(stderr, "Did not get token data\n");
return False;
}
- if (!afs_settoken_str((char *)response.extra_data)) {
+ if (!afs_settoken_str((char *)response.extra_data.data)) {
d_fprintf(stderr, "Could not set token\n");
return False;
}
/* Look through extra data */
- if (!response.extra_data)
+ if (!response.extra_data.data)
return False;
- extra_data = (const char *)response.extra_data;
+ extra_data = (const char *)response.extra_data.data;
while(next_token(&extra_data, name, ",", sizeof(fstring)))
d_printf("%s\n", name);
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
return True;
}
/* Look through extra data */
- if (!response.extra_data)
+ if (!response.extra_data.data)
return False;
- extra_data = (const char *)response.extra_data;
+ extra_data = (const char *)response.extra_data.data;
while(next_token(&extra_data, name, ",", sizeof(fstring)))
d_printf("%s\n", name);
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
return True;
}
HANDLE_ERRORS(ret);
- grp = fill_grent(&response.data.gr, response.extra_data);
+ grp = fill_grent(&response.data.gr, response.extra_data.data);
free_response(&response);
HANDLE_ERRORS(ret);
- grp = fill_grent(&response.data.gr, response.extra_data);
+ grp = fill_grent(&response.data.gr, response.extra_data.data);
free_response(&response);
HANDLE_ERRORS(ret);
num_gids = response.data.num_entries;
- gid_list = (gid_t *)response.extra_data;
+ gid_list = (gid_t *)response.extra_data.data;
/* allocate a space large enough to contruct the string */
tmpbuf = malloc(num_gids*12);
return -1;
}
- len = strlen(response.extra_data);
+ len = strlen(response.extra_data.data);
s = malloc(len+2);
if (!s) {
return -1;
}
- memcpy(s, response.extra_data, len+1);
+ memcpy(s, response.extra_data.data, len+1);
replace_commas(s);
return -1;
}
- len = strlen(response.extra_data);
+ len = strlen(response.extra_data.data);
s = malloc(len+2);
if (!s) {
return -1;
}
- memcpy(s, response.extra_data, len+1);
+ memcpy(s, response.extra_data.data, len+1);
replace_commas(s);
#define uint8 unsigned char
#endif
+/*
+ * check for 8 byte long long
+ */
+
+#if !defined(uint64)
+#if (SIZEOF_LONG == 8)
+#define uint64 unsigned long
+#elif (SIZEOF_LONG_LONG == 8)
+#define uint64 unsigned long long
+#endif /* don't lie. If we don't have it, then don't use it */
+#endif
+
+
/* zero a structure */
#ifndef ZERO_STRUCT
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
break;
case WINBINDD_GETGRNAM:
case WINBINDD_GETGRGID:
- if (gr->num_gr_mem && response.extra_data)
- members = response.extra_data;
+ if (gr->num_gr_mem && response.extra_data.data)
+ members = response.extra_data.data;
else
members = "";
snprintf(result,maxlen,"%s:%s:%d:%s\n",
"callback (winbind) - %d GETGRENT responses\n",
response.data.num_entries);
if (response.data.num_entries) {
- gr = (struct winbindd_gr *)response.extra_data;
+ gr = (struct winbindd_gr *)response.extra_data.data;
if (! gr ) {
- nsd_logprintf(NSD_LOG_MIN, " no extra_data\n");
+ nsd_logprintf(NSD_LOG_MIN, " no extra_data.data\n");
free_response(&response);
return NSD_ERROR;
}
- members = (char *)response.extra_data +
+ members = (char *)response.extra_data.data +
(response.data.num_entries * sizeof(struct winbindd_gr));
for (i = 0; i < response.data.num_entries; i++) {
snprintf(result,maxlen,"%s:%s:%d:%s\n",
"callback (winbind) - %d GETPWENT responses\n",
response.data.num_entries);
if (response.data.num_entries) {
- pw = (struct winbindd_pw *)response.extra_data;
+ pw = (struct winbindd_pw *)response.extra_data.data;
if (! pw ) {
nsd_logprintf(NSD_LOG_MIN, " no extra_data\n");
free_response(&response);
return_result:
- pw_cache = getpwent_response.extra_data;
+ pw_cache = getpwent_response.extra_data.data;
/* Check data is valid */
return_result:
- gr_cache = getgrent_response.extra_data;
+ gr_cache = getgrent_response.extra_data.data;
/* Check data is valid */
num_gr_cache * sizeof(struct winbindd_gr);
ret = fill_grent(result, &gr_cache[ndx_gr_cache],
- ((char *)getgrent_response.extra_data)+mem_ofs,
+ ((char *)getgrent_response.extra_data.data)+mem_ofs,
&buffer, &buflen);
/* Out of memory - try again */
if (ret == NSS_STATUS_SUCCESS) {
ret = fill_grent(result, &response.data.gr,
- response.extra_data,
+ response.extra_data.data,
&buffer, &buflen);
if (ret == NSS_STATUS_TRYAGAIN) {
/* We've been called again */
ret = fill_grent(result, &response.data.gr,
- response.extra_data, &buffer, &buflen);
+ response.extra_data.data, &buffer, &buflen);
if (ret == NSS_STATUS_TRYAGAIN) {
keep_response = True;
if (ret == NSS_STATUS_SUCCESS) {
ret = fill_grent(result, &response.data.gr,
- response.extra_data,
+ response.extra_data.data,
&buffer, &buflen);
if (ret == NSS_STATUS_TRYAGAIN) {
/* We've been called again */
ret = fill_grent(result, &response.data.gr,
- response.extra_data, &buffer, &buflen);
+ response.extra_data.data, &buffer, &buflen);
if (ret == NSS_STATUS_TRYAGAIN) {
keep_response = True;
if (ret == NSS_STATUS_SUCCESS) {
int num_gids = response.data.num_entries;
- gid_t *gid_list = (gid_t *)response.extra_data;
+ gid_t *gid_list = (gid_t *)response.extra_data.data;
/* Copy group list to client */
*num_groups = response.data.num_entries;
*group_sids = buffer;
- memcpy(buffer, response.extra_data, response.length - sizeof(response));
+ memcpy(buffer, response.extra_data.data, response.length - sizeof(response));
errno = *errnop = 0;
done:
/* Free response data - we may be interrupted and receive another
command before being able to send this data off. */
- SAFE_FREE(state->response.extra_data);
+ SAFE_FREE(state->response.extra_data.data);
ZERO_STRUCT(state->response);
return;
}
- SAFE_FREE(state->request.extra_data);
- SAFE_FREE(state->response.extra_data);
+ SAFE_FREE(state->request.extra_data.data);
+ SAFE_FREE(state->response.extra_data.data);
setup_async_read(&state->fd_event, &state->request, sizeof(uint32),
request_len_recv, state);
return;
}
- setup_async_write(&state->fd_event, state->response.extra_data,
+ setup_async_write(&state->fd_event, state->response.extra_data.data,
state->response.length - sizeof(state->response),
response_extra_sent, state);
}
}
if (state->request.extra_len == 0) {
- state->request.extra_data = NULL;
+ state->request.extra_data.data = NULL;
request_recv(state, True);
return;
}
(state->request.extra_len > WINBINDD_MAX_EXTRA_DATA)) {
DEBUG(3, ("Got request with %d bytes extra data on "
"unprivileged socket\n", (int)state->request.extra_len));
- state->request.extra_data = NULL;
+ state->request.extra_data.data = NULL;
state->finished = True;
return;
}
- state->request.extra_data =
+ state->request.extra_data.data =
SMB_MALLOC_ARRAY(char, state->request.extra_len + 1);
- if (state->request.extra_data == NULL) {
+ if (state->request.extra_data.data == NULL) {
DEBUG(0, ("malloc failed\n"));
state->finished = True;
return;
}
/* Ensure null termination */
- state->request.extra_data[state->request.extra_len] = '\0';
+ state->request.extra_data.data[state->request.extra_len] = '\0';
- setup_async_read(&state->fd_event, state->request.extra_data,
+ setup_async_read(&state->fd_event, state->request.extra_data.data,
state->request.extra_len, request_recv, state);
}
/* We may have some extra data that was not freed if the
client was killed unexpectedly */
- SAFE_FREE(state->response.extra_data);
+ SAFE_FREE(state->response.extra_data.data);
if (state->mem_ctx != NULL) {
talloc_destroy(state->mem_ctx);
return;
}
- aliases_str = response->extra_data;
+ aliases_str = response->extra_data.data;
if (aliases_str == NULL) {
DEBUG(10, ("getsidaliases return 0 SIDs\n"));
return;
}
- SAFE_FREE(response->extra_data);
+ SAFE_FREE(response->extra_data.data);
cont(private_data, True, sids, num_sids);
}
ZERO_STRUCT(request);
request.cmd = WINBINDD_DUAL_GETSIDALIASES;
request.extra_len = len;
- request.extra_data = sidstr;
+ request.extra_data.data = sidstr;
do_async_domain(mem_ctx, domain, &request, getsidaliases_recv,
cont, private_data);
DEBUG(3, ("[%5lu]: getsidaliases\n", (unsigned long)state->pid));
- sidstr = state->request.extra_data;
+ sidstr = state->request.extra_data.data;
if (sidstr == NULL)
sidstr = talloc_strdup(state->mem_ctx, "\n"); /* No SID */
}
if (!print_sidlist(NULL, sids, num_sids,
- (char **)&state->response.extra_data, &len)) {
+ (char **)&state->response.extra_data.data, &len)) {
DEBUG(0, ("Could not print_sidlist\n"));
return WINBINDD_ERROR;
}
- if (state->response.extra_data != NULL) {
+ if (state->response.extra_data.data != NULL) {
DEBUG(10, ("aliases_list: %s\n",
- (char *)state->response.extra_data));
+ (char *)state->response.extra_data.data));
state->response.length += len+1;
}
return;
}
- sids_str = response->extra_data;
+ sids_str = response->extra_data.data;
if (sids_str == NULL) {
/* This could be normal if we are dealing with a
return;
}
- SAFE_FREE(response->extra_data);
+ SAFE_FREE(response->extra_data.data);
if (state->alias_domain == NULL) {
DEBUG(10, ("Don't expand domain local groups\n"));
fstr_sprintf(key_str, "DE/%d", pid);
if (tdb_store(wcache->tdb, string_tdb_data(key_str),
- make_tdb_data(response->extra_data,
+ make_tdb_data(response->extra_data.data,
response->length - sizeof(*response)),
TDB_REPLACE) == 0)
return;
SAFE_FREE(data.dptr);
if (response->length == sizeof(*response)) {
- response->extra_data = NULL;
+ response->extra_data.data = NULL;
return True;
}
dump_data(11, data.dptr, data.dsize);
- response->extra_data = data.dptr;
+ response->extra_data.data = data.dptr;
return True;
}
}
if (state->request.extra_len == 0) {
- state->request.extra_data = NULL;
+ state->request.extra_data.data = NULL;
return;
}
DEBUG(10, ("Need to read %d extra bytes\n", (int)state->request.extra_len));
- state->request.extra_data =
+ state->request.extra_data.data =
SMB_MALLOC_ARRAY(char, state->request.extra_len + 1);
- if (state->request.extra_data == NULL) {
+ if (state->request.extra_data.data == NULL) {
DEBUG(0, ("malloc failed\n"));
state->finished = True;
return;
}
/* Ensure null termination */
- state->request.extra_data[state->request.extra_len] = '\0';
+ state->request.extra_data.data[state->request.extra_len] = '\0';
- len = read_data(state->sock, state->request.extra_data,
+ len = read_data(state->sock, state->request.extra_data.data,
state->request.extra_len);
if (len != state->request.extra_len) {
return;
}
- setup_async_write(&state->child->event, state->request->extra_data,
+ setup_async_write(&state->child->event, state->request->extra_data.data,
state->request->extra_len,
async_request_sent, state);
}
state.request.null_term = '\0';
child_process_request(child->domain, &state);
- SAFE_FREE(state.request.extra_data);
+ SAFE_FREE(state.request.extra_data.data);
cache_store_response(sys_getpid(), &state.response);
- SAFE_FREE(state.response.extra_data);
+ SAFE_FREE(state.response.extra_data.data);
/* We just send the result code back, the result
* structure needs to be fetched via the
state->response.data.gr.gr_mem_ofs = 0;
state->response.length += gr_mem_len;
- state->response.extra_data = gr_mem;
+ state->response.extra_data.data = gr_mem;
request_ok(state);
}
state->response.data.gr.gr_mem_ofs = 0;
state->response.length += gr_mem_len;
- state->response.extra_data = gr_mem;
+ state->response.extra_data.data = gr_mem;
request_ok(state);
}
num_groups = MIN(MAX_GETGRENT_GROUPS, state->request.data.num_entries);
- if ((state->response.extra_data = SMB_MALLOC_ARRAY(struct winbindd_gr, num_groups)) == NULL) {
+ if ((state->response.extra_data.data = SMB_MALLOC_ARRAY(struct winbindd_gr, num_groups)) == NULL) {
request_error(state);
return;
}
- memset(state->response.extra_data, '\0',
+ memset(state->response.extra_data.data, '\0',
num_groups * sizeof(struct winbindd_gr) );
state->response.data.num_entries = 0;
- group_list = (struct winbindd_gr *)state->response.extra_data;
+ group_list = (struct winbindd_gr *)state->response.extra_data.data;
if (!state->getgrent_initialized)
winbindd_setgrent_internal(state);
if (group_list_ndx == 0)
goto done;
- state->response.extra_data = SMB_REALLOC(
- state->response.extra_data,
+ state->response.extra_data.data = SMB_REALLOC(
+ state->response.extra_data.data,
group_list_ndx * sizeof(struct winbindd_gr) + gr_mem_list_len);
- if (!state->response.extra_data) {
+ if (!state->response.extra_data.data) {
DEBUG(0, ("out of memory\n"));
group_list_ndx = 0;
SAFE_FREE(gr_mem_list);
return;
}
- memcpy(&((char *)state->response.extra_data)
+ memcpy(&((char *)state->response.extra_data.data)
[group_list_ndx * sizeof(struct winbindd_gr)],
gr_mem_list, gr_mem_list_len);
/* Assign extra_data fields in response structure */
if (extra_data) {
extra_data[extra_data_len - 1] = '\0';
- state->response.extra_data = extra_data;
+ state->response.extra_data.data = extra_data;
state->response.length += extra_data_len;
}
}
s->state->response.data.num_entries = s->num_token_gids;
- s->state->response.extra_data = s->token_gids;
+ s->state->response.extra_data.data = s->token_gids;
s->state->response.length += s->num_token_gids * sizeof(gid_t);
request_ok(s->state);
}
/* Send data back to client */
state->response.data.num_entries = num_sids;
- state->response.extra_data = ret;
+ state->response.extra_data.data = ret;
state->response.length += ret_size;
request_ok(state);
}
if (num_groups == 0) {
state->response.data.num_entries = 0;
- state->response.extra_data = NULL;
+ state->response.extra_data.data = NULL;
return WINBINDD_OK;
}
return WINBINDD_ERROR;
}
- state->response.extra_data = sidstring;
+ state->response.extra_data.data = sidstring;
state->response.length += len+1;
state->response.data.num_entries = num_groups;
extra_data_len = strlen(extra_data);
if (extra_data_len > 0) {
- state->response.extra_data = SMB_STRDUP(extra_data);
+ state->response.extra_data.data = SMB_STRDUP(extra_data);
state->response.length += extra_data_len+1;
}
cli_state->response.length =
sizeof(cli_state->response) +
strlen(state->extra_data) + 1;
- cli_state->response.extra_data =
+ cli_state->response.extra_data.data =
SMB_STRDUP(state->extra_data);
request_ok(cli_state);
return;
DEBUG(3, ("[%5lu]: request location of privileged pipe\n",
(unsigned long)state->pid));
- state->response.extra_data = SMB_STRDUP(get_winbind_priv_pipe_dir());
- if (!state->response.extra_data) {
+ state->response.extra_data.data = SMB_STRDUP(get_winbind_priv_pipe_dir());
+ if (!state->response.extra_data.data) {
DEBUG(0, ("malloc failed\n"));
request_error(state);
return;
/* must add one to length to copy the 0 for string termination */
state->response.length +=
- strlen((char *)state->response.extra_data) + 1;
+ strlen((char *)state->response.extra_data.data) + 1;
request_ok(state);
}
fstring gr_name;
fstring gr_passwd;
gid_t gr_gid;
- size_t num_gr_mem;
- size_t gr_mem_ofs; /* offset to group membership */
+ uint32 num_gr_mem;
+ uint32 gr_mem_ofs; /* offset to group membership */
char **gr_mem;
} WINBINDD_GR;
} dual_idmapset;
BOOL list_all_domains;
} data;
- char *extra_data;
- size_t extra_len;
+ union {
+#if defined(uint64)
+ uint64 z;
+#endif
+ char *data;
+ } extra_data;
+ uint32 extra_len;
char null_term;
};
/* Variable length return data */
- void *extra_data; /* getgrnam, getgrgid, getgrent */
+ union {
+#if defined(uint64)
+ uint64 z;
+#endif
+ void *data;
+ } extra_data;
};
struct WINBINDD_CCACHE_ENTRY {
}
size = prs_data_size(&ps);
- state->response.extra_data = SMB_MALLOC(size);
- if (!state->response.extra_data) {
+ state->response.extra_data.data = SMB_MALLOC(size);
+ if (!state->response.extra_data.data) {
prs_mem_free(&ps);
return NT_STATUS_NO_MEMORY;
}
- memset( state->response.extra_data, '\0', size );
- prs_copy_all_data_out(state->response.extra_data, &ps);
+ memset( state->response.extra_data.data, '\0', size );
+ prs_copy_all_data_out(state->response.extra_data.data, &ps);
state->response.length += size;
prs_mem_free(&ps);
return NT_STATUS_OK;
cell += 1;
/* Append an AFS token string */
- state->response.extra_data =
+ state->response.extra_data.data =
afs_createtoken_str(afsname, cell);
- if (state->response.extra_data != NULL)
+ if (state->response.extra_data.data != NULL)
state->response.length +=
- strlen(state->response.extra_data)+1;
+ strlen(state->response.extra_data.data)+1;
no_token:
TALLOC_FREE(afsname);
DEBUG(5, ("Setting unix username to [%s]\n", username_out));
- state->response.extra_data = SMB_STRDUP(username_out);
- if (!state->response.extra_data) {
+ state->response.extra_data.data = SMB_STRDUP(username_out);
+ if (!state->response.extra_data.data) {
result = NT_STATUS_NO_MEMORY;
goto done;
}
- state->response.length += strlen(state->response.extra_data)+1;
+ state->response.length += strlen(state->response.extra_data.data)+1;
}
if (state->request.flags & WBFLAG_PAM_USER_SESSION_KEY) {
num_users = MIN(MAX_GETPWENT_USERS, state->request.data.num_entries);
- if ((state->response.extra_data = SMB_MALLOC_ARRAY(struct winbindd_pw, num_users)) == NULL) {
+ if ((state->response.extra_data.data = SMB_MALLOC_ARRAY(struct winbindd_pw, num_users)) == NULL) {
request_error(state);
return;
}
- memset(state->response.extra_data, 0, num_users *
+ memset(state->response.extra_data.data, 0, num_users *
sizeof(struct winbindd_pw));
- user_list = (struct winbindd_pw *)state->response.extra_data;
+ user_list = (struct winbindd_pw *)state->response.extra_data.data;
if (!state->getpwent_initialized)
winbindd_setpwent_internal(state);
if (extra_data) {
extra_data[extra_data_len - 1] = '\0';
- state->response.extra_data = extra_data;
+ state->response.extra_data.data = extra_data;
state->response.length += extra_data_len;
}
return;
}
- p = response->extra_data;
+ p = response->extra_data.data;
while ((p != NULL) && (*p != '\0')) {
char *q, *sidstr, *alt_name;
p += 1;
}
- SAFE_FREE(response->extra_data);
+ SAFE_FREE(response->extra_data.data);
talloc_destroy(state->mem_ctx);
}
}
for (i = 0; i < response.data.num_entries; i++) {
- gid_t gid = ((gid_t *)response.extra_data)[i];
+ gid_t gid = ((gid_t *)response.extra_data.data)[i];
DOM_SID sid;
struct winbindd_request sidrequest;
add_sid_to_token(token, &sid);
}
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
return True;
}
/* Look through extra data */
- if (!response.extra_data)
+ if (!response.extra_data.data)
return False;
- extra_data = (const char *)response.extra_data;
+ extra_data = (const char *)response.extra_data.data;
*num_tokens = 0;
while(next_token(&extra_data, name, ",", sizeof(fstring))) {
return False;
}
- extra_data = (const char *)response.extra_data;
+ extra_data = (const char *)response.extra_data.data;
i=0;
while(next_token(&extra_data, name, ",", sizeof(fstring))) {
i+=1;
}
- SAFE_FREE(response.extra_data);
+ SAFE_FREE(response.extra_data.data);
*user_tokens = result;
}
if (flags & WBFLAG_PAM_UNIX_NAME) {
- *unix_name = SMB_STRDUP((char *)response.extra_data);
+ *unix_name = SMB_STRDUP((char *)response.extra_data.data);
if (!*unix_name) {
free_response(&response);
return NT_STATUS_NO_MEMORY;