summaryrefslogtreecommitdiff
path: root/source4/winbind
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2007-08-13 15:58:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:01:46 -0500
commit9b30c7c008e2facfbf05749ced532431609cdf31 (patch)
treef9d9875df3b5d35671c7e4529279dcf9944fd79b /source4/winbind
parent2091a146ef988578030139c9102bca3f52f5e7e6 (diff)
downloadsamba-9b30c7c008e2facfbf05749ced532431609cdf31.tar.gz
samba-9b30c7c008e2facfbf05749ced532431609cdf31.tar.bz2
samba-9b30c7c008e2facfbf05749ced532431609cdf31.zip
r24371: Actually add the glue to make wbinfo -S and wbinfo -Y work
(This used to be commit a8893b3078c927b0a56e9d8e8c98cbeabce3e974)
Diffstat (limited to 'source4/winbind')
-rw-r--r--source4/winbind/wb_samba3_cmd.c76
-rw-r--r--source4/winbind/wb_samba3_protocol.c12
2 files changed, 84 insertions, 4 deletions
diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c
index c5d5654ed7..a964aa9434 100644
--- a/source4/winbind/wb_samba3_cmd.c
+++ b/source4/winbind/wb_samba3_cmd.c
@@ -750,3 +750,79 @@ NTSTATUS wbsrv_samba3_endgrent(struct wbsrv_samba3_call *s3call)
s3call->response.result = WINBINDD_OK;
return NT_STATUS_OK;
}
+
+static void sid2uid_recv(struct composite_context *ctx);
+
+NTSTATUS wbsrv_samba3_sid2uid(struct wbsrv_samba3_call *s3call)
+{
+ struct composite_context *ctx;
+ struct wbsrv_service *service =
+ s3call->wbconn->listen_socket->service;
+ struct dom_sid *sid;
+
+ DEBUG(1, ("wbsrv_samba3_sid2uid called\n"));
+
+ sid = dom_sid_parse_talloc(s3call, s3call->request.data.sid);
+ NT_STATUS_HAVE_NO_MEMORY(sid);
+
+ ctx = wb_sid2uid_send(s3call, service, sid);
+ NT_STATUS_HAVE_NO_MEMORY(ctx);
+
+ ctx->async.fn = sid2uid_recv;
+ ctx->async.private_data = s3call;
+ s3call->flags |= WBSRV_CALL_FLAGS_REPLY_ASYNC;
+ return NT_STATUS_OK;
+
+}
+
+static void sid2uid_recv(struct composite_context *ctx)
+{
+ struct wbsrv_samba3_call *s3call =
+ talloc_get_type(ctx->async.private_data,
+ struct wbsrv_samba3_call);
+ NTSTATUS status;
+
+ DEBUG(1, ("sid2uid_recv called\n"));
+
+ status = wb_sid2uid_recv(ctx, &s3call->response.data.uid);
+
+ wbsrv_samba3_async_epilogue(status, s3call);
+}
+
+static void sid2gid_recv(struct composite_context *ctx);
+
+NTSTATUS wbsrv_samba3_sid2gid(struct wbsrv_samba3_call *s3call)
+{
+ struct composite_context *ctx;
+ struct wbsrv_service *service =
+ s3call->wbconn->listen_socket->service;
+ struct dom_sid *sid;
+
+ DEBUG(1, ("wbsrv_samba3_sid2gid called\n"));
+
+ sid = dom_sid_parse_talloc(s3call, s3call->request.data.sid);
+ NT_STATUS_HAVE_NO_MEMORY(sid);
+
+ ctx = wb_sid2gid_send(s3call, service, sid);
+ NT_STATUS_HAVE_NO_MEMORY(ctx);
+
+ ctx->async.fn = sid2gid_recv;
+ ctx->async.private_data = s3call;
+ s3call->flags |= WBSRV_CALL_FLAGS_REPLY_ASYNC;
+ return NT_STATUS_OK;
+
+}
+
+static void sid2gid_recv(struct composite_context *ctx)
+{
+ struct wbsrv_samba3_call *s3call =
+ talloc_get_type(ctx->async.private_data,
+ struct wbsrv_samba3_call);
+ NTSTATUS status;
+
+ DEBUG(1, ("sid2gid_recv called\n"));
+
+ status = wb_sid2gid_recv(ctx, &s3call->response.data.gid);
+
+ wbsrv_samba3_async_epilogue(status, s3call);
+}
diff --git a/source4/winbind/wb_samba3_protocol.c b/source4/winbind/wb_samba3_protocol.c
index 88d4c8a847..e65add9fd8 100644
--- a/source4/winbind/wb_samba3_protocol.c
+++ b/source4/winbind/wb_samba3_protocol.c
@@ -157,6 +157,14 @@ NTSTATUS wbsrv_samba3_handle_call(struct wbsrv_samba3_call *s3call)
case WINBINDD_ENDGRENT:
return wbsrv_samba3_endgrent(s3call);
+ case WINBINDD_SID_TO_UID:
+ case WINBINDD_DUAL_SID2UID:
+ return wbsrv_samba3_sid2uid(s3call);
+
+ case WINBINDD_SID_TO_GID:
+ case WINBINDD_DUAL_SID2GID:
+ return wbsrv_samba3_sid2gid(s3call);
+
/* Unimplemented commands */
case WINBINDD_PAM_CHAUTHTOK:
@@ -165,8 +173,6 @@ NTSTATUS wbsrv_samba3_handle_call(struct wbsrv_samba3_call *s3call)
case WINBINDD_LIST_USERS:
case WINBINDD_LIST_GROUPS:
case WINBINDD_LOOKUPRIDS:
- case WINBINDD_SID_TO_UID:
- case WINBINDD_SID_TO_GID:
case WINBINDD_SIDS_TO_XIDS:
case WINBINDD_UID_TO_SID:
case WINBINDD_GID_TO_SID:
@@ -182,8 +188,6 @@ NTSTATUS wbsrv_samba3_handle_call(struct wbsrv_samba3_call *s3call)
case WINBINDD_WINS_BYNAME:
case WINBINDD_GETGRLST:
case WINBINDD_INIT_CONNECTION:
- case WINBINDD_DUAL_SID2UID:
- case WINBINDD_DUAL_SID2GID:
case WINBINDD_DUAL_SIDS2XIDS:
case WINBINDD_DUAL_UID2SID:
case WINBINDD_DUAL_GID2SID: