Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requested_oplock invalid value for 2.0.2 dialect #145

Open
bulkans opened this issue Feb 12, 2019 · 2 comments
Open

requested_oplock invalid value for 2.0.2 dialect #145

bulkans opened this issue Feb 12, 2019 · 2 comments
Labels

Comments

@bulkans
Copy link

bulkans commented Feb 12, 2019

in lib/ruby_smb/smb2/tree.rb line:94 create_request.requested_oplock = 0xff

requested_oplock is hardcoded to 0xff, but according to MSDN documentation this value is not valid for 2.0.2 dialect:

" SMB2_OPLOCK_LEVEL_LEASE 0xFF | A lease is requested. If set, the request packet MUST contain an SMB2_CREATE_REQUEST_LEASE (section 2.2.13.2.8) create context. This value is not valid for the SMB 2.0.2 dialect. "

https://msdn.microsoft.com/en-us/library/cc246502.aspx

This leads to error, when sending "request" to the server which complies with MSDN documentation.

@busterb
Copy link
Contributor

busterb commented Mar 12, 2019

What would you recommend changing it to? 0x8 or 0x1 ?

@cdelafuente-r7
Copy link
Contributor

Absolutely, I think it is wrong to set requested_oplock to 0xFF for any SMB dialect at this point. It requires a SMB2_CREATE_REQUEST_LEASE create-context structure and it is not implemented yet. Even if I've never seen any failure with Windows or Samba SMB servers, I would suggest to leave it to 0x00 for now.

Also, this comes from this commit: 9d41a67. Apparently, it is related to issues with very small files. This will need to be tested with that in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants