s3-samr: implement _samr_RidToSid().
authorGünther Deschner <gd@samba.org>
Fri, 8 May 2009 09:25:56 +0000 (11:25 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 11 May 2009 22:27:24 +0000 (00:27 +0200)
Guenther

source3/rpc_server/srv_samr_nt.c

index 97ce5f9..e0c785d 100644 (file)
@@ -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)
 {