hamano / pysmbc

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

more of a question than an issue #18

Open zerstoeren opened 7 years ago

zerstoeren commented 7 years ago

I am wanting to use the debug information from smbc.Context in my code as part of research.

currently, i'm doing smbc.Context(debug=3) as it has the ability to provide some additional information regarding the SMB OID. any ideas how i might do this?

Thanks in advance.

dshepherd21 commented 6 years ago

Am operating at the edge of my knowledge level here. Is there anything specific we need to do to get this working against CIFS DFS ? The call fails with DFSPATH not covered. Any hints woul be appreciated.

zerstoeren commented 6 years ago

@dshepherd21 i also had trouble with CIFS using pysmbc, but had better success after i switched that section of code to the pysmb library. Maybe try that?

venkatg70 commented 5 years ago

We have observed that on some occasions, the ace flag is incorrectly returned by the pysmbc smbc.Context.getxattr. The NTFS report on that folder reads the folder as inherited True for all the entries for that folder, but the pysmbc reads flag value=3 for all those entries. We expect flag=19 for those entries from pysmbc. It seems like pysmbc is not reading the control flags which would give us unequivocal values for the flag. (windows internal inconsistency?). Is there anything I am missing?

### NTFS output for a folder

Allow","This folder, subfolders and files","True","S-1-5-21-1010966800-777871707-395339515-6909","Traverse Folder / Execute File, List Folder / Read Data, Read Attributes, Read Extended Attributes, Create Files / Write Data, Create Folders / Append Data, Write Attributes, Write Extended Attributes, Delete, Read Permissions"

Z:\Projects\0800670 - Keewatinohk Camp Bldgs\Combined cost codes","\Projects\0800670 - Keewatinohk Camp Bldgs\Combined cost codes","Group","PCLINC\Cor District Office Operations Systems","N/A","Allow","This folder, subfolders and files","True","S-1-5-21-1010966800-777871707-395339515-6907","Traverse Folder / Execute File, List Folder / Read Data, Read Attributes, Read Extended Attributes, Create Files / Write Data, Create Folders / Append Data, Write Attributes, Write Extended Attributes, Delete, Read Permissions"

"Z:\Projects\0800670 - Keewatinohk Camp Bldgs\Combined cost codes","\Projects\0800670 - Keewatinohk Camp Bldgs\Combined cost codes","Group","PCLINC\Domain Admins","N/A","Allow","This folder, subfolders and files","True","S-1-5-21-1010966800-777871707-395339515-512","Full Control, Traverse Folder / Execute File, List Folder / Read Data, Read Attributes, Read Extended Attributes, Create Files / Write Data, Create Folders / Append Data, Write Attributes, Write Extended Attributes, Delete Subfolders and Files, Delete, Read Permissions, Change Permissions, Take Ownership" "Z:\Projects\0800670 - Keewatinohk Camp Bldgs\Combined cost codes","\Projects\0800670 - Keewatinohk Camp Bldgs\Combined cost codes","Group","PCLINC\Win District Office All Users","N/A","Allow","This folder, subfolders and files","True","S-1-5-21-1010966800-777871707-395339515-2201","Traverse Folder / Execute File, List Folder / Read Data, Read Attributes, Read Extended Attributes, Create Files / Write Data, Create Folders / Append Data, Write Attributes, Write Extended Attributes, Delete, Read Permissions"

"Z:\Projects\0800670 - Keewatinohk Camp Bldgs\Combined cost codes","\Projects\0800670 - Keewatinohk Camp Bldgs\Combined cost codes","Group","PCLINC\Win District Office LAN Admins","N/A","Allow","This folder, subfolders and files","True","S-1-5-21-1010966800-777871707-395339515-11104","Full Control, Traverse Folder / Execute File, List Folder / Read Data, Read Attributes, Read Extended Attributes, Create Files / Write Data, Create Folders / Append Data, Write Attributes, Write Extended Attributes, Delete Subfolders and Files, Delete, Read Permissions, Change Permissions, Take Ownership"

"Z:\Projects\0800670 - Keewatinohk Camp Bldgs\Combined cost codes","\Projects\0800670 - Keewatinohk Camp Bldgs\Combined cost codes","Group","PCLINC\Win Region All Users","N/A","Allow","This folder, subfolders and files","True","S-1-5-21-1010966800-777871707-395339515-2197","Traverse Folder / Execute File, List Folder / Read Data, Read Attributes, Read Extended Attributes, Read Permissions"

### PYSMBC OUPUT of the call getxattr() REVISION:1,OWNER:S-1-5-21-1010966800-777871707-395339515-3627038,GROUP:S-1-5-21-1010966800-777871707-395339515-513,ACL:S-1-5-21-1010966800-777871707-395339515-2197:0/3/0x001200a9,ACL:S-1-5-21-1010966800-777871707-395339515-2201:0/3/0x001301bf,ACL:S-1-5-21-1010966800-777871707-395339515-6907:0/3/0x001301bf,ACL:S-1-5-21-1010966800-777871707-395339515-6909:0/3/0x001301bf,ACL:S-1-5-21-1010966800-777871707-395339515-512:0/3/0x001f01ff,ACL:S-1-5-21-1010966800-777871707-395339515-11104:0/3/0x001f01ff

anagda3 commented 1 year ago

Hi @hamano ,

I have one similar case. When I use smbcacls, I see detailed about control-bits.

smbcacls //server/folder sub-folder -U administrator%password

REVISION:1 CONTROL:SR|DI|DP OWNER:Administrators GROUP:WIN-USERS\None ACL:user:ALLOWED/OI|CI|I/CHANGE

However, when I use the getxattr method of the pysmbc lib, I don't see the control field in the response. Any comment on this?