summaryrefslogtreecommitdiff
path: root/source4/winbind/wb_uid2sid.c
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2008-02-18 14:33:58 +0100
committerKai Blin <kai@samba.org>2008-02-21 11:21:59 +0100
commit895874d9663ccb95883579d145018ec8a8add9c8 (patch)
treeaa1cab86c67be63d53622796b3c6e8f2a9a60263 /source4/winbind/wb_uid2sid.c
parent2ca1aeb59be0267858c9cd46a04d37d982b79990 (diff)
downloadsamba-895874d9663ccb95883579d145018ec8a8add9c8.tar.gz
samba-895874d9663ccb95883579d145018ec8a8add9c8.tar.bz2
samba-895874d9663ccb95883579d145018ec8a8add9c8.zip
idmap: Handle uid->SID mapping
(This used to be commit 6ac6de8476ba036eb041e054bc37e4503dc2fde8)
Diffstat (limited to 'source4/winbind/wb_uid2sid.c')
-rw-r--r--source4/winbind/wb_uid2sid.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source4/winbind/wb_uid2sid.c b/source4/winbind/wb_uid2sid.c
index d7a909fda2..e81d2e4671 100644
--- a/source4/winbind/wb_uid2sid.c
+++ b/source4/winbind/wb_uid2sid.c
@@ -3,7 +3,7 @@
Command backend for wbinfo -U
- Copyright (C) Kai Blin 2007
+ Copyright (C) Kai Blin 2007-2008
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,6 +25,7 @@
#include "smbd/service_task.h"
#include "winbind/wb_helper.h"
#include "libcli/security/proto.h"
+#include "winbind/idmap.h"
struct uid2sid_state {
struct composite_context *ctx;
@@ -50,10 +51,14 @@ struct composite_context *wb_uid2sid_send(TALLOC_CTX *mem_ctx,
result->private_data = state;
state->service = service;
- /* FIXME: This is a stub so far.
- * We cheat by just using the uid as RID with the domain SID.*/
- state->sid = dom_sid_add_rid(result, service->primary_sid, uid);
- if (composite_nomem(state->sid, state->ctx)) return result;
+ state->ctx->status = idmap_uid_to_sid(service->idmap_ctx, mem_ctx, uid,
+ &state->sid);
+ if (NT_STATUS_EQUAL(state->ctx->status, NT_STATUS_RETRY)) {
+ state->ctx->status = idmap_uid_to_sid(service->idmap_ctx,
+ mem_ctx, uid,
+ &state->sid);
+ }
+ if (!composite_is_ok(state->ctx)) return result;
composite_done(state->ctx);
return result;