Changeset 221 for branches/samba-3.3.x/source/auth
- Timestamp:
- May 24, 2009, 7:17:10 AM (17 years ago)
- File:
-
- 1 edited
-
branches/samba-3.3.x/source/auth/auth_util.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/auth/auth_util.c
r206 r221 556 556 gid_t *gids; 557 557 auth_serversupplied_info *result; 558 int i;559 size_t num_gids;560 DOM_SID unix_group_sid;561 558 const char *username = pdb_get_username(sampass); 562 559 NTSTATUS status; … … 574 571 575 572 result->sam_account = sampass; 576 /* Ensure thaat the sampass will be freed with the result */577 talloc_steal(result, sampass);578 573 result->unix_name = pwd->pw_name; 579 574 /* Ensure that we keep pwd->pw_name, because we will free pwd below */ … … 632 627 } 633 628 634 /* Add the "Unix Group" SID for each gid to catch mapped groups635 and their Unix equivalent. This is to solve the backwards636 compatibility problem of 'valid users = +ntadmin' where637 ntadmin has been paired with "Domain Admins" in the group638 mapping table. Otherwise smb.conf would need to be changed639 to 'valid user = "Domain Admins"'. --jerry */640 641 num_gids = result->num_sids;642 for ( i=0; i<num_gids; i++ ) {643 if ( !gid_to_unix_groups_sid( gids[i], &unix_group_sid ) ) {644 DEBUG(1,("make_server_info_sam: Failed to create SID "645 "for gid %d!\n", gids[i]));646 continue;647 }648 status = add_sid_to_array_unique(result, &unix_group_sid,649 &result->sids,650 &result->num_sids);651 if (!NT_STATUS_IS_OK(status)) {652 result->sam_account = NULL; /* Don't free on error exit. */653 TALLOC_FREE(result);654 return status;655 }656 }657 658 629 /* For now we throw away the gids and convert via sid_to_gid 659 630 * later. This needs fixing, but I'd like to get the code straight and … … 666 637 667 638 *server_info = result; 639 640 668 641 669 642 return NT_STATUS_OK; … … 720 693 NTSTATUS status; 721 694 size_t i; 695 722 696 723 697 /* … … 772 746 } 773 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 774 780 debug_nt_user_token(DBGC_AUTH, 10, server_info->ptok); 781 782 783 784 785 775 786 776 787 status = log_nt_token(server_info->ptok);
Note:
See TracChangeset
for help on using the changeset viewer.
