1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

s4:python/ntacl: add 'as_sddl' option to dsacl2fsacl()

This allows the caller to ask for a security.descriptor instead of sddl
by passing 'as_sddl=False'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Stefan Metzmacher 2012-11-29 09:57:44 +01:00
parent 06f026368e
commit 6f71071381

View File

@ -209,7 +209,7 @@ def ldapmask2filemask(ldm):
return filemask
def dsacl2fsacl(dssddl, sid):
def dsacl2fsacl(dssddl, sid, as_sddl=True):
"""
This function takes an the SDDL representation of a DS
@ -234,4 +234,7 @@ def dsacl2fsacl(dssddl, sid):
ace.access_mask = ldapmask2filemask(ace.access_mask)
fdescr.dacl_add(ace)
if not as_sddl:
return fdescr
return fdescr.as_sddl(sid)