diff options
Diffstat (limited to 'source3/nsswitch/winbindd_sid.c')
-rw-r--r-- | source3/nsswitch/winbindd_sid.c | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/source3/nsswitch/winbindd_sid.c b/source3/nsswitch/winbindd_sid.c index d489e267cb2..4a9e17e4c70 100644 --- a/source3/nsswitch/winbindd_sid.c +++ b/source3/nsswitch/winbindd_sid.c @@ -124,6 +124,34 @@ static void lookupname_recv(void *private_data, BOOL success, return; } +void winbindd_lookuprids(struct winbindd_cli_state *state) +{ + struct winbindd_domain *domain; + DOM_SID domain_sid; + + /* Ensure null termination */ + state->request.data.sid[sizeof(state->request.data.sid)-1]='\0'; + + DEBUG(10, ("lookup_rids: %s\n", state->request.data.sid)); + + if (!string_to_sid(&domain_sid, state->request.data.sid)) { + DEBUG(5, ("Could not convert %s to SID\n", + state->request.data.sid)); + request_error(state); + return; + } + + domain = find_lookup_domain_from_sid(&domain_sid); + if (domain == NULL) { + DEBUG(10, ("Could not find domain for name %s\n", + state->request.domain_name)); + request_error(state); + return; + } + + sendto_domain(state, domain); +} + static struct winbindd_child static_idmap_child; void init_idmap_child(void) @@ -167,8 +195,8 @@ void winbindd_sid_to_uid(struct winbindd_cli_state *state) /* Query only the local tdb, everything else might possibly block */ - result = idmap_sid_to_uid(&sid, &(state->response.data.uid), - ID_QUERY_ONLY|ID_CACHE_ONLY); + result = idmap_sid_to_uid(&sid, &state->response.data.uid, + IDMAP_FLAG_QUERY_ONLY|IDMAP_FLAG_CACHE_ONLY); if (NT_STATUS_IS_OK(result)) { request_ok(state); @@ -225,8 +253,8 @@ void winbindd_sid_to_gid(struct winbindd_cli_state *state) /* Query only the local tdb, everything else might possibly block */ - result = idmap_sid_to_gid(&sid, &(state->response.data.gid), - ID_QUERY_ONLY|ID_CACHE_ONLY); + result = idmap_sid_to_gid(&sid, &state->response.data.gid, + IDMAP_FLAG_QUERY_ONLY|IDMAP_FLAG_CACHE_ONLY); if (NT_STATUS_IS_OK(result)) { request_ok(state); @@ -285,7 +313,7 @@ void winbindd_uid_to_sid(struct winbindd_cli_state *state) } status = idmap_uid_to_sid(&sid, state->request.data.uid, - ID_QUERY_ONLY | ID_CACHE_ONLY); + IDMAP_FLAG_QUERY_ONLY|IDMAP_FLAG_CACHE_ONLY); if (NT_STATUS_IS_OK(status)) { sid_to_string(state->response.data.sid.sid, &sid); @@ -412,7 +440,7 @@ void winbindd_gid_to_sid(struct winbindd_cli_state *state) } status = idmap_gid_to_sid(&sid, state->request.data.gid, - ID_QUERY_ONLY | ID_CACHE_ONLY); + IDMAP_FLAG_QUERY_ONLY|IDMAP_FLAG_CACHE_ONLY); if (NT_STATUS_IS_OK(status)) { sid_to_string(state->response.data.sid.sid, &sid); |