summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_group.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-08-27 14:55:41 +0200
committerVolker Lendecke <vl@samba.org>2009-08-27 15:04:09 +0200
commit1d8d3fd7c3c2e6c46a3e01983dc26a5a650f6f84 (patch)
tree59ec4c3669bbfa1c7a9d113fdc1292ce74b62700 /source3/winbindd/winbindd_group.c
parent5a1240deac89b1821c987c3daed5a6ad597471f5 (diff)
downloadsamba-1d8d3fd7c3c2e6c46a3e01983dc26a5a650f6f84.tar.gz
samba-1d8d3fd7c3c2e6c46a3e01983dc26a5a650f6f84.tar.bz2
samba-1d8d3fd7c3c2e6c46a3e01983dc26a5a650f6f84.zip
s3:winbind: Convert WINBINDD_GETUSERSIDS to the new API
Diffstat (limited to 'source3/winbindd/winbindd_group.c')
-rw-r--r--source3/winbindd/winbindd_group.c84
1 files changed, 0 insertions, 84 deletions
diff --git a/source3/winbindd/winbindd_group.c b/source3/winbindd/winbindd_group.c
index 6520c43f2f..16defc793d 100644
--- a/source3/winbindd/winbindd_group.c
+++ b/source3/winbindd/winbindd_group.c
@@ -1255,90 +1255,6 @@ struct getgroups_state {
size_t num_token_gids;
};
-
-/* Get user supplementary sids. This is equivalent to the
- winbindd_getgroups() function but it involves a SID->SIDs mapping
- rather than a NAME->SID->SIDS->GIDS mapping, which means we avoid
- idmap. This call is designed to be used with applications that need
- to do ACL evaluation themselves. Note that the cached info3 data is
- not used
-
- this function assumes that the SID that comes in is a user SID. If
- you pass in another type of SID then you may get unpredictable
- results.
-*/
-
-static void getusersids_recv(void *private_data, bool success, DOM_SID *sids,
- size_t num_sids);
-
-void winbindd_getusersids(struct winbindd_cli_state *state)
-{
- DOM_SID *user_sid;
-
- /* Ensure null termination */
- state->request->data.sid[sizeof(state->request->data.sid)-1]='\0';
-
- user_sid = TALLOC_P(state->mem_ctx, DOM_SID);
- if (user_sid == NULL) {
- DEBUG(1, ("talloc failed\n"));
- request_error(state);
- return;
- }
-
- if (!string_to_sid(user_sid, state->request->data.sid)) {
- DEBUG(1, ("Could not get convert sid %s from string\n",
- state->request->data.sid));
- request_error(state);
- return;
- }
-
- winbindd_gettoken_async(state->mem_ctx, user_sid, getusersids_recv,
- state);
-}
-
-static void getusersids_recv(void *private_data, bool success, DOM_SID *sids,
- size_t num_sids)
-{
- struct winbindd_cli_state *state =
- (struct winbindd_cli_state *)private_data;
- char *ret = NULL;
- unsigned ofs, ret_size = 0;
- size_t i;
-
- if (!success) {
- request_error(state);
- return;
- }
-
- /* work out the response size */
- for (i = 0; i < num_sids; i++) {
- fstring s;
- sid_to_fstring(s, &sids[i]);
- ret_size += strlen(s) + 1;
- }
-
- /* build the reply */
- ret = talloc_array(state->mem_ctx, char, ret_size);
- if (!ret) {
- DEBUG(0, ("malloc failed\n"));
- request_error(state);
- return;
- }
- ofs = 0;
- for (i = 0; i < num_sids; i++) {
- fstring s;
- sid_to_fstring(s, &sids[i]);
- safe_strcpy(ret + ofs, s, ret_size - ofs - 1);
- ofs += strlen(ret+ofs) + 1;
- }
-
- /* Send data back to client */
- state->response->data.num_entries = num_sids;
- state->response->extra_data.data = ret;
- state->response->length += ret_size;
- request_ok(state);
-}
-
enum winbindd_result winbindd_dual_getuserdomgroups(struct winbindd_domain *domain,
struct winbindd_cli_state *state)
{