Changeset 136 for trunk/samba/source/smbd/trans2.c
- Timestamp:
- May 29, 2008, 12:22:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba/source/smbd/trans2.c
r133 r136 1206 1206 return NT_STATUS_OK; 1207 1207 } 1208 1209 /**************************************************************************** 1210 Needed to show the msdfs symlinks as directories. Modifies psbuf 1211 to be a directory if it's a msdfs link. 1212 ****************************************************************************/ 1213 1214 static bool check_msdfs_link(connection_struct *conn, 1215 const char *pathname, 1216 SMB_STRUCT_STAT *psbuf) 1217 { 1218 int saved_errno = errno; 1219 if(lp_host_msdfs() && 1220 lp_msdfs_root(SNUM(conn)) && 1221 is_msdfs_link(conn, pathname, psbuf)) { 1222 1223 DEBUG(5,("check_msdfs_link: Masquerading msdfs link %s " 1224 "as a directory\n", 1225 pathname)); 1226 psbuf->st_mode = (psbuf->st_mode & 0xFFF) | S_IFDIR; 1227 errno = saved_errno; 1228 return true; 1229 } 1230 errno = saved_errno; 1231 return false; 1232 } 1233 1208 1234 1209 1235 /**************************************************************************** … … 1372 1398 * directories */ 1373 1399 1374 if(lp_host_msdfs() && 1375 lp_msdfs_root(SNUM(conn)) && 1376 ((ms_dfs_link = is_msdfs_link(conn, pathreal, &sbuf)) == True)) { 1377 DEBUG(5,("get_lanman2_dir_entry: Masquerading msdfs link %s " 1378 "as a directory\n", 1379 pathreal)); 1380 sbuf.st_mode = (sbuf.st_mode & 0xFFF) | S_IFDIR; 1381 1382 } else { 1383 1400 ms_dfs_link = check_msdfs_link(conn, pathreal, &sbuf); 1401 if (!ms_dfs_link) { 1384 1402 DEBUG(5,("get_lanman2_dir_entry:Couldn't stat [%s] (%s)\n", 1385 1403 pathreal,strerror(errno))); … … 3818 3836 uint32 access_mask = 0x12019F; /* Default - GENERIC_EXECUTE mapping from Windows */ 3819 3837 char *lock_data = NULL; 3838 bool ms_dfs_link = false; 3820 3839 TALLOC_CTX *ctx = talloc_tos(); 3821 3840 … … 3971 3990 return; 3972 3991 } 3992 3973 3993 } else if (!VALID_STAT(sbuf) && SMB_VFS_STAT(conn,fname,&sbuf) && (info_level != SMB_INFO_IS_NAME_VALID)) { 3974 DEBUG(3,("call_trans2qfilepathinfo: SMB_VFS_STAT of %s failed (%s)\n",fname,strerror(errno))); 3975 reply_unixerror(req, ERRDOS, ERRbadpath); 3976 return; 3994 ms_dfs_link = check_msdfs_link(conn,fname,&sbuf); 3995 3996 if (!ms_dfs_link) { 3997 DEBUG(3,("call_trans2qfilepathinfo: SMB_VFS_STAT of %s failed (%s)\n",fname,strerror(errno))); 3998 reply_unixerror(req, ERRDOS, ERRbadpath); 3999 return; 4000 } 3977 4001 } 3978 4002 … … 3999 4023 base_name = p+1; 4000 4024 4001 mode = dos_mode(conn,fname,&sbuf); 4025 if (ms_dfs_link) { 4026 mode = dos_mode_msdfs(conn,fname,&sbuf); 4027 } else { 4028 mode = dos_mode(conn,fname,&sbuf); 4029 } 4002 4030 if (!mode) 4003 4031 mode = FILE_ATTRIBUTE_NORMAL;
Note:
See TracChangeset
for help on using the changeset viewer.