Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ldap3.protocol.microsoft.ntSecurityDescriptorControl returns a list not a ldap3.protocol.rfc4511.Control #1165

Open
Djarid opened this issue Dec 19, 2024 · 0 comments

Comments

@Djarid
Copy link

Djarid commented Dec 19, 2024

In ldap3/protocol/microsoft.py line 136

def security_descriptor_control(criticality=False, sdflags=0x0F):
    sdcontrol = SdFlags()
    sdcontrol.setComponentByName('Flags', sdflags)
    return [build_control('1.2.840.113556.1.4.801', criticality, sdcontrol)]

returns a list with a single ldap search control while the other control functions return a ldap3.protocol.rfc4511.Control

Can we change this to return a single control to ensure that the concumer gets a Control as expected and not a list?

Also the default for the criticality argument is False given that the ntSecurityDescriptorControl MUST have a criticality of 'True' this is a nonsensical default.

Therefore can this function (which has no internal references) be changed to

def security_descriptor_control(criticality=True, sdflags=0x0F):
    sdcontrol = SdFlags()
    sdcontrol.setComponentByName('Flags', sdflags)
    return build_control('1.2.840.113556.1.4.801', criticality, sdcontrol)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant