Changeset 274 for branches/samba-3.3.x/source/smbd/filename.c
- Timestamp:
- Jun 17, 2009, 2:19:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/smbd/filename.c
r224 r274 37 37 const char *name, TALLOC_CTX *mem_ctx, 38 38 char **found_name); 39 static int get_real_filename_internal(connection_struct *conn, 40 const char *path, const char *name, 41 bool mangled, 42 TALLOC_CTX *mem_ctx, char **found_name); 39 43 40 44 /**************************************************************************** … … 494 498 } 495 499 496 /* ENOENT is the only valid error here. */ 497 if ((errno != 0) && (errno != ENOENT)) { 500 /* 501 * ENOENT/EACCESS are the only valid errors 502 * here. EACCESS needs handling here for 503 * "dropboxes", i.e. directories where users 504 * can only put stuff with permission -wx. 505 */ 506 if ((errno != 0) && (errno != ENOENT) 507 && (errno != EACCES)) { 498 508 /* 499 509 * ENOTDIR and ELOOP both map to … … 505 515 result = 506 516 NT_STATUS_OBJECT_PATH_NOT_FOUND; 507 } 508 else { 517 } else { 509 518 result = 510 519 map_nt_error_from_unix(errno); … … 838 847 /* Name is now unmangled. */ 839 848 name = unmangled_name; 840 } 841 return get_real_filename(conn, path, name, mem_ctx, 842 found_name); 849 } else { 850 /* 851 * If we have mangled names, do not ask the VFS'es 852 * GET_REAL_FILENAME. The Unix file system below does 853 * not know about Samba's style of mangling. 854 * 855 * Boolean flags passed down are evil, the alternative 856 * would be to pass a comparison function down into 857 * the loop in get_real_filename_internal(). For now, 858 * do the quick&dirty boolean flag approach. 859 */ 860 return get_real_filename_internal(conn, path, name, 861 true, 862 mem_ctx, found_name); 863 } 843 864 } 844 865 … … 847 868 } 848 869 849 int get_real_filename(connection_struct *conn, const char *path, 850 const char *name, TALLOC_CTX *mem_ctx, 851 char **found_name) 870 static int get_real_filename_internal(connection_struct *conn, 871 const char *path, const char *name, 872 bool mangled, 873 TALLOC_CTX *mem_ctx, char **found_name) 852 874 { 853 875 struct smb_Dir *cur_dir; 854 876 const char *dname; 855 bool mangled;856 877 char *unmangled_name = NULL; 857 878 long curpos; … … 902 923 errno = ENOENT; 903 924 return -1; 925 } 926 927 928 929 int get_real_filename(connection_struct *conn, 930 const char *path, const char *name, 931 TALLOC_CTX *mem_ctx, char **found_name) 932 { 933 /* 934 * This is the default VFS function. If we end up here, we know we 935 * don't have mangled names around. 936 */ 937 return get_real_filename_internal(conn, path, name, false, 938 mem_ctx, found_name); 904 939 } 905 940
Note:
See TracChangeset
for help on using the changeset viewer.