#include "includes.h"
#include "libcli/composite/composite.h"
#include "winbind/wb_server.h"
-#include "winbind/wb_async_helpers.h"
-#include "winbind/wb_helper.h"
#include "smbd/service_task.h"
-#include "nsswitch/winbindd_nss.h"
-#include "libnet/libnet_proto.h"
#include "param/param.h"
-#include "libcli/security/proto.h"
-#include "auth/credentials/credentials.h"
struct cmd_getpwuid_state {
struct composite_context *ctx;
struct wbsrv_service *service;
uid_t uid;
+ struct dom_sid *sid;
char *workgroup;
struct wbsrv_domain *domain;
struct composite_context *ctx, *result;
struct cmd_getpwuid_state *state;
- DEBUG(5, ("wb_cmd_getpwnam_send called\n"));
+ DEBUG(5, ("wb_cmd_getpwuid_send called\n"));
result = composite_create(mem_ctx, service->task->event_ctx);
if (!result) return NULL;
struct cmd_getpwuid_state *state =
talloc_get_type(ctx->async.private_data,
struct cmd_getpwuid_state);
- struct dom_sid *sid;
DEBUG(5, ("cmd_getpwuid_recv_sid called %p\n", ctx->private_data));
- state->ctx->status = wb_uid2sid_recv(ctx, state, &sid);
+ state->ctx->status = wb_uid2sid_recv(ctx, state, &state->sid);
if (!composite_is_ok(state->ctx)) return;
- ctx = wb_sid2domain_send(state, state->service, sid);
+ ctx = wb_sid2domain_send(state, state->service, state->sid);
composite_continue(state->ctx, ctx, cmd_getpwuid_recv_domain, state);
}
user_info = talloc(state, struct libnet_UserInfo);
if (composite_nomem(user_info, state->ctx)) return;
- user_info->in.user_name = state->domain->libnet_ctx->cred->username;
+ user_info->in.level = USER_INFO_BY_SID;
+ user_info->in.data.user_sid = state->sid;
user_info->in.domain_name = state->domain->libnet_ctx->samr.name;
/* We need the workgroup later, so copy it */
WBSRV_SAMBA3_SET_STRING(pw->pw_name, user_info->out.account_name);
WBSRV_SAMBA3_SET_STRING(pw->pw_passwd, "*");
WBSRV_SAMBA3_SET_STRING(pw->pw_gecos, user_info->out.full_name);
- WBSRV_SAMBA3_SET_STRING(pw->pw_dir, lp_template_homedir());
+ WBSRV_SAMBA3_SET_STRING(pw->pw_dir,
+ lpcfg_template_homedir(state->service->task->lp_ctx));
all_string_sub(pw->pw_dir, "%WORKGROUP%", state->workgroup,
sizeof(fstring) - 1);
all_string_sub(pw->pw_dir, "%ACCOUNTNAME%", user_info->out.account_name,
sizeof(fstring) - 1);
- WBSRV_SAMBA3_SET_STRING(pw->pw_shell, lp_template_shell());
+ WBSRV_SAMBA3_SET_STRING(pw->pw_shell,
+ lpcfg_template_shell(state->service->task->lp_ctx));
pw->pw_uid = state->uid;
{
NTSTATUS status = composite_wait(ctx);
- DEBUG(5, ("wb_cmd_getpwnam_recv called\n"));
+ DEBUG(5, ("wb_cmd_getpwuid_recv called\n"));
if (NT_STATUS_IS_OK(status)) {
struct cmd_getpwuid_state *state =