Changeset 745 for trunk/server/source3/modules/vfs_afsacl.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/modules/vfs_afsacl.c
r414 r745 19 19 20 20 #include "includes.h" 21 #include "system/filesys.h" 22 #include "smbd/smbd.h" 23 #include "../librpc/gen_ndr/lsa.h" 24 #include "../libcli/security/security.h" 25 #include "../libcli/security/dom_sid.h" 26 #include "passdb.h" 21 27 22 28 #undef DBGC_CLASS … … 31 37 #define MAXSIZE 2048 32 38 33 extern const DOM_SIDglobal_sid_World;34 extern const DOM_SIDglobal_sid_Builtin_Administrators;35 extern const DOM_SIDglobal_sid_Builtin_Backup_Operators;36 extern const DOM_SIDglobal_sid_Authenticated_Users;37 extern const DOM_SIDglobal_sid_NULL;39 extern const struct dom_sid global_sid_World; 40 extern const struct dom_sid global_sid_Builtin_Administrators; 41 extern const struct dom_sid global_sid_Builtin_Backup_Operators; 42 extern const struct dom_sid global_sid_Authenticated_Users; 43 extern const struct dom_sid global_sid_NULL; 38 44 39 45 static char space_replacement = '%'; … … 47 53 bool positive; 48 54 char *name; 49 DOM_SIDsid;55 struct dom_sid sid; 50 56 enum lsa_SidType type; 51 57 uint32 rights; … … 109 115 const char *name, uint32 rights) 110 116 { 111 DOM_SIDsid;117 struct dom_sid sid; 112 118 enum lsa_SidType type; 113 119 struct afs_ace *result; … … 418 424 { 419 425 return ( (x->positive == y->positive) && 420 ( sid_compare(&x->sid, &y->sid) == 0) );426 (dom_sid_compare(&x->sid, &y->sid) == 0) ); 421 427 } 422 428 … … 515 521 /* FULL inherit only -- counterpart to previous one */ 516 522 { 0, SEC_ACE_FLAG_OBJECT_INHERIT|SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_INHERIT_ONLY, 517 PERMS_FULL | GENERIC_RIGHT_WRITE_ACCESS, 127 /* rlidwka */ },523 PERMS_FULL | SEC_GENERIC_WRITE, 127 /* rlidwka */ }, 518 524 519 525 /* CHANGE without inheritance -- in all cases here we also get … … 523 529 /* CHANGE inherit only -- counterpart to previous one */ 524 530 { 0, SEC_ACE_FLAG_OBJECT_INHERIT|SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_INHERIT_ONLY, 525 PERMS_CHANGE | GENERIC_RIGHT_WRITE_ACCESS, 63 /* rlidwk */ },531 PERMS_CHANGE | SEC_GENERIC_WRITE, 63 /* rlidwk */ }, 526 532 527 533 /* End marker, hopefully there's no afs right 9999 :-) */ … … 529 535 }; 530 536 531 static uint32 nt_to_afs_dir_rights(const char *filename, const SEC_ACE*ace)537 static uint32 nt_to_afs_dir_rights(const char *filename, const struct security_ace *ace) 532 538 { 533 539 uint32 result = 0; … … 570 576 } 571 577 572 static uint32 nt_to_afs_file_rights(const char *filename, const SEC_ACE*ace)578 static uint32 nt_to_afs_file_rights(const char *filename, const struct security_ace *ace) 573 579 { 574 580 uint32 result = 0; … … 591 597 struct security_descriptor **ppdesc) 592 598 { 593 SEC_ACE*nt_ace_list;594 DOM_SIDowner_sid, group_sid;595 SEC_ACL*psa = NULL;599 struct security_ace *nt_ace_list; 600 struct dom_sid owner_sid, group_sid; 601 struct security_acl *psa = NULL; 596 602 int good_aces; 597 603 size_t sd_size; … … 604 610 605 611 if (afs_acl->num_aces) { 606 nt_ace_list = TALLOC_ARRAY(mem_ctx, SEC_ACE, afs_acl->num_aces);612 nt_ace_list = TALLOC_ARRAY(mem_ctx, struct security_ace, afs_acl->num_aces); 607 613 608 614 if (nt_ace_list == NULL) … … 643 649 return 0; 644 650 645 *ppdesc = make_sec_desc(mem_ctx, S EC_DESC_REVISION,651 *ppdesc = make_sec_desc(mem_ctx, SD_REVISION, 646 652 SEC_DESC_SELF_RELATIVE, 647 (security_info & OWNER_SECURITY_INFORMATION)653 (security_info & SECINFO_OWNER) 648 654 ? &owner_sid : NULL, 649 (security_info & GROUP_SECURITY_INFORMATION)655 (security_info & SECINFO_GROUP) 650 656 ? &group_sid : NULL, 651 657 NULL, psa, &sd_size); … … 683 689 SMB_STRUCT_STAT sbuf; 684 690 685 if (fsp-> is_directory || fsp->fh->fd == -1) {691 if (fsp->fh->fd == -1) { 686 692 /* Get the stat struct for the owner info. */ 687 693 return afs_to_nt_acl(afs_acl, fsp->conn, fsp->fsp_name, … … 696 702 } 697 703 698 static bool mappable_sid(const DOM_SID*sid)699 { 700 DOM_SIDdomain_sid;704 static bool mappable_sid(const struct dom_sid *sid) 705 { 706 struct dom_sid domain_sid; 701 707 702 if ( sid_compare(sid, &global_sid_Builtin_Administrators) == 0)708 if (dom_sid_compare(sid, &global_sid_Builtin_Administrators) == 0) 703 709 return True; 704 710 705 if ( sid_compare(sid, &global_sid_World) == 0)711 if (dom_sid_compare(sid, &global_sid_World) == 0) 706 712 return True; 707 713 708 if ( sid_compare(sid, &global_sid_Authenticated_Users) == 0)714 if (dom_sid_compare(sid, &global_sid_Authenticated_Users) == 0) 709 715 return True; 710 716 711 if ( sid_compare(sid, &global_sid_Builtin_Backup_Operators) == 0)717 if (dom_sid_compare(sid, &global_sid_Builtin_Backup_Operators) == 0) 712 718 return True; 713 719 … … 724 730 const struct security_descriptor *psd, 725 731 uint32 (*nt_to_afs_rights)(const char *filename, 726 const SEC_ACE*ace),732 const struct security_ace *ace), 727 733 struct afs_acl *afs_acl) 728 734 { 729 const SEC_ACL*dacl;735 const struct security_acl *dacl; 730 736 int i; 731 737 732 738 /* Currently we *only* look at the dacl */ 733 739 734 if (((security_info_sent & DACL_SECURITY_INFORMATION) == 0) ||740 if (((security_info_sent & SECINFO_DACL) == 0) || 735 741 (psd->dacl == NULL)) 736 742 return True; … … 742 748 743 749 for (i = 0; i < dacl->num_aces; i++) { 744 const SEC_ACE*ace = &(dacl->aces[i]);750 const struct security_ace *ace = &(dacl->aces[i]); 745 751 const char *dom_name, *name; 746 752 enum lsa_SidType name_type; … … 758 764 } 759 765 760 if ( sid_compare(&ace->trustee,766 if (dom_sid_compare(&ace->trustee, 761 767 &global_sid_Builtin_Administrators) == 0) { 762 768 763 769 name = "system:administrators"; 764 770 765 } else if ( sid_compare(&ace->trustee,771 } else if (dom_sid_compare(&ace->trustee, 766 772 &global_sid_World) == 0) { 767 773 768 774 name = "system:anyuser"; 769 775 770 } else if ( sid_compare(&ace->trustee,776 } else if (dom_sid_compare(&ace->trustee, 771 777 &global_sid_Authenticated_Users) == 0) { 772 778 773 779 name = "system:authuser"; 774 780 775 } else if ( sid_compare(&ace->trustee,781 } else if (dom_sid_compare(&ace->trustee, 776 782 &global_sid_Builtin_Backup_Operators) 777 783 == 0) { … … 1057 1063 files_struct *fsp, 1058 1064 uint32 security_info_sent, 1059 const SEC_DESC*psd)1065 const struct security_descriptor *psd) 1060 1066 { 1061 1067 return afs_set_nt_acl(handle, fsp, security_info_sent, psd);
Note:
See TracChangeset
for help on using the changeset viewer.