I'm trying to understand the python binding api in the samba-3.0alpha24 snapshot. In trying to get the security descriptor of a file, I have the following bit of code: from samba import smb creds = {...} # domain,username,password cnn = smb.connect("svr1") cnn.session_request("svr1") cnn.negprot() cnn.session_setup(creds) cnn.tconx("c$") fnum = cnn.nt_create_andx("boot.ini", FLAGS) # FLAGS = 1 secdesc = cnn.query_secdesc(fnum) Which raises the error: prs_mem_get: reading data of size 2 would overrun buffer. Failed to parse secdesc Traceback (most recent call last): File "<stdin>", line 1, in ? RuntimeError: query_secdesc failed - What are the valid values for FLAGS in the nt_create_andx api? - Why does 'query_secdesc' fail with a RuntimeError? - Am I using the api correctly; is this the correct order to call the api for querying the secdesc of a file? The example code doesn't help much in this regard. Thanks, brett
On Wed, May 21, 2003 at 05:48:11PM -0500, Brett A. Funderburg wrote: [...]> secdesc = cnn.query_secdesc(fnum) > > Which raises the error: > > prs_mem_get: reading data of size 2 would overrun buffer. > Failed to parse secdesc > Traceback (most recent call last): > File "<stdin>", line 1, in ? > RuntimeError: query_secdesc failedThis looks like a problem in Samba's unmarshalling of security descriptors. I'd be interested in seeing a debug level 10 log of what is happening here. Add 'debug level = 10' to your smb.conf file to get this.> - What are the valid values for FLAGS in the nt_create_andx api?There are several places to look for this information. The CIFS technical reference document at: http://www.snia.org/tech_activities/CIFS/CIFS-TR-1p00_FINAL.pdf or the source for Samba, or the source for ethereal. I'm afraid the protocol isn't terribly well documented. Your best bet would be the Samba code.> - Why does 'query_secdesc' fail with a RuntimeError?Probably a bug in Samba.> - Am I using the api correctly; is this the correct order to call the > api for querying the secdesc of a file?I think your code above is correct.> The example code doesn't help much in this regard.As an historical note, the python smb module is more of an experiment that anything particularly useful at the moment. I was initially using it to write some tests for a security descriptor project I was working on. I've only implemented the bare minimum number of calls required to get and set security descriptors on a file share. Tim.