Changeset 745 for trunk/server/source3/modules/vfs_acl_common.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
source3/modules/vfs_acl_common.c (modified) (18 diffs)
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_acl_common.c
r599 r745 20 20 */ 21 21 22 23 24 25 26 22 27 static NTSTATUS create_acl_blob(const struct security_descriptor *psd, 23 28 DATA_BLOB *pblob, … … 35 40 DATA_BLOB *pblob); 36 41 37 #define HASH_SECURITY_INFO ( OWNER_SECURITY_INFORMATION| \38 GROUP_SECURITY_INFORMATION| \39 DACL_SECURITY_INFORMATION| \40 S ACL_SECURITY_INFORMATION)42 #define HASH_SECURITY_INFO ( | \ 43 | \ 44 | \ 45 S) 41 46 42 47 /******************************************************************* … … 78 83 size_t sd_size; 79 84 80 ndr_err = ndr_pull_struct_blob(pblob, ctx, NULL,&xacl,85 ndr_err = ndr_pull_struct_blob(pblob, ctx, &xacl, 81 86 (ndr_pull_flags_fn_t)ndr_pull_xattr_NTACL); 82 87 … … 84 89 DEBUG(5, ("parse_acl_blob: ndr_pull_xattr_NTACL failed: %s\n", 85 90 ndr_errstr(ndr_err))); 86 return ndr_map_error2ntstatus(ndr_err); ;91 return ndr_map_error2ntstatus(ndr_err); 87 92 } 88 93 89 94 switch (xacl.version) { 90 95 case 2: 91 *ppdesc = make_sec_desc(ctx, S EC_DESC_REVISION,96 *ppdesc = make_sec_desc(ctx, S_REVISION, 92 97 xacl.info.sd_hs2->sd->type | SEC_DESC_SELF_RELATIVE, 93 98 xacl.info.sd_hs2->sd->owner_sid, … … 101 106 break; 102 107 case 3: 103 *ppdesc = make_sec_desc(ctx, S EC_DESC_REVISION,108 *ppdesc = make_sec_desc(ctx, S_REVISION, 104 109 xacl.info.sd_hs3->sd->type | SEC_DESC_SELF_RELATIVE, 105 110 xacl.info.sd_hs3->sd->owner_sid, … … 145 150 146 151 ndr_err = ndr_push_struct_blob( 147 pblob, ctx, NULL,&xacl,152 pblob, ctx, &xacl, 148 153 (ndr_push_flags_fn_t)ndr_push_xattr_NTACL); 149 154 … … 151 156 DEBUG(5, ("create_acl_blob: ndr_push_xattr_NTACL failed: %s\n", 152 157 ndr_errstr(ndr_err))); 153 return ndr_map_error2ntstatus(ndr_err); ;158 return ndr_map_error2ntstatus(ndr_err); 154 159 } 155 160 … … 250 255 DATA_BLOB blob; 251 256 NTSTATUS status; 252 uint16_t hash_type ;257 uint16_t hash_type; 253 258 uint8_t hash[XATTR_SD_HASH_SIZE]; 254 259 uint8_t hash_tmp[XATTR_SD_HASH_SIZE]; … … 402 407 } 403 408 404 if (!(security_info & OWNER_SECURITY_INFORMATION)) {409 if (!(security_info & )) { 405 410 psd->owner_sid = NULL; 406 411 } 407 if (!(security_info & GROUP_SECURITY_INFORMATION)) {412 if (!(security_info & )) { 408 413 psd->group_sid = NULL; 409 414 } 410 if (!(security_info & DACL_SECURITY_INFORMATION)) {415 if (!(security_info & )) { 411 416 psd->dacl = NULL; 412 417 } 413 if (!(security_info & S ACL_SECURITY_INFORMATION)) {418 if (!(security_info & S)) { 414 419 psd->sacl = NULL; 415 420 } … … 444 449 struct dom_sid *owner_sid = NULL; 445 450 struct dom_sid *group_sid = NULL; 446 uint32_t security_info_sent = (OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION); 447 size_t size; 451 uint32_t security_info_sent = (SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL); 448 452 bool inherit_owner = lp_inherit_owner(SNUM(handle->conn)); 449 453 bool inheritable_components = sd_has_inheritable_components(parent_desc, 450 454 is_directory); 455 451 456 452 457 if (!inheritable_components && !inherit_owner) { … … 470 475 471 476 if (owner_sid == NULL) { 472 owner_sid = &handle->conn->se rver_info->ptok->user_sids[PRIMARY_USER_SID_INDEX];477 owner_sid = &handle->conn->sesids[PRIMARY_USER_SID_INDEX]; 473 478 } 474 479 if (group_sid == NULL) { 475 group_sid = &handle->conn->se rver_info->ptok->user_sids[PRIMARY_GROUP_SID_INDEX];480 group_sid = &handle->conn->sesids[PRIMARY_GROUP_SID_INDEX]; 476 481 } 477 482 … … 566 571 status = smb1_file_se_access_check(handle->conn, 567 572 parent_desc, 568 handle->conn->server_info->ptok,573 , 569 574 access_mask, 570 575 &access_granted); … … 614 619 NULL, 615 620 fname, 616 ( OWNER_SECURITY_INFORMATION|617 GROUP_SECURITY_INFORMATION|618 DACL_SECURITY_INFORMATION),621 ( | 622 | 623 ), 619 624 &pdesc); 620 625 if (NT_STATUS_IS_OK(status)) { … … 622 627 status = smb1_file_se_access_check(handle->conn, 623 628 pdesc, 624 handle->conn->server_info->ptok,629 , 625 630 fsp->access_mask, 626 631 &access_granted); … … 837 842 parent_dir, final_component )); 838 843 839 /* cd into the parent dir to pin it. */844 /* cd into the parent dir to pin it. */ 840 845 ret = SMB_VFS_CHDIR(conn, parent_dir); 841 846 if (ret == -1) { … … 856 861 /* Ensure we have this file open with DELETE access. */ 857 862 id = vfs_file_id_from_sbuf(conn, &local_fname.st); 858 for (fsp = file_find_di_first(id); fsp; file_find_di_next(fsp)) { 863 for (fsp = file_find_di_first(conn->sconn, id); fsp; 864 file_find_di_next(fsp)) { 859 865 if (fsp->access_mask & DELETE_ACCESS && 860 866 fsp->delete_on_close) { … … 927 933 uint32_t oplock_request, 928 934 uint64_t allocation_size, 935 929 936 struct security_descriptor *sd, 930 937 struct ea_list *ea_list, … … 949 956 oplock_request, 950 957 allocation_size, 958 951 959 sd, 952 960 ea_list,
Note:
See TracChangeset
for help on using the changeset viewer.
