* simple first. */
TALLOC_FREE(gids);
- /* For a local user the real primary group sid is the result->sids[0] */
-
- if (!pdb_set_group_sid(sampass, &result->sids[0], PDB_CHANGED)) {
- result->sam_account = NULL; /* Don't free on error exit. */
- TALLOC_FREE(result);
- return NT_STATUS_UNSUCCESSFUL;
- }
-
DEBUG(5,("make_server_info_sam: made server info for user %s -> %s\n",
pdb_get_username(sampass), result->unix_name));
gr_sid = pdb_get_group_sid(sam_acct);
if (!gr_sid) {
- goto unix_group;
+ goto unix_user;
}
sid_copy(&primary_group_sid, gr_sid);
if (!sid_to_gid(&primary_group_sid, gid)) {
DEBUG(1, ("sid_to_gid(%s) failed\n",
sid_string_static(&primary_group_sid)));
- DEBUGADD(1, ("Fall back to unix group %s\n", username));
- goto unix_group;
+ DEBUGADD(1, ("Fall back to unix user %s\n", username));
+ goto unix_user;
}
result = pdb_enum_group_memberships(tmp_ctx, sam_acct,
if (!NT_STATUS_IS_OK(result)) {
DEBUG(10, ("enum_group_memberships failed for %s\n",
username));
- DEBUGADD(1, ("Fall back to unix group %s\n", username));
- goto unix_group;
+ DEBUGADD(1, ("Fall back to unix user %s\n", username));
+ goto unix_user;
}
*found_username = talloc_strdup(mem_ctx,
uid_to_unix_users_sid(*uid, &user_sid);
- unix_group:
-
pass = getpwuid_alloc(tmp_ctx, *uid);
if (pass == NULL) {
DEBUG(1, ("getpwuid(%d) for user %s failed\n",
* simple first. */
TALLOC_FREE(gids);
- /* For a local user the real primary group sid is the result->sids[0] */
-
- if (!pdb_set_group_sid(sampass, &result->sids[0], PDB_CHANGED)) {
- result->sam_account = NULL; /* Don't free on error exit. */
- TALLOC_FREE(sampass);
- return NT_STATUS_UNSUCCESSFUL;
- }
-
*server_info = result;
return NT_STATUS_OK;