[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1253-g90cc5e7

Jelmer Vernooij jelmer at samba.org
Thu Apr 23 16:23:24 GMT 2009


The branch, master has been updated
       via  90cc5e72ba0cf4b5261be2f2aa9db87bd011fbb0 (commit)
      from  3cf48ee05ae99fb99d1b7b7204f9b8c444907a4a (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 90cc5e72ba0cf4b5261be2f2aa9db87bd011fbb0
Author: nadezhda ivanova <nivanova at ved.salsa.postpath.local>
Date:   Thu Apr 23 17:18:23 2009 +0300

    Fix of a bug in the security.descriptor.as_sddl() method
    
    security.descriptor.as_sddl() method did not work correctly when invoked without
    supplying the domain sid. Returned the same value as when the sid was provided.
    Test added for this case in  libcli/security/tests/bindings.py
    
    Signed-off-by: Jelmer Vernooij <jelmer at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source4/libcli/security/tests/bindings.py |    6 ++++++
 source4/librpc/ndr/py_security.c          |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/libcli/security/tests/bindings.py b/source4/libcli/security/tests/bindings.py
index 5c15305..f0d55f1 100644
--- a/source4/libcli/security/tests/bindings.py
+++ b/source4/libcli/security/tests/bindings.py
@@ -77,6 +77,12 @@ class SecurityDescriptorTests(unittest.TestCase):
         self.assertEquals(desc1.sacl, desc2.sacl)
         self.assertEquals(desc1.type, desc2.type)
 
+    def test_domsid_nodomsid_as_sddl(self):
+        dom = security.dom_sid("S-2-0-0")
+        text = "O:AOG:DAD:(A;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)"
+        desc1 = security.descriptor.from_sddl(text, dom)
+        self.assertNotEqual(desc1.as_sddl(), desc1.as_sddl(dom))
+
 
 class DomSidTests(unittest.TestCase):
     def test_parse_sid(self):
diff --git a/source4/librpc/ndr/py_security.c b/source4/librpc/ndr/py_security.c
index 43c1d50..1b54aab 100644
--- a/source4/librpc/ndr/py_security.c
+++ b/source4/librpc/ndr/py_security.c
@@ -198,7 +198,7 @@ static PyObject *py_descriptor_as_sddl(PyObject *self, PyObject *args)
 	if (!PyArg_ParseTuple(args, "|O", &py_sid))
 		return NULL;
 
-	if (py_sid == Py_None)
+	if (py_sid != Py_None)
 		sid = py_talloc_get_ptr(py_sid);
 	else
 		sid = NULL;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list