Changeset 746 for vendor/current/source3/smbd/filename.c
- Timestamp:
- Nov 27, 2012, 4:56:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/smbd/filename.c
r740 r746 384 384 if((!conn->case_sensitive || !(conn->fs_capabilities & 385 385 FILE_CASE_SENSITIVE_SEARCH)) && 386 stat_cache_lookup(conn, &smb_fname->base_name, &dirpath, &start,386 stat_cache_lookup(conn, posix_pathnames, &smb_fname->base_name, &dirpath, &start, 387 387 &smb_fname->st)) { 388 388 goto done; … … 978 978 979 979 /**************************************************************************** 980 Ensure a path is not vetod. 981 ****************************************************************************/ 982 983 NTSTATUS check_veto_path(connection_struct *conn, const char *name) 984 { 985 if (IS_VETO_PATH(conn, name)) { 986 /* Is it not dot or dot dot. */ 987 if (!(ISDOT(name) || ISDOTDOT(name))) { 988 DEBUG(5,("check_veto_path: file path name %s vetoed\n", 989 name)); 990 return map_nt_error_from_unix(ENOENT); 991 } 992 } 993 return NT_STATUS_OK; 994 } 995 996 /**************************************************************************** 980 997 Check a filename - possibly calling check_reduced_name. 981 998 This is called by every routine before it allows an operation on a filename. … … 986 1003 NTSTATUS check_name(connection_struct *conn, const char *name) 987 1004 { 988 if (IS_VETO_PATH(conn, name)) { 989 /* Is it not dot or dot dot. */ 990 if (!((name[0] == '.') && (!name[1] || 991 (name[1] == '.' && !name[2])))) { 992 DEBUG(5,("check_name: file path name %s vetoed\n", 993 name)); 994 return map_nt_error_from_unix(ENOENT); 995 } 1005 NTSTATUS status = check_veto_path(conn, name); 1006 1007 if (!NT_STATUS_IS_OK(status)) { 1008 return status; 996 1009 } 997 1010 998 1011 if (!lp_widelinks(SNUM(conn)) || !lp_symlinks(SNUM(conn))) { 999 NTSTATUSstatus = check_reduced_name(conn,name);1012 status = check_reduced_name(conn,name); 1000 1013 if (!NT_STATUS_IS_OK(status)) { 1001 1014 DEBUG(5,("check_name: name %s failed with %s\n",name, … … 1171 1184 { 1172 1185 NTSTATUS status; 1173 unsigned int i, num_streams ;1186 unsigned int i, num_streams = 0; 1174 1187 struct stream_struct *streams = NULL; 1175 1188 … … 1186 1199 1187 1200 /* Fall back to a case-insensitive scan of all streams on the file. */ 1188 status = SMB_VFS_STREAMINFO(conn, NULL, smb_fname->base_name, mem_ctx,1189 1201 status = vfs_streaminfo(conn, NULL, smb_fname->base_name, mem_ctx, 1202 &num_streams, &streams); 1190 1203 1191 1204 if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { … … 1315 1328 } 1316 1329 1330 if ((ucf_flags & UCF_UNIX_NAME_LOOKUP) && 1331 VALID_STAT((*pp_smb_fname)->st) && 1332 S_ISLNK((*pp_smb_fname)->st.st_ex_mode)) { 1333 return check_veto_path(conn, (*pp_smb_fname)->base_name); 1334 } 1335 1317 1336 status = check_name(conn, (*pp_smb_fname)->base_name); 1318 1337 if (!NT_STATUS_IS_OK(status)) {
Note:
See TracChangeset
for help on using the changeset viewer.