1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

r24371: Actually add the glue to make wbinfo -S and wbinfo -Y work

(This used to be commit a8893b3078)
This commit is contained in:
Kai Blin 2007-08-13 15:58:41 +00:00 committed by Gerald (Jerry) Carter
parent 2091a146ef
commit 9b30c7c008
2 changed files with 84 additions and 4 deletions

View File

@ -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);
}

View File

@ -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: