From 6f71071381ead9976f4a6d296c9a1ade385484e0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 29 Nov 2012 09:57:44 +0100 Subject: 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 Reviewed-by: Michael Adam --- source4/scripting/python/samba/ntacls.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source4/scripting/python/samba/ntacls.py b/source4/scripting/python/samba/ntacls.py index d86c5171b3..b89e9e9480 100644 --- a/source4/scripting/python/samba/ntacls.py +++ b/source4/scripting/python/samba/ntacls.py @@ -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) -- cgit