Changeset 228 for branches/samba-3.2.x/source/smbd/trans2.c
- Timestamp:
- May 26, 2009, 9:44:50 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/smbd/trans2.c
r205 r228 1092 1092 if (mask[0] == '.' && mask[1] == 0) 1093 1093 return False; 1094 if (dptr_has_wild(conn->dirptr)) { 1095 return False; 1096 } 1094 1097 if (conn->case_sensitive) 1095 1098 return strcmp(str,mask)==0; 1096 if (StrCaseCmp(str,mask) != 0) { 1097 return False; 1098 } 1099 if (dptr_has_wild(conn->dirptr)) { 1100 return False; 1101 } 1102 return True; 1099 else 1100 return StrCaseCmp(str,mask) == 0; 1103 1101 } 1104 1102 … … 1134 1132 #endif 1135 1133 1136 DEBUG(0,("unix_filetype: unknown filetype %u ", (unsigned)mode));1134 DEBUG(0,("unix_filetype: unknown filetype %u\n", (unsigned)mode)); 1137 1135 return UNIX_TYPE_UNKNOWN; 1138 1136 } … … 1897 1895 int info_level; 1898 1896 char *directory = NULL; 1899 c onst char *mask = NULL;1897 char *mask = NULL; 1900 1898 char *p; 1901 1899 int last_entry_off=0; … … 1985 1983 } 1986 1984 1987 ntstatus = unix_convert(ctx, conn, directory, True, &directory, NULL, &sbuf);1985 ntstatus = unix_convert(ctx, conn, directory, True, &directory, &mask, &sbuf); 1988 1986 if (!NT_STATUS_IS_OK(ntstatus)) { 1989 1987 reply_nterror(req, ntstatus); … … 2001 1999 /* Windows and OS/2 systems treat search on the root '\' as if it were '\*' */ 2002 2000 if((directory[0] == '.') && (directory[1] == '\0')) { 2003 mask = "*"; 2001 mask = talloc_strdup(ctx,"*"); 2002 if (!mask) { 2003 reply_nterror(req, NT_STATUS_NO_MEMORY); 2004 return; 2005 } 2004 2006 mask_contains_wcard = True; 2005 } else {2006 mask = directory;2007 2007 } 2008 2008 directory = talloc_strdup(talloc_tos(), "./"); … … 2012 2012 } 2013 2013 } else { 2014 mask = p+1;2015 2014 *p = 0; 2016 2015 } … … 3990 3989 } 3991 3990 3991 if ((conn->fs_capabilities & FILE_NAMED_STREAMS) 3992 && is_ntfs_stream_name(fname)) { 3993 char *base; 3994 SMB_STRUCT_STAT bsbuf; 3995 3996 status = split_ntfs_stream_name(talloc_tos(), fname, 3997 &base, NULL); 3998 if (!NT_STATUS_IS_OK(status)) { 3999 DEBUG(10, ("create_file_unixpath: " 4000 "split_ntfs_stream_name failed: %s\n", 4001 nt_errstr(status))); 4002 reply_nterror(req, status); 4003 return; 4004 } 4005 4006 SMB_ASSERT(!is_ntfs_stream_name(base)); /* paranoia.. */ 4007 4008 if (INFO_LEVEL_IS_UNIX(info_level)) { 4009 /* Always do lstat for UNIX calls. */ 4010 if (SMB_VFS_LSTAT(conn,base,&bsbuf)) { 4011 DEBUG(3,("call_trans2qfilepathinfo: SMB_VFS_LSTAT of %s failed (%s)\n",base,strerror(errno))); 4012 reply_unixerror(req,ERRDOS,ERRbadpath); 4013 return; 4014 } 4015 } else { 4016 if (SMB_VFS_STAT(conn,base,&bsbuf) != 0) { 4017 DEBUG(3,("call_trans2qfilepathinfo: fileinfo of %s failed (%s)\n",base,strerror(errno))); 4018 reply_unixerror(req,ERRDOS,ERRbadpath); 4019 return; 4020 } 4021 } 4022 4023 fileid = vfs_file_id_from_sbuf(conn, &bsbuf); 4024 get_file_infos(fileid, &delete_pending, NULL); 4025 if (delete_pending) { 4026 reply_nterror(req, NT_STATUS_DELETE_PENDING); 4027 return; 4028 } 4029 } 4030 3992 4031 if (INFO_LEVEL_IS_UNIX(info_level)) { 3993 4032 /* Always do lstat for UNIX calls. */ … … 4903 4942 4904 4943 if (fsp != NULL) { 4905 set_sticky_write_time_fsp(fsp, ts[1]); 4944 if (fsp->base_fsp) { 4945 set_sticky_write_time_fsp(fsp->base_fsp, ts[1]); 4946 } else { 4947 set_sticky_write_time_fsp(fsp, ts[1]); 4948 } 4906 4949 } else { 4907 4950 set_sticky_write_time_path(conn, fname, … … 4917 4960 #endif 4918 4961 DEBUG(10,("smb_set_file_time: setting utimes to modified values.\n")); 4962 4963 if (fsp && fsp->base_fsp) { 4964 fname = fsp->base_fsp->fsp_name; 4965 } 4919 4966 4920 4967 if(file_ntimes(conn, fname, ts)!=0) { … … 5346 5393 } 5347 5394 5348 /* Create the base directory. */ 5349 base_name = talloc_strdup(ctx, fname); 5350 if (!base_name) { 5351 return NT_STATUS_NO_MEMORY; 5352 } 5353 p = strrchr_m(base_name, '/'); 5354 if (p) { 5355 p[1] = '\0'; 5356 } else { 5357 base_name = talloc_strdup(ctx, "./"); 5395 if (fsp && fsp->base_fsp) { 5396 if (newname[0] != ':') { 5397 return NT_STATUS_NOT_SUPPORTED; 5398 } 5399 base_name = talloc_asprintf(ctx, "%s%s", 5400 fsp->base_fsp->fsp_name, 5401 newname); 5358 5402 if (!base_name) { 5359 5403 return NT_STATUS_NO_MEMORY; 5360 5404 } 5361 } 5362 /* Append the new name. */ 5363 base_name = talloc_asprintf_append(base_name, 5364 "%s", 5365 newname); 5366 if (!base_name) { 5367 return NT_STATUS_NO_MEMORY; 5405 } else { 5406 if (is_ntfs_stream_name(newname)) { 5407 return NT_STATUS_NOT_SUPPORTED; 5408 } 5409 5410 /* Create the base directory. */ 5411 base_name = talloc_strdup(ctx, fname); 5412 if (!base_name) { 5413 return NT_STATUS_NO_MEMORY; 5414 } 5415 p = strrchr_m(base_name, '/'); 5416 if (p) { 5417 p[1] = '\0'; 5418 } else { 5419 base_name = talloc_strdup(ctx, "./"); 5420 if (!base_name) { 5421 return NT_STATUS_NO_MEMORY; 5422 } 5423 } 5424 /* Append the new name. */ 5425 base_name = talloc_asprintf_append(base_name, 5426 "%s", 5427 newname); 5428 if (!base_name) { 5429 return NT_STATUS_NO_MEMORY; 5430 } 5368 5431 } 5369 5432 … … 7067 7130 return; 7068 7131 } 7069 } else if (IVAL(pdata,0) != 4) { 7070 reply_nterror(req, NT_STATUS_INVALID_PARAMETER); 7071 return; 7072 } 7132 } 7133 /* If total_data == 4 Windows doesn't care what values 7134 * are placed in that field, it just ignores them. 7135 * The System i QNTC IBM SMB client puts bad values here, 7136 * so ignore them. */ 7073 7137 7074 7138 status = create_directory(conn, req, directory);
Note:
See TracChangeset
for help on using the changeset viewer.