Index: source3/auth/auth_util.c =================================================================== --- source3/auth/auth_util.c.orig +++ source3/auth/auth_util.c @@ -563,6 +563,7 @@ NTSTATUS make_server_info_pw(struct auth char *qualified_name = NULL; TALLOC_CTX *mem_ctx = NULL; struct dom_sid u_sid; + struct dom_sid g_sid; enum lsa_SidType type; struct auth_serversupplied_info *result; @@ -584,9 +585,14 @@ NTSTATUS make_server_info_pw(struct auth return NT_STATUS_NO_MEMORY; } - qualified_name = talloc_asprintf(mem_ctx, "%s\\%s", - unix_users_domain_name(), - unix_username ); + if (strchr_m(unix_username, *lp_winbind_separator()) == NULL) { + qualified_name = talloc_asprintf(mem_ctx, "%s%s%s", + unix_users_domain_name(), + lp_winbind_separator(), + unix_username); + } else { + qualified_name = talloc_strdup(mem_ctx, unix_username); + } if (!qualified_name) { TALLOC_FREE(mem_ctx); return NT_STATUS_NO_MEMORY; @@ -622,6 +628,12 @@ NTSTATUS make_server_info_pw(struct auth /* set the user sid to be the calculated u_sid */ pdb_set_user_sid(sampass, &u_sid, PDB_SET); + /* samu_to_SamInfo3() calls get_primary_group_sid() if we fail to map */ + gid_to_sid(&g_sid, pwd->pw_gid); + if (!is_null_sid(&g_sid)) { + pdb_set_group_sid(sampass, &g_sid, PDB_SET); + } + result = make_server_info(NULL); if (result == NULL) { TALLOC_FREE(sampass); Index: source3/passdb/lookup_sid.c =================================================================== --- source3/passdb/lookup_sid.c.orig +++ source3/passdb/lookup_sid.c @@ -55,8 +55,7 @@ bool lookup_name(TALLOC_CTX *mem_ctx, return false; } - p = strchr_m(full_name, '\\'); - + p = strchr_m(full_name, *lp_winbind_separator()); if (p != NULL) { domain = talloc_strndup(tmp_ctx, full_name, PTR_DIFF(p, full_name));