Changeset 370 for branches/samba-3.3.x/source/smbd/trans2.c
- Timestamp:
- Jan 15, 2010, 8:23:30 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/smbd/trans2.c
r309 r370 1280 1280 char *last_entry_ptr; 1281 1281 bool was_8_3; 1282 uint32 nt_extmode; /* Used for NT connections instead of mode */1283 1282 bool needslash = ( conn->dirpath[strlen(conn->dirpath) -1] != '/'); 1284 1283 bool check_mangled_names = lp_manglednames(conn->params); … … 1466 1465 p = pdata; 1467 1466 last_entry_ptr = p; 1468 1469 nt_extmode = mode ? mode : FILE_ATTRIBUTE_NORMAL;1470 1467 1471 1468 switch (info_level) { … … 1615 1612 SOFF_T(p,0,file_size); p += 8; 1616 1613 SOFF_T(p,0,allocation_size); p += 8; 1617 SIVAL(p,0, nt_extmode); p += 4;1614 SIVAL(p,0,mode); p += 4; 1618 1615 q = p; p += 4; /* q is placeholder for name length. */ 1619 1616 { … … 1666 1663 SOFF_T(p,0,file_size); p += 8; 1667 1664 SOFF_T(p,0,allocation_size); p += 8; 1668 SIVAL(p,0, nt_extmode); p += 4;1665 SIVAL(p,0,mode); p += 4; 1669 1666 len = srvstr_push(base_data, flags2, 1670 1667 p + 4, fname, PTR_DIFF(end_data, p+4), … … 1689 1686 SOFF_T(p,0,file_size); p += 8; 1690 1687 SOFF_T(p,0,allocation_size); p += 8; 1691 SIVAL(p,0, nt_extmode); p += 4;1688 SIVAL(p,0,mode); p += 4; 1692 1689 q = p; p += 4; /* q is placeholder for name length. */ 1693 1690 { … … 1738 1735 SOFF_T(p,0,file_size); p += 8; 1739 1736 SOFF_T(p,0,allocation_size); p += 8; 1740 SIVAL(p,0, nt_extmode); p += 4;1737 SIVAL(p,0,mode); p += 4; 1741 1738 q = p; p += 4; /* q is placeholder for name length. */ 1742 1739 { … … 1771 1768 SOFF_T(p,0,file_size); p += 8; 1772 1769 SOFF_T(p,0,allocation_size); p += 8; 1773 SIVAL(p,0, nt_extmode); p += 4;1770 SIVAL(p,0,mode); p += 4; 1774 1771 q = p; p += 4; /* q is placeholder for name length */ 1775 1772 { … … 2270 2267 continue_bit = (findnext_flags & FLAG_TRANS2_FIND_CONTINUE); 2271 2268 2272 srvstr_get_path_wcard(ctx, params, req->flags2, &resume_name, 2269 if (!continue_bit) { 2270 /* We only need resume_name if continue_bit is zero. */ 2271 srvstr_get_path_wcard(ctx, params, req->flags2, &resume_name, 2273 2272 params+12, 2274 2273 total_params - 12, STR_TERMINATE, &ntstatus, 2275 2274 &mask_contains_wcard); 2276 if (!NT_STATUS_IS_OK(ntstatus)) {2277 /* Win9x or OS/2 can send a resume name of ".." or ".". This will cause the parser to2278 complain (it thinks we're asking for the directory above the shared2279 path or an invalid name). Catch this as the resume name is only compared, never used in2280 a file access. JRA. */2281 srvstr_pull_talloc(ctx, params, req->flags2,2275 if (!NT_STATUS_IS_OK(ntstatus)) { 2276 /* Win9x or OS/2 can send a resume name of ".." or ".". This will cause the parser to 2277 complain (it thinks we're asking for the directory above the shared 2278 path or an invalid name). Catch this as the resume name is only compared, never used in 2279 a file access. JRA. */ 2280 srvstr_pull_talloc(ctx, params, req->flags2, 2282 2281 &resume_name, params+12, 2283 2282 total_params - 12, 2284 2283 STR_TERMINATE); 2285 2284 2286 if (!resume_name || !(ISDOT(resume_name) || ISDOTDOT(resume_name))) { 2287 reply_nterror(req, ntstatus); 2288 return; 2285 if (!resume_name || !(ISDOT(resume_name) || ISDOTDOT(resume_name))) { 2286 reply_nterror(req, ntstatus); 2287 return; 2288 } 2289 2289 } 2290 2290 } … … 2294 2294 resume_key = %d resume name = %s continue=%d level = %d\n", 2295 2295 dptr_num, max_data_bytes, maxentries, close_after_request, close_if_end, 2296 requires_resume_key, resume_key, resume_name, continue_bit, info_level)); 2296 requires_resume_key, resume_key, 2297 resume_name ? resume_name : "(NULL)", continue_bit, info_level)); 2297 2298 2298 2299 if (!maxentries) { … … 2416 2417 */ 2417 2418 2418 if( *resume_name && !continue_bit) {2419 if(!continue_bit && resume_name && *resume_name) { 2419 2420 SMB_STRUCT_STAT st; 2420 2421 … … 4078 4079 mode = dos_mode(conn,fname,&sbuf); 4079 4080 } 4080 if (!mode)4081 mode = FILE_ATTRIBUTE_NORMAL;4082 4081 4083 4082 nlink = sbuf.st_nlink;
Note:
See TracChangeset
for help on using the changeset viewer.