Skip to content

Commit

Permalink
Updated to version 2.15
Browse files Browse the repository at this point in the history
Added more debug output to the cache free/invalidate/fill functionality.

The Action_ExamineNext() function could omit the last directory entry. Oops.
  • Loading branch information
obarthel committed Feb 16, 2019
1 parent 577723f commit 52aeb95
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 70 deletions.
17 changes: 13 additions & 4 deletions documentation/history.doc
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ smbfs 1.28 (4.12.2000)
smbfs 1.29 (6.12.2000)

- Writes larger than 65535 bytes could stall and slow down the
file system. Fixed. [Thore B�ckelmann]
file system. Fixed. [Thore B�ckelmann]

- The ACTION_MORE_CACHE implementation never returned the total
number of cache entries allocated. Fixed. [Thore B�ckelmann]
number of cache entries allocated. Fixed. [Thore B�ckelmann]

- Plain text passwords didn't seem to work any more after I made
the changes to allow for encrypted passwords to be used. Fixed.
Expand Down Expand Up @@ -316,7 +316,7 @@ smbfs 1.42 (19.12.2000)
smbfs 1.43 (21.12.2000)

- The integrated broadcase name query code would conflict with the
DNS lookup. Fixed. [Thore B�ckelmann]
DNS lookup. Fixed. [Thore B�ckelmann]

- The NetBIOS name query code now retries four times to get a response
out of the network.
Expand Down Expand Up @@ -2756,7 +2756,7 @@ smbfs 2.8 (19.12.2018)

- The default values for READTHRESHOLD and WRITETHRESHOLD now have the
effect of transmitting the SMB header and the payload separately,
just like it was introduces in version 2.1.
just like it was introduced in version 2.1.

Use something like READTHRESHOLD=1500 and WRITETHRESHOLD=1500 to
send packets smaller than or equal to 1500 bytes as a combined
Expand Down Expand Up @@ -2918,3 +2918,12 @@ smbfs 2.14 (15.2.2019)
- Adding another entry to the cache, invalidating the cache or
resetting the cache now all use dedicated functions instead of
directly manipulating the assorted data structures.


smbfs 2.15 (16.2.2019)

- Added more debug output to the cache free/invalidate/fill
functionality.

- The Action_ExamineNext() function could omit the last directory
entry. Oops.
5 changes: 2 additions & 3 deletions source_code/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7474,7 +7474,6 @@ Action_ExamineNext(
struct LockNode * ln;
LONG result = DOSFALSE;
int error = OK;
int eof = FALSE;
LONG offset;

ENTER();
Expand Down Expand Up @@ -7529,7 +7528,7 @@ Action_ExamineNext(
SHOWMSG("calling 'smba_readdir'");
SHOWVALUE(offset);

smba_readdir(ln->ln_File,offset,fib,(smba_callback_t)dir_scan_callback_func_exnext,&eof,&error);
smba_readdir(ln->ln_File,offset,fib,(smba_callback_t)dir_scan_callback_func_exnext,NULL,&error);

if(error != OK)
{
Expand All @@ -7546,7 +7545,7 @@ Action_ExamineNext(
* returned all the entries available. There are no
* further entries to be delivered.
*/
if(eof || fib->fib_FileName[0] == '\0')
if(fib->fib_FileName[0] == '\0')
{
SHOWMSG("nothing to be read");
fib->fib_DiskKey = -1;
Expand Down
47 changes: 21 additions & 26 deletions source_code/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2645,24 +2645,24 @@ smb_proc_readdir_short (

LOG (("skipped entry; total_count = %ld, i = %ld, fpos = %ld\n", total_count, i, fpos));
}
else if (entry == NULL)
/* Was the cache invalidated, or there are no further
* cache entries to be filled?
*/
else if (entry == NULL || !dircache->is_valid)
{
result = total_count - fpos;

goto out;
}
else if (smb_decode_dirent (p, entry) == 0)
{
entry = get_next_dircache_entry(dircache);
}
else
{
if(smb_decode_dirent (p, entry) == 0)
{
entry = get_next_dircache_entry(dircache);
}
else
{
p += SMB_DIRINFO_SIZE;
p += SMB_DIRINFO_SIZE;

LOG (("skipped entry because name is too long; total_count = %ld, i = %ld, fpos = %ld\n", total_count, i, fpos));
}
LOG (("skipped entry because name is too long; total_count = %ld, i = %ld, fpos = %ld\n", total_count, i, fpos));
}

total_count += 1;
Expand Down Expand Up @@ -3325,18 +3325,11 @@ smb_proc_readdir_long (

LOG (("skipped entry; total_count = %ld, i = %ld, fpos = %ld\n", total_count, i, fpos));
}
else if (entry == NULL)
/* Did we run out of cache, or the cache was invalidated? */
else if (entry == NULL || !dircache->is_valid)
{
smb_decode_long_dirent (server, p, NULL, info_level, &entry_length);
if(entry_length == 0)
{
LOG (("no more entries available; stopping.\n"));
break;
}

LOG (("skipped entry; total_count = %ld, i = %ld, fpos = %ld\n", total_count, i, fpos));

continue;
LOG (("no more entries available; stopping.\n"));
break;
}
else
{
Expand Down Expand Up @@ -3725,13 +3718,15 @@ smb_proc_getattrE (struct smb_server *server, struct smb_dirent *entry, int * er
goto out;
}

entry->ctime = date_dos2unix (WVAL (buf, smb_vwv1), WVAL (buf, smb_vwv0));
entry->atime = date_dos2unix (WVAL (buf, smb_vwv3), WVAL (buf, smb_vwv2));
entry->mtime = date_dos2unix (WVAL (buf, smb_vwv5), WVAL (buf, smb_vwv4));
entry->wtime = entry->mtime;
entry->ctime = date_dos2unix (WVAL (buf, smb_vwv1), WVAL (buf, smb_vwv0));
entry->atime = date_dos2unix (WVAL (buf, smb_vwv3), WVAL (buf, smb_vwv2));
entry->mtime = date_dos2unix (WVAL (buf, smb_vwv5), WVAL (buf, smb_vwv4));
entry->wtime = entry->mtime;

entry->size_low = DVAL (buf, smb_vwv6);
entry->size_high = 0;
entry->attr = WVAL (buf, smb_vwv10);

entry->attr = WVAL (buf, smb_vwv10);

#if DEBUG
{
Expand Down
Loading

0 comments on commit 52aeb95

Please sign in to comment.