summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2017-02-28 14:15:12 +1300
committerAndrew Bartlett <abartlet@samba.org>2017-06-10 21:48:20 +0200
commitfa3c026983d597769f600e50b7e2b0e8772f3fd6 (patch)
tree0bf672a2625109d78dbe7e938b6b472cd3b0e314 /python
parente7bc97433377daaf9cb8fde7fdea79f5848ec535 (diff)
downloadsamba-fa3c026983d597769f600e50b7e2b0e8772f3fd6.tar.gz
python: Allow sd_utils to take a Dn object, not just a string DN
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'python')
-rw-r--r--python/samba/sd_utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/samba/sd_utils.py b/python/samba/sd_utils.py
index 7592a2982a4..568829f9c36 100644
--- a/python/samba/sd_utils.py
+++ b/python/samba/sd_utils.py
@@ -37,7 +37,11 @@ class SDUtils(object):
or security.descriptor object
"""
m = Message()
- m.dn = Dn(self.ldb, object_dn)
+ if isinstance(object_dn, Dn):
+ m.dn = object_dn
+ else:
+ m.dn = Dn(self.ldb, object_dn)
+
assert(isinstance(sd, str) or isinstance(sd, security.descriptor))
if isinstance(sd, str):
tmp_desc = security.descriptor.from_sddl(sd, self.domain_sid)