Changeset 594 for vendor/current/source3/modules
- Timestamp:
- Jul 1, 2011, 4:02:23 PM (14 years ago)
- Location:
- vendor/current/source3/modules
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/modules/onefs_open.c
r414 r594 2095 2095 /* Get the file name if root_dir_fid was specified. */ 2096 2096 if (root_dir_fid != 0) { 2097 struct smb_filename *smb_fname_out = NULL; 2097 2098 status = get_relative_fid_filename(conn, req, root_dir_fid, 2098 smb_fname );2099 smb_fname, &smb_fname_out); 2099 2100 if (!NT_STATUS_IS_OK(status)) { 2100 2101 goto fail; 2101 2102 } 2103 smb_fname = smb_fname_out; 2102 2104 } 2103 2105 -
vendor/current/source3/modules/vfs_acl_common.c
r587 r594 255 255 struct security_descriptor *psd = NULL; 256 256 struct security_descriptor *pdesc_next = NULL; 257 bool ignore_file_system_acl = lp_parm_bool(SNUM(handle->conn), 258 ACL_MODULE_NAME, 259 "ignore system acls", 260 false); 257 261 258 262 if (fsp && name == NULL) { … … 318 322 } 319 323 324 if (ignore_file_system_acl) { 325 goto out; 326 } 320 327 321 328 status = hash_sd_sha256(pdesc_next, hash_tmp); … … 328 335 if (memcmp(&hash[0], &hash_tmp[0], XATTR_SD_HASH_SIZE) == 0) { 329 336 /* Hash matches, return blob sd. */ 337 DEBUG(10, ("get_nt_acl_internal: blob hash " 338 "matches for file %s\n", 339 name )); 330 340 goto out; 331 341 } … … 351 361 */ 352 362 if (fsp) { 353 is_directory = fsp->is_directory; 363 status = vfs_stat_fsp(fsp); 364 if (!NT_STATUS_IS_OK(status)) { 365 return status; 366 } 354 367 psbuf = &fsp->fsp_name->st; 355 368 } else { 356 i f (vfs_stat_smb_fname(handle->conn,369 int ret = vfs_stat_smb_fname(handle->conn, 357 370 name, 358 &sbuf) == 0) { 359 is_directory = S_ISDIR(sbuf.st_ex_mode); 371 &sbuf); 372 if (ret == -1) { 373 return map_nt_error_from_unix(errno); 360 374 } 361 375 } 362 if (is_directory && 376 is_directory = S_ISDIR(sbuf.st_ex_mode); 377 378 if (ignore_file_system_acl) { 379 TALLOC_FREE(pdesc_next); 380 status = make_default_filesystem_acl(talloc_tos(), 381 name, 382 psbuf, 383 &psd); 384 if (!NT_STATUS_IS_OK(status)) { 385 return status; 386 } 387 } else { 388 if (is_directory && 363 389 !sd_has_inheritable_components(psd, 364 390 true)) { 365 add_directory_inheritable_components(handle,391 add_directory_inheritable_components(handle, 366 392 name, 367 393 psbuf, 368 394 psd); 395 } 396 /* The underlying POSIX module always sets 397 the ~SEC_DESC_DACL_PROTECTED bit, as ACLs 398 can't be inherited in this way under POSIX. 399 Remove it for Windows-style ACLs. */ 400 psd->type &= ~SEC_DESC_DACL_PROTECTED; 369 401 } 370 402 } … … 385 417 TALLOC_FREE(blob.data); 386 418 *ppdesc = psd; 419 420 if (DEBUGLEVEL >= 10) { 421 DEBUG(10,("get_nt_acl_internal: returning acl for %s is:\n", 422 name )); 423 NDR_PRINT_DEBUG(security_descriptor, psd); 424 } 425 387 426 return NT_STATUS_OK; 388 427 } … … 661 700 662 701 static NTSTATUS fset_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp, 663 uint32_t security_info_sent, const struct security_descriptor * psd)702 uint32_t security_info_sent, const struct security_descriptor *orig_psd) 664 703 { 665 704 NTSTATUS status; 666 705 DATA_BLOB blob; 667 706 struct security_descriptor *pdesc_next = NULL; 707 struct security_descriptor *psd = NULL; 668 708 uint8_t hash[XATTR_SD_HASH_SIZE]; 669 709 … … 672 712 fsp_str_dbg(fsp))); 673 713 NDR_PRINT_DEBUG(security_descriptor, 674 CONST_DISCARD(struct security_descriptor *,psd)); 675 } 676 677 /* Ensure we have OWNER/GROUP/DACL set. */ 678 679 if ((security_info_sent & (OWNER_SECURITY_INFORMATION| 680 GROUP_SECURITY_INFORMATION| 681 DACL_SECURITY_INFORMATION)) != 682 (OWNER_SECURITY_INFORMATION| 683 GROUP_SECURITY_INFORMATION| 684 DACL_SECURITY_INFORMATION)) { 685 /* No we don't - read from the existing SD. */ 686 struct security_descriptor *nc_psd = NULL; 687 688 status = get_nt_acl_internal(handle, fsp, 689 NULL, 690 (OWNER_SECURITY_INFORMATION| 691 GROUP_SECURITY_INFORMATION| 692 DACL_SECURITY_INFORMATION), 693 &nc_psd); 694 695 if (!NT_STATUS_IS_OK(status)) { 696 return status; 697 } 698 699 /* This is safe as nc_psd is discarded at fn exit. */ 700 if (security_info_sent & OWNER_SECURITY_INFORMATION) { 701 nc_psd->owner_sid = psd->owner_sid; 702 } 703 security_info_sent |= OWNER_SECURITY_INFORMATION; 704 705 if (security_info_sent & GROUP_SECURITY_INFORMATION) { 706 nc_psd->group_sid = psd->group_sid; 707 } 708 security_info_sent |= GROUP_SECURITY_INFORMATION; 709 710 if (security_info_sent & DACL_SECURITY_INFORMATION) { 711 nc_psd->dacl = dup_sec_acl(talloc_tos(), psd->dacl); 712 if (nc_psd->dacl == NULL) { 713 return NT_STATUS_NO_MEMORY; 714 } 715 } 716 security_info_sent |= DACL_SECURITY_INFORMATION; 717 psd = nc_psd; 714 CONST_DISCARD(struct security_descriptor *,orig_psd)); 715 } 716 717 status = get_nt_acl_internal(handle, fsp, 718 NULL, 719 SECINFO_OWNER|SECINFO_GROUP|SECINFO_DACL|SECINFO_SACL, 720 &psd); 721 722 if (!NT_STATUS_IS_OK(status)) { 723 return status; 724 } 725 726 psd->revision = orig_psd->revision; 727 /* All our SD's are self relative. */ 728 psd->type = orig_psd->type | SEC_DESC_SELF_RELATIVE; 729 730 if ((security_info_sent & SECINFO_OWNER) && (orig_psd->owner_sid != NULL)) { 731 psd->owner_sid = orig_psd->owner_sid; 732 } 733 if ((security_info_sent & SECINFO_GROUP) && (orig_psd->group_sid != NULL)) { 734 psd->group_sid = orig_psd->group_sid; 735 } 736 if (security_info_sent & SECINFO_DACL) { 737 psd->dacl = orig_psd->dacl; 738 psd->type |= SEC_DESC_DACL_PRESENT; 739 } 740 if (security_info_sent & SECINFO_SACL) { 741 psd->sacl = orig_psd->sacl; 742 psd->type |= SEC_DESC_SACL_PRESENT; 718 743 } 719 744 … … 902 927 &info); 903 928 929 if (!NT_STATUS_IS_OK(status)) { 930 goto out; 931 } 932 904 933 if (info != FILE_WAS_CREATED) { 905 934 /* File/directory was opened, not created. */ … … 909 938 fsp = *result; 910 939 911 if ( !NT_STATUS_IS_OK(status) ||fsp == NULL) {940 if (fsp == NULL) { 912 941 /* Only handle success. */ 913 942 goto out; -
vendor/current/source3/modules/vfs_acl_tdb.c
r427 r594 29 29 #define DBGC_CLASS DBGC_VFS 30 30 31 #define ACL_MODULE_NAME "acl_tdb" 31 32 #include "modules/vfs_acl_common.c" 32 33 … … 315 316 } 316 317 317 /* Ensure we have "inherit acls = yes"if we're318 /* Ensure we have the parameters correct if we're 318 319 * using this module. */ 319 320 DEBUG(2,("connect_acl_tdb: setting 'inherit acls = true' " 320 "and 'dos filemode = true' for service %s\n", 321 "'dos filemode = true' and " 322 "'force unknown acl user = true' for service %s\n", 321 323 service )); 324 322 325 lp_do_parameter(SNUM(handle->conn), "inherit acls", "true"); 323 326 lp_do_parameter(SNUM(handle->conn), "dos filemode", "true"); 327 lp_do_parameter(SNUM(handle->conn), "force unknown acl user", "true"); 324 328 325 329 return 0; -
vendor/current/source3/modules/vfs_acl_xattr.c
r414 r594 30 30 31 31 /* Pull in the common functions. */ 32 #define ACL_MODULE_NAME "acl_xattr" 33 32 34 #include "modules/vfs_acl_common.c" 33 35 … … 184 186 } 185 187 186 /* Ensure we have "inherit acls = yes" if we're 187 * using this module. */ 188 DEBUG(2,("connect_acl_xattr: setting 'inherit acls = true' " 189 "and 'dos filemode = true' for service %s\n", 190 service )); 188 /* Ensure we have the parameters correct if we're 189 * using this module. */ 190 DEBUG(2,("connect_acl_xattr: setting 'inherit acls = true' " 191 "'dos filemode = true' and " 192 "'force unknown acl user = true' for service %s\n", 193 service )); 191 194 192 195 lp_do_parameter(SNUM(handle->conn), "inherit acls", "true"); 193 196 lp_do_parameter(SNUM(handle->conn), "dos filemode", "true"); 197 lp_do_parameter(SNUM(handle->conn), "force unknown acl user", "true"); 194 198 195 199 return 0; -
vendor/current/source3/modules/vfs_default.c
r414 r594 218 218 && parent_dirname(talloc_tos(), path, &parent, NULL) 219 219 && (has_dacl = directory_has_default_acl(handle->conn, parent))) 220 mode = 0777;220 mode = (0777 & lp_dir_mask(SNUM(handle->conn))); 221 221 222 222 TALLOC_FREE(parent); … … 899 899 result = utimensat(AT_FDCWD, smb_fname->base_name, NULL, 0); 900 900 } 901 #elif defined(HAVE_UTIMES) 901 if (!((result == -1) && (errno == ENOSYS))) { 902 goto out; 903 } 904 #endif 905 #if defined(HAVE_UTIMES) 902 906 if (ft != NULL) { 903 907 struct timeval tv[2]; … … 908 912 result = utimes(smb_fname->base_name, NULL); 909 913 } 910 #elif defined(HAVE_UTIME) 914 if (!((result == -1) && (errno == ENOSYS))) { 915 goto out; 916 } 917 #endif 918 #if defined(HAVE_UTIME) 911 919 if (ft != NULL) { 912 920 struct utimbuf times; … … 917 925 result = utime(smb_fname->base_name, NULL); 918 926 } 919 #else 927 if (!((result == -1) && (errno == ENOSYS))) { 928 goto out; 929 } 930 #endif 920 931 errno = ENOSYS; 921 932 result = -1; 922 #endif923 933 924 934 out: -
vendor/current/source3/modules/vfs_gpfs.c
r414 r594 940 940 GPFS_WINATTR_SET_ATTRS, &attrs); 941 941 if ( ret == -1){ 942 if (errno == ENOSYS) { 943 return SMB_VFS_NEXT_SETXATTR(handle, path, name, value, 944 size, flags); 945 } 946 942 947 DEBUG(1, ("gpfs_set_xattr:Set GPFS attributes failed %d\n",ret)); 943 948 return -1; … … 965 970 ret = get_gpfs_winattrs(CONST_DISCARD(char *, path), &attrs); 966 971 if ( ret == -1){ 972 if (errno == ENOSYS) { 973 return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, 974 size); 975 } 976 967 977 DEBUG(1, ("gpfs_get_xattr: Get GPFS attributes failed: %d\n",ret)); 968 978 return -1; … … 1096 1106 ret = set_gpfs_winattrs(CONST_DISCARD(char *, path), 1097 1107 GPFS_WINATTR_SET_CREATION_TIME, &attrs); 1098 if(ret == -1 ){1108 if(ret == -1 && errno != ENOSYS){ 1099 1109 DEBUG(1,("vfs_gpfs_ntimes: set GPFS ntimes failed %d\n",ret)); 1100 1110 return -1; -
vendor/current/source3/modules/vfs_scannedonly.c
r478 r594 427 427 } 428 428 if (retval == 0 && VALID_STAT(cache_smb_fname->st)) { 429 if (timespec_is_newer(&smb_fname->st.st_ex_ mtime,430 &cache_smb_fname->st.st_ex_ mtime)) {429 if (timespec_is_newer(&smb_fname->st.st_ex_ctime, 430 &cache_smb_fname->st.st_ex_ctime)) { 431 431 talloc_free(cache_smb_fname); 432 432 return true; … … 490 490 /* still no cachefile, or still too old, return 0 */ 491 491 if (retval != 0 492 || !timespec_is_newer(&smb_fname->st.st_ex_ mtime,493 &cache_smb_fname->st.st_ex_ mtime)) {492 || !timespec_is_newer(&smb_fname->st.st_ex_ctime, 493 &cache_smb_fname->st.st_ex_ctime)) { 494 494 DEBUG(SCANNEDONLY_DEBUG, 495 495 ("retval=%d, return 0\n",retval));
Note:
See TracChangeset
for help on using the changeset viewer.