Comments (7)
Hi, Vinod.
According to the MS-SMB2 protocol specs, page 314, "<57> Section 2.2.33: Windows-based servers do not support resuming an enumeration at a specified FileIndex. The server will ignore this flag."
In addition, the interpretation of the FileIndex field is not exactly what you have implemented; it does not refer to the entry offset. Instead, the value must be from the FileIndex field in a previous listing response (see MS-FSCC, section 2.4.8). So, you will end up having to enumerate the entire directory listing from the beginning.
Hope this helps you in the debugging.
Michael
from pysmb.
Thanks Michael. The explanation and PDFs were helpful. Seeing as Windows-based servers ignore the flag, I'll hold off on implementing this at the current time and perhaps revisit it in the future.
from pysmb.
Hi Michael. It appears this restriction is no longer in place in the current docs on product behavior: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/a64e55aa-1152-48e4-8206-edd96444e7f7
Does it make sense to implement FileIndex support for enumeration now? I'm curious as to the best approach for this, and whether you had one in mind.
from pysmb.
A server which does not implement enumeration means your client needs to handle all the returned values in one single request-response. This may not be ideal if your client were to run in embedded devices where memory and processing power could be limited.
With that being said, it is not easy to implement an accurate enumeration of a directory as the contents of the directory could be changing rapidly on a busy machine. It is similar to doing a SELECT with LIMIT/OFFSET on a busy database table; the returned rows could be repeated or missed out.
I didn't really do much testing on this enumeration feature, but other services like Samba might choose to implement enumeration.
from pysmb.
That makes sense. The documentation does appear to indicate support for it in some of the newer Windows server versions, and Samba. Do you have plans to add support for this feature to pysmb to allow optional enumeration?
from pysmb.
Currently, pysmb repeats the QUERY_DIRECTORY request again on the same fid until it receives STATUS_NO_MORE_FILES response from the server. Apparently, it achieves the same effect as enumeration.
from pysmb.
Alright; glad to hear.
from pysmb.
Related Issues (20)
- Cant connect w/ smb on mac os, python 3.8 HOT 6
- Can't get file list on DFS shared folder HOT 6
- listPath fails with "STATUS_ACCESS_DENIED" due to too broad access mask HOT 2
- pysmb-provided MD4 implementation for Python3 is broken HOT 6
- ThreadPoolExecutor storeFile HOT 1
- Using same code in Windows and Linux to access remote paths HOT 2
- Problem performing listPath using SMB1 with version 1.2.8 (similar to issue #195)
- Server does not support any of the pysmb dialects HOT 2
- When are compressed transfers supported?
- Unable to install the latest version of pysmb(1.2.9) HOT 7
- TypeError: can't concat str to bytes HOT 2
- How to improve transfer speed
- Server does not support any of the pysmb dialects. Please email pysmb to add in support for your OS HOT 1
- Copy a file using pysmb from windows to linux HOT 8
- Don't connect to SMBv2 server HOT 5
- Provide wheel distributions
- Using Chunk? HOT 5
- Request to Update Documentation for SMBConnection Class HOT 4
- storeFile raise SMBTimeout exception on files > 1k HOT 2
- Compatibility Issue with Unraid SMB Server: Unable to Negotiate Supported SMB Dialect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysmb.