74
74
NTSTATUS(*close_fn) (struct idmap_domain * dom);
77
const char* sid_string_static(const DOM_SID*);
77
79
/*********************************************************************
78
80
********************************************************************/
154
155
return NT_STATUS_OK;
159
return NT_STATUS_INVALID_PARAMETER;
156
162
ZERO_STRUCT(request);
157
163
ZERO_STRUCT(response);
159
/* allocate the DOM_SID array for the request */
165
fstrcpy(request.data.sid, sid_string_static(ids[0]->sid));
161
request.extra_len = count * sizeof(DOM_SID);
162
sids = SMB_MALLOC_ARRAY(DOM_SID, count);
163
for (i = 0; i < count; i++) {
164
sid_copy(&sids[i], ids[i]->sid);
167
switch (ids[0]->xid.type) {
169
cmd = WINBINDD_SID_TO_UID;
172
cmd = WINBINDD_SID_TO_GID;
175
DEBUG(4,("lwi_get_id_from_sid: Unknown query type (%u)\n",
177
return NT_STATUS_INVALID_PARAMETER;
166
request.extra_data.data = (char *)sids;
168
180
/* Make request */
170
result = winbindd_request_response(WINBINDD_SIDS_TO_XIDS,
171
&request, &response);
182
result = winbindd_request_response(cmd, &request, &response);
173
184
if (result != NSS_STATUS_SUCCESS)
174
185
return NT_STATUS_NONE_MAPPED;
176
187
/* gather the responses */
178
ret_id = (struct unixid *)response.extra_data.data;
179
for (i = 0; i < count; i++) {
180
if (ret_id[i].type == -1) {
181
ids[i]->status = ID_UNMAPPED;
185
ids[i]->status = ID_MAPPED;
186
ids[i]->xid.type = ret_id[i].type;
187
ids[i]->xid.id = ret_id[i].id;
190
SAFE_FREE(request.extra_data.data);
189
ids[0]->xid.id = response.data.uid;
190
ids[0]->status = ID_MAPPED;
191
192
SAFE_FREE(response.extra_data.data);
193
194
return NT_STATUS_OK;