From 0dc1b239eb48ac81797720a8ff23c810321ad5c3 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 8 May 2009 11:25:56 +0200 Subject: s3-samr: implement _samr_RidToSid(). Guenther --- source3/rpc_server/srv_samr_nt.c | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 97ce5f9238..e0c785d841 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -6298,6 +6298,36 @@ NTSTATUS _samr_GetDisplayEnumerationIndex2(pipes_struct *p, return _samr_GetDisplayEnumerationIndex(p, &q); } +/**************************************************************** + _samr_RidToSid +****************************************************************/ + +NTSTATUS _samr_RidToSid(pipes_struct *p, + struct samr_RidToSid *r) +{ + struct samr_domain_info *dinfo; + NTSTATUS status; + struct dom_sid sid; + + dinfo = policy_handle_find(p, r->in.domain_handle, + 0, NULL, + struct samr_domain_info, &status); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (!sid_compose(&sid, &dinfo->sid, r->in.rid)) { + return NT_STATUS_NO_MEMORY; + } + + *r->out.sid = sid_dup_talloc(p->mem_ctx, &sid); + if (!*r->out.sid) { + return NT_STATUS_NO_MEMORY; + } + + return NT_STATUS_OK; +} + /**************************************************************** ****************************************************************/ @@ -6379,16 +6409,6 @@ NTSTATUS _samr_GetBootKeyInformation(pipes_struct *p, /**************************************************************** ****************************************************************/ -NTSTATUS _samr_RidToSid(pipes_struct *p, - struct samr_RidToSid *r) -{ - p->rng_fault_state = true; - return NT_STATUS_NOT_IMPLEMENTED; -} - -/**************************************************************** -****************************************************************/ - NTSTATUS _samr_SetDsrmPassword(pipes_struct *p, struct samr_SetDsrmPassword *r) { -- cgit