s4-tools: Fixed a bug in ldapcmp - DACL was not retrieved correctly if the object...
[idra/samba.git] / source4 / scripting / python / samba / netcmd / ldapcmp.py
index d62b5544242776c13f44d4f9ea53ed27aabc264c..1cde860fb10da205a3e71ce1a1bbfe7291e86cd1 100755 (executable)
@@ -216,7 +216,10 @@ class Descriptor(object):
         """ Extracts the DACL as a list of ACE string (with the brakets).
         """
         try:
-            res = re.search("D:(.*?)(\(.*?\))S:", self.sddl).group(2)
+            if "S:" in self.sddl:
+                res = re.search("D:(.*?)(\(.*?\))S:", self.sddl).group(2)
+            else:
+                res = re.search("D:(.*?)(\(.*\))", self.sddl).group(2)
         except AttributeError:
             return []
         return re.findall("(\(.*?\))", res)