samba.smb.SMB:set_acl seems to generate a bad nttrans:SET_SD request

Richard Sharpe realrichardsharpe at
Sun Mar 25 08:22:39 MDT 2012

Hi folks,

I was playing with set_acl and was getting:

     RuntimeError: (-1073741811, 'Unexpected information received')

When I look at the on-the-wire traffic I see that the SD is there but
that the Security Info field is zero.

So, then I looked at source4/libcli/pysmb.c and see this:

        fio.set_secdesc.level = RAW_SFILEINFO_SEC_DESC; = fnum; = 0; = sd;

        status = smb_raw_set_secdesc(spdata->tree, &fio);

It seems that we are setting the seconfo to 0. Perhaps we should be
passing secinfo into set_acl, or perhaps it should scan the SD, or
maybe I am just doing something wrong.

Here is the code I am using:

    if sd_sddl.find("S-1-3-4") < 0:
        sd_sddl = sd_sddl + "(A;OICIIO;0x00060000;;;S-1-3-4)"

        root_sd = security.descriptor.from_sddl(sd_sddl,
        print "New SD: ", root_sd.as_sddl()

        conn.set_acl("\\", root_sd)

Richard Sharpe

More information about the samba-technical mailing list