python bindings api

Brett A. Funderburg brettf at deepfile.com
Wed May 21 22:44:13 GMT 2003


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






More information about the samba-technical mailing list