hamano / pysmbc

libsmbclient binding for Python
http://pypi.python.org/pypi/pysmbc
GNU General Public License v2.0
28 stars 27 forks source link

getxattr() fails to retrieve the ACLs for SMB Azure File Share #65

Open parthsompura opened 9 months ago

parthsompura commented 9 months ago

Hi Team,

We are trying to use pysmbc for getting meta-data of SMB Azure File Share and it's able to hit the opendir() call to retrieve the children but failed with RuntimeError: (61, 'No data available') when tried hitting getxattr() requesting the file/folder ACLs

>>> import smbc
>>> context = smbc.Context()
>>> cb = lambda se, sh, w, u, p: (domain_name, azure_file_share_name, azure_file_share_access_key)
>>> context.opendir("smb://AZURE_FILE_SHARE_PATH").getdents()
[<smbc.Dirent object "." (Dir) at 0x7fe36920eb50>, <smbc.Dirent object ".." (Dir) at 0x7fe36920ee20>, <smbc.Dirent object "Tmp" (Dir) at 0x7fe3645ebe40>]
>>> context.getxattr("smb://AZURE_FILE_SHARE_PATH", smbc.XATTR_ALL)
cli_nt_session_open fail!
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: (61, 'No data available')

I increased the debug-level to 5, and compare it with smbcacls debug logs, but the ultimate result was the same. cli_nt_session_open fail in pysmbc

We are able to retrieve the ACLs for the SMB Azure File Share using smbcacls so ideally we should be able to achieve the same using pysmbc hence To DEBUG further, we have captured the TCPdump and noticed that we couldn't notice any SEC_INFO (to fetch ACL info) calls in pysmbc tcpdumps. We only see the FS_INFO call, which retrieves file/folder details.

cc: @debjit-bhattacharjee @anagda3