From a26ac9ce2708e8d959500da418daefcb3ca94bd6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Fri, 8 May 2009 11:25:56 +0200 Subject: [PATCH] s3-samr: implement _samr_RidToSid(). Guenther (cherry picked from commit 0dc1b239eb48ac81797720a8ff23c810321ad5c3) --- 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 c22cd1c8af7..0c8607387aa 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -6566,6 +6566,36 @@ NTSTATUS _samr_GetDisplayEnumerationIndex2(pipes_struct *p, } /**************************************************************** + _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; +} + +/**************************************************************** ****************************************************************/ NTSTATUS _samr_Shutdown(pipes_struct *p, @@ -6646,16 +6676,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) { -- 2.11.4.GIT