mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
r24373: Implement backend for wbinfo -G (gid2sid)
(This used to be commit e928e56219
)
This commit is contained in:
parent
e1c832521f
commit
677ccf3047
@ -16,6 +16,7 @@ OBJ_FILES = \
|
||||
wb_dom_info_trusted.o \
|
||||
wb_sid2domain.o \
|
||||
wb_name2domain.o \
|
||||
wb_gid2sid.o \
|
||||
wb_sid2uid.o \
|
||||
wb_sid2gid.o \
|
||||
wb_uid2sid.o \
|
||||
|
@ -875,3 +875,48 @@ static void uid2sid_recv(struct composite_context *ctx)
|
||||
wbsrv_samba3_async_epilogue(status, s3call);
|
||||
}
|
||||
|
||||
static void gid2sid_recv(struct composite_context *ctx);
|
||||
|
||||
NTSTATUS wbsrv_samba3_gid2sid(struct wbsrv_samba3_call *s3call)
|
||||
{
|
||||
struct composite_context *ctx;
|
||||
struct wbsrv_service *service =
|
||||
s3call->wbconn->listen_socket->service;
|
||||
|
||||
DEBUG(5, ("wbsrv_samba3_gid2sid called\n"));
|
||||
|
||||
ctx = wb_gid2sid_send(s3call, service, s3call->request.data.gid);
|
||||
NT_STATUS_HAVE_NO_MEMORY(ctx);
|
||||
|
||||
ctx->async.fn = gid2sid_recv;
|
||||
ctx->async.private_data = s3call;
|
||||
s3call->flags |= WBSRV_CALL_FLAGS_REPLY_ASYNC;
|
||||
return NT_STATUS_OK;
|
||||
|
||||
}
|
||||
|
||||
static void gid2sid_recv(struct composite_context *ctx)
|
||||
{
|
||||
struct wbsrv_samba3_call *s3call =
|
||||
talloc_get_type(ctx->async.private_data,
|
||||
struct wbsrv_samba3_call);
|
||||
NTSTATUS status;
|
||||
struct dom_sid *sid;
|
||||
char *sid_str;
|
||||
|
||||
DEBUG(5, ("gid2sid_recv called\n"));
|
||||
|
||||
status = wb_gid2sid_recv(ctx, s3call, &sid);
|
||||
if(NT_STATUS_IS_OK(status)) {
|
||||
sid_str = dom_sid_string(s3call, sid);
|
||||
|
||||
if (sid_str == NULL)
|
||||
wbsrv_samba3_async_epilogue(NT_STATUS_NO_MEMORY,s3call);
|
||||
|
||||
WBSRV_SAMBA3_SET_STRING(s3call->response.data.sid.sid, sid_str);
|
||||
s3call->response.data.sid.type = SID_NAME_DOMAIN;
|
||||
}
|
||||
|
||||
wbsrv_samba3_async_epilogue(status, s3call);
|
||||
}
|
||||
|
||||
|
@ -169,6 +169,10 @@ NTSTATUS wbsrv_samba3_handle_call(struct wbsrv_samba3_call *s3call)
|
||||
case WINBINDD_DUAL_UID2SID:
|
||||
return wbsrv_samba3_uid2sid(s3call);
|
||||
|
||||
case WINBINDD_GID_TO_SID:
|
||||
case WINBINDD_DUAL_GID2SID:
|
||||
return wbsrv_samba3_gid2sid(s3call);
|
||||
|
||||
/* Unimplemented commands */
|
||||
|
||||
case WINBINDD_PAM_CHAUTHTOK:
|
||||
@ -178,7 +182,6 @@ NTSTATUS wbsrv_samba3_handle_call(struct wbsrv_samba3_call *s3call)
|
||||
case WINBINDD_LIST_GROUPS:
|
||||
case WINBINDD_LOOKUPRIDS:
|
||||
case WINBINDD_SIDS_TO_XIDS:
|
||||
case WINBINDD_GID_TO_SID:
|
||||
case WINBINDD_ALLOCATE_UID:
|
||||
case WINBINDD_ALLOCATE_GID:
|
||||
case WINBINDD_SET_MAPPING:
|
||||
@ -192,7 +195,6 @@ NTSTATUS wbsrv_samba3_handle_call(struct wbsrv_samba3_call *s3call)
|
||||
case WINBINDD_GETGRLST:
|
||||
case WINBINDD_INIT_CONNECTION:
|
||||
case WINBINDD_DUAL_SIDS2XIDS:
|
||||
case WINBINDD_DUAL_GID2SID:
|
||||
case WINBINDD_DUAL_SET_MAPPING:
|
||||
case WINBINDD_DUAL_SET_HWM:
|
||||
case WINBINDD_DUAL_DUMP_MAPS:
|
||||
|
Loading…
Reference in New Issue
Block a user