Updated to version 2.21

Added more diagnostic output and debug functionality, e.g. regarding how many directory caches are currently being used.

Long name directory scanning is a bit more paranoid when retrying a scan operation which might have been triggered by the server connection getting dropped.

Added the new READONLY option (why stop at 47 options when you can have 48?) which makes the file system read-only by default and does not require you to use the "Lock" shell command to achieve the same effect. Note that the shell "Lock" command cannot be used to turn the read-only mode off again.

Added support for the smb:// URI scheme, which means that instead of using "smbfs username=barney password=secret domain=workgroup //nas:445/share" you can now use "smbfs smb://workgroup;barney:secret@nas:445/share" instead. It is a bit shorter than the alternative and has an advantage in allowing you to reuse smb:// URLs which you know work well on other systems.
This commit is contained in:
obarthel
2019-03-09 11:04:33 +01:00
parent 561ca54b8f
commit 3220d73438
29 changed files with 957 additions and 111 deletions
+28 -6
View File
@@ -2643,6 +2643,8 @@ smb_proc_readdir_short (
if (count == 0)
break;
ASSERT( count <= entries_asked );
ASSERT (bcc == count * SMB_DIRINFO_SIZE + 3);
if (bcc != count * SMB_DIRINFO_SIZE + 3)
@@ -2665,7 +2667,7 @@ smb_proc_readdir_short (
p = smb_decode_word (p, &datalength);
if(datalength != 43 * count)
if(datalength != SMB_DIRINFO_SIZE * count)
{
D(("data length (%ld) does not match expected size (%ld)", datalength, count * SMB_DIRINFO_SIZE));
@@ -2682,6 +2684,11 @@ smb_proc_readdir_short (
entry = get_next_dircache_entry(dircache);
ASSERT( entry == NULL || i+1 == count );
if(entry == NULL && i+1 < count)
SHOWMSG("ran out of directory cache entries, which should never happen...");
total_count++;
}
@@ -3058,7 +3065,7 @@ smb_proc_readdir_long (
int ff_searchcount;
int ff_end_of_search = 0;
int ff_dir_handle = 0;
int ff_dir_handle = -1;
int ff_resume_key = 0;
int loop_count = 0;
@@ -3115,6 +3122,9 @@ smb_proc_readdir_long (
{
is_first = TRUE;
ff_dir_handle = -1;
ff_resume_key = 0;
SHOWMSG("start scanning from the top");
}
else
@@ -3258,6 +3268,8 @@ smb_proc_readdir_long (
}
/* Bail out if this is empty. */
ASSERT( resp_param != NULL );
if (resp_param == NULL)
{
SHOWMSG("no response parameters to process; stopping the search for now");
@@ -3269,6 +3281,8 @@ smb_proc_readdir_long (
if (is_first)
{
ASSERT( resp_param_len >= 6 );
if(resp_param_len < 6)
{
SHOWMSG("not enough response parameter data to process; stopping the search for now");
@@ -3286,6 +3300,8 @@ smb_proc_readdir_long (
}
else
{
ASSERT( resp_param_len >= 4 );
if(resp_param_len < 4)
{
SHOWMSG("not enough response parameter data to process; stopping the search for now");
@@ -3296,6 +3312,8 @@ smb_proc_readdir_long (
ff_end_of_search = WVAL (p, 2);
}
ASSERT( ff_searchcount <= max_matches );
D(("received %ld entries (end of search = %s)",ff_searchcount, ff_end_of_search ? "yes" : "no"));
if (ff_searchcount == 0)
@@ -3305,17 +3323,16 @@ smb_proc_readdir_long (
}
/* Bail out if this is empty. */
ASSERT( resp_data != NULL );
if (resp_data == NULL)
{
SHOWMSG("no directory data to process; stopping the search for now");
break;
}
/* point to the data bytes */
p = resp_data;
/* Now we are ready to parse smb directory entries. */
for (i = 0, entry_length = 0 ;
for (i = 0, p = resp_data, entry_length = 0 ;
i < ff_searchcount && entry != NULL && p < &resp_data[resp_data_len];
i++, p += entry_length)
{
@@ -3341,6 +3358,11 @@ smb_proc_readdir_long (
entry = get_next_dircache_entry(dircache);
ASSERT( entry != NULL || i+1 == ff_searchcount );
if(entry == NULL && i+1 < ff_searchcount)
SHOWMSG("ran out of directory cache entries, which should never happen...");
total_count++;
}