Changeset 732 for branches/samba-3.5.x/source3/smbd/filename.c
- Timestamp:
- Nov 12, 2012, 4:35:55 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.5.x/source3/smbd/filename.c
r599 r732 296 296 if((!conn->case_sensitive || !(conn->fs_capabilities & 297 297 FILE_CASE_SENSITIVE_SEARCH)) && 298 stat_cache_lookup(conn, &smb_fname->base_name, &dirpath, &start,298 stat_cache_lookup(conn, posix_pathnames, &smb_fname->base_name, &dirpath, &start, 299 299 &smb_fname->st)) { 300 300 goto done; … … 840 840 841 841 /**************************************************************************** 842 Ensure a path is not vetod. 843 ****************************************************************************/ 844 845 NTSTATUS check_veto_path(connection_struct *conn, const char *name) 846 { 847 if (IS_VETO_PATH(conn, name)) { 848 /* Is it not dot or dot dot. */ 849 if (!(ISDOT(name) || ISDOTDOT(name))) { 850 DEBUG(5,("check_veto_path: file path name %s vetoed\n", 851 name)); 852 return map_nt_error_from_unix(ENOENT); 853 } 854 } 855 return NT_STATUS_OK; 856 } 857 858 /**************************************************************************** 842 859 Check a filename - possibly calling check_reduced_name. 843 860 This is called by every routine before it allows an operation on a filename. … … 848 865 NTSTATUS check_name(connection_struct *conn, const char *name) 849 866 { 850 if (IS_VETO_PATH(conn, name)) { 851 /* Is it not dot or dot dot. */ 852 if (!((name[0] == '.') && (!name[1] || 853 (name[1] == '.' && !name[2])))) { 854 DEBUG(5,("check_name: file path name %s vetoed\n", 855 name)); 856 return map_nt_error_from_unix(ENOENT); 857 } 867 NTSTATUS status = check_veto_path(conn, name); 868 869 if (!NT_STATUS_IS_OK(status)) { 870 return status; 858 871 } 859 872 860 873 if (!lp_widelinks(SNUM(conn)) || !lp_symlinks(SNUM(conn))) { 861 NTSTATUSstatus = check_reduced_name(conn,name);874 status = check_reduced_name(conn,name); 862 875 if (!NT_STATUS_IS_OK(status)) { 863 876 DEBUG(5,("check_name: name %s failed with %s\n",name, … … 1177 1190 } 1178 1191 1192 if ((ucf_flags & UCF_UNIX_NAME_LOOKUP) && 1193 VALID_STAT((*pp_smb_fname)->st) && 1194 S_ISLNK((*pp_smb_fname)->st.st_ex_mode)) { 1195 return check_veto_path(conn, (*pp_smb_fname)->base_name); 1196 } 1197 1179 1198 status = check_name(conn, (*pp_smb_fname)->base_name); 1180 1199 if (!NT_STATUS_IS_OK(status)) {
Note:
See TracChangeset
for help on using the changeset viewer.