Changeset 596 for trunk/server/source3/smbd/nttrans.c
- Timestamp:
- Jul 2, 2011, 3:35:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/smbd/nttrans.c
r583 r596 834 834 NTSTATUS status; 835 835 836 if (sd_len == 0 || !lp_nt_acl_support(SNUM(fsp->conn))) { 836 if (sd_len == 0) { 837 return NT_STATUS_INVALID_PARAMETER; 838 } 839 840 if (!CAN_WRITE(fsp->conn)) { 841 return NT_STATUS_ACCESS_DENIED; 842 } 843 844 if (!lp_nt_acl_support(SNUM(fsp->conn))) { 837 845 return NT_STATUS_OK; 838 846 } … … 851 859 } 852 860 853 /* Convert all the generic bits. */ 854 security_acl_map_generic(psd->dacl, &file_generic_mapping); 855 security_acl_map_generic(psd->sacl, &file_generic_mapping); 861 /* Ensure we have at least one thing set. */ 862 if ((security_info_sent & (SECINFO_OWNER|SECINFO_GROUP|SECINFO_DACL|SECINFO_SACL)) == 0) { 863 return NT_STATUS_INVALID_PARAMETER; 864 } 865 866 /* Ensure we have the rights to do this. */ 867 if (security_info_sent & SECINFO_OWNER) { 868 if (!(fsp->access_mask & SEC_STD_WRITE_OWNER)) { 869 return NT_STATUS_ACCESS_DENIED; 870 } 871 } 872 873 if (security_info_sent & SECINFO_GROUP) { 874 if (!(fsp->access_mask & SEC_STD_WRITE_OWNER)) { 875 return NT_STATUS_ACCESS_DENIED; 876 } 877 } 878 879 if (security_info_sent & SECINFO_DACL) { 880 if (!(fsp->access_mask & SEC_STD_WRITE_DAC)) { 881 return NT_STATUS_ACCESS_DENIED; 882 } 883 /* Convert all the generic bits. */ 884 if (psd->dacl) { 885 security_acl_map_generic(psd->dacl, &file_generic_mapping); 886 } 887 } 888 889 if (security_info_sent & SECINFO_SACL) { 890 if (!(fsp->access_mask & SEC_FLAG_SYSTEM_SECURITY)) { 891 return NT_STATUS_ACCESS_DENIED; 892 } 893 /* Convert all the generic bits. */ 894 if (psd->sacl) { 895 security_acl_map_generic(psd->sacl, &file_generic_mapping); 896 } 897 } 856 898 857 899 if (DEBUGLEVEL >= 10) { … … 1796 1838 */ 1797 1839 1840 if ((security_info_wanted & SECINFO_SACL) && 1841 !(fsp->access_mask & SEC_FLAG_SYSTEM_SECURITY)) { 1842 reply_nterror(req, NT_STATUS_ACCESS_DENIED); 1843 return; 1844 } 1845 1846 if ((security_info_wanted & (SECINFO_DACL|SECINFO_OWNER|SECINFO_GROUP)) && 1847 !(fsp->access_mask & SEC_STD_READ_CONTROL)) { 1848 reply_nterror(req, NT_STATUS_ACCESS_DENIED); 1849 return; 1850 } 1851 1798 1852 if (!lp_nt_acl_support(SNUM(conn))) { 1799 1853 status = get_null_nt_acl(talloc_tos(), &psd); … … 1805 1859 reply_nterror(req, status); 1806 1860 return; 1861 } 1862 1863 if (!(security_info_wanted & SECINFO_OWNER)) { 1864 psd->owner_sid = NULL; 1865 } 1866 if (!(security_info_wanted & SECINFO_GROUP)) { 1867 psd->group_sid = NULL; 1868 } 1869 if (!(security_info_wanted & SECINFO_DACL)) { 1870 psd->dacl = NULL; 1871 } 1872 if (!(security_info_wanted & SECINFO_SACL)) { 1873 psd->sacl = NULL; 1807 1874 } 1808 1875
Note:
See TracChangeset
for help on using the changeset viewer.