Changeset 480 for trunk/server/source3/smbd/trans2.c
- Timestamp:
- Aug 2, 2010, 8:16:45 PM (15 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 453,478
- Property svn:mergeinfo changed
-
trunk/server/source3/smbd/trans2.c
r454 r480 56 56 } 57 57 return val; 58 } 59 60 /******************************************************************** 61 Create a 64 bit FileIndex. If the file is on the same device as 62 the root of the share, just return the 64-bit inode. If it isn't, 63 mangle as we used to do. 64 ********************************************************************/ 65 66 uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf) 67 { 68 uint64_t file_index; 69 if (conn->base_share_dev == psbuf->st_ex_dev) { 70 return (uint64_t)psbuf->st_ex_ino; 71 } 72 file_index = ((psbuf->st_ex_ino) & UINT32_MAX); /* FileIndexLow */ 73 file_index |= ((uint64_t)((psbuf->st_ex_dev) & UINT32_MAX)) << 32; /* FileIndexHigh */ 74 return file_index; 58 75 } 59 76 … … 133 150 } else { 134 151 #else 135 152 { 136 153 #endif 137 154 pea->name = talloc_strdup(mem_ctx, ea_name); … … 1074 1091 1075 1092 /* Any data in this call is an EA list. */ 1076 if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) { 1077 reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED); 1078 goto out; 1079 } 1080 1081 if (total_data != 4) { 1093 if (total_data && (total_data != 4)) { 1082 1094 if (total_data < 10) { 1083 1095 reply_nterror(req, NT_STATUS_INVALID_PARAMETER); … … 1098 1110 goto out; 1099 1111 } 1100 } else if (IVAL(pdata,0) != 4) { 1101 reply_nterror(req, NT_STATUS_INVALID_PARAMETER); 1102 goto out; 1112 1113 if (!lp_ea_support(SNUM(conn))) { 1114 reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED); 1115 goto out; 1116 } 1103 1117 } 1104 1118 … … 1491 1505 uint64_t file_size = 0; 1492 1506 uint64_t allocation_size = 0; 1507 uint64_t file_index = 0; 1493 1508 uint32_t len; 1494 1509 struct timespec mdate_ts, adate_ts, cdate_ts, create_date_ts; … … 1512 1527 } 1513 1528 allocation_size = SMB_VFS_GET_ALLOC_SIZE(conn, NULL, &smb_fname->st); 1529 1530 file_index = get_FileIndex(conn, &smb_fname->st); 1514 1531 1515 1532 mdate_ts = smb_fname->st.st_ex_mtime; … … 1881 1898 } 1882 1899 SIVAL(p,0,0); p += 4; /* Unknown - reserved ? */ 1883 SIVAL(p,0,smb_fname->st.st_ex_ino); p += 4; /* FileIndexLow */ 1884 SIVAL(p,0,smb_fname->st.st_ex_dev); p += 4; /* FileIndexHigh */ 1900 SBVAL(p,0,file_index); p += 8; 1885 1901 len = srvstr_push(base_data, flags2, p, 1886 1902 fname, PTR_DIFF(end_data, p), … … 1952 1968 p += 26; 1953 1969 SSVAL(p,0,0); p += 2; /* Reserved ? */ 1954 SIVAL(p,0,smb_fname->st.st_ex_ino); p += 4; /* FileIndexLow */ 1955 SIVAL(p,0,smb_fname->st.st_ex_dev); p += 4; /* FileIndexHigh */ 1970 SBVAL(p,0,file_index); p += 8; 1956 1971 len = srvstr_push(base_data, flags2, p, 1957 1972 fname, PTR_DIFF(end_data, p), … … 3867 3882 const SMB_STRUCT_STAT *psbuf) 3868 3883 { 3884 uint64_t file_index = get_FileIndex(conn, psbuf); 3885 3869 3886 DEBUG(10,("store_file_unix_basic: SMB_QUERY_FILE_UNIX_BASIC\n")); 3870 3887 DEBUG(4,("store_file_unix_basic: st_mode=%o\n",(int)psbuf->st_ex_mode)); … … 3900 3917 pdata += 8; 3901 3918 3902 SINO_T_VAL(pdata,0,(SMB_INO_T) psbuf->st_ex_ino); /* inode number */3919 SINO_T_VAL(pdata,0,(SMB_INO_T)file_index); /* inode number */ 3903 3920 pdata += 8; 3904 3921 … … 4302 4319 I think this causes us to fail the IFSKIT 4303 4320 BasicFileInformationTest. -tpot */ 4304 file_index = ((psbuf->st_ex_ino) & UINT32_MAX); /* FileIndexLow */ 4305 file_index |= ((uint64_t)((psbuf->st_ex_dev) & UINT32_MAX)) << 32; /* FileIndexHigh */ 4321 file_index = get_FileIndex(conn, psbuf); 4306 4322 4307 4323 switch (info_level) { … … 5473 5489 else { 5474 5490 #endif 5475 5476 5491 DEBUG(10,("smb_set_file_time: setting utimes to modified values.\n")); 5477 5492 … … 5957 5972 req->flags2 & FLAGS2_DFS_PATHNAMES, 5958 5973 newname, 5974 true, 5959 5975 &newname, 5960 5976 &dest_has_wcard); … … 7829 7845 } 7830 7846 7831 /* Any data in this call is an EA list. */7832 if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) {7833 reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);7834 goto out;7835 }7836 7837 7847 /* 7838 7848 * OS/2 workplace shell seems to send SET_EA requests of "null" … … 7841 7851 */ 7842 7852 7843 if (total_data != 4) { 7853 if (total_data && (total_data != 4)) { 7854 /* Any data in this call is an EA list. */ 7844 7855 if (total_data < 10) { 7845 7856 reply_nterror(req, NT_STATUS_INVALID_PARAMETER); … … 7858 7869 if (!ea_list) { 7859 7870 reply_nterror(req, NT_STATUS_INVALID_PARAMETER); 7871 goto out; 7872 } 7873 7874 if (!lp_ea_support(SNUM(conn))) { 7875 reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED); 7860 7876 goto out; 7861 7877 }
Note:
See TracChangeset
for help on using the changeset viewer.