1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-22 05:57:43 +03:00

s4 winbind: Don't drop workgroup name for getpw*

Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Sat Sep 24 22:49:50 CEST 2011 on sn-devel-104
This commit is contained in:
Kai Blin 2011-09-24 10:45:59 -07:00
parent ca8c25abeb
commit 649bfc474d
2 changed files with 16 additions and 2 deletions

View File

@ -108,6 +108,7 @@ static void cmd_getpwnam_recv_user_info(struct composite_context *ctx)
ctx->async.private_data, struct cmd_getpwnam_state);
struct libnet_UserInfo *user_info;
struct winbindd_pw *pw;
char *username_with_domain;
DEBUG(5, ("cmd_getpwnam_recv_user_info called\n"));
@ -120,7 +121,13 @@ static void cmd_getpwnam_recv_user_info(struct composite_context *ctx)
state->ctx->status = libnet_UserInfo_recv(ctx, state, user_info);
if(!composite_is_ok(state->ctx)) return;
WBSRV_SAMBA3_SET_STRING(pw->pw_name, user_info->out.account_name);
username_with_domain = talloc_asprintf(pw, "%s%s%s",
state->workgroup_name,
lpcfg_winbind_separator(state->service->task->lp_ctx),
user_info->out.account_name);
if(composite_nomem(username_with_domain, state->ctx)) return;
WBSRV_SAMBA3_SET_STRING(pw->pw_name, username_with_domain);
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,

View File

@ -129,6 +129,7 @@ static void cmd_getpwuid_recv_user_info(struct composite_context *ctx)
struct cmd_getpwuid_state);
struct libnet_UserInfo *user_info;
struct winbindd_pw *pw;
char *username_with_domain;
DEBUG(5, ("cmd_getpwuid_recv_user_info called\n"));
@ -141,7 +142,13 @@ static void cmd_getpwuid_recv_user_info(struct composite_context *ctx)
state->ctx->status = libnet_UserInfo_recv(ctx, state, user_info);
if (!composite_is_ok(state->ctx)) return;
WBSRV_SAMBA3_SET_STRING(pw->pw_name, user_info->out.account_name);
username_with_domain = talloc_asprintf(pw, "%s%s%s",
state->workgroup,
lpcfg_winbind_separator(state->service->task->lp_ctx),
user_info->out.account_name);
if(composite_nomem(username_with_domain, state->ctx)) return;
WBSRV_SAMBA3_SET_STRING(pw->pw_name, username_with_domain);
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,