jborean93 / smbprotocol

Python SMBv2 and v3 Client
MIT License
318 stars 73 forks source link

Add missing FileAttributes #151

Closed MWedl closed 2 years ago

MWedl commented 2 years ago

Hi,

I have added new flags to FileAttributes from 2.6 File Attributes. The missing flag definitions prevented parsing responses with such flags set.

I also suggest to make FileAttributes a non-strict flag (flag_strict=False). In case more flags are added in the future, they should be ignored and not prevent parsing responses. This is similar to how file systems handle unknown flags:

Note: File systems silently ignore any attribute that is not supported by that file system. Unsupported attributes MUST NOT be persisted on the media. It is recommended that unsupported attributes be masked off when encountered.

codecov[bot] commented 2 years ago

Codecov Report

Merging #151 (f9e1217) into master (b303235) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #151   +/-   ##
=======================================
  Coverage   99.09%   99.09%           
=======================================
  Files          23       23           
  Lines        5059     5063    +4     
=======================================
+ Hits         5013     5017    +4     
  Misses         46       46           
Flag Coverage Δ
macOS 68.22% <100.00%> (+0.02%) :arrow_up:
py3.10 99.07% <100.00%> (+<0.01%) :arrow_up:
py3.6 99.07% <100.00%> (+<0.01%) :arrow_up:
py3.7 99.07% <100.00%> (+<0.01%) :arrow_up:
py3.8 99.07% <100.00%> (+<0.01%) :arrow_up:
py3.9 99.09% <100.00%> (+<0.01%) :arrow_up:
ubuntu 96.77% <100.00%> (+<0.01%) :arrow_up:
windows 99.00% <100.00%> (+<0.01%) :arrow_up:
x64 99.09% <100.00%> (+<0.01%) :arrow_up:
x86 99.00% <100.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
smbprotocol/open.py 100.00% <ø> (ø)
smbprotocol/file_info.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b303235...f9e1217. Read the comment docs.

jborean93 commented 2 years ago

I also suggest to make FileAttributes a non-strict flag (flag_strict=False). In case more flags are added in the future, they should be ignored and not prevent parsing responses

Yep that makes sense to me, thanks for fixing this.