[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Mon Jun 7 04:00:31 MDT 2010


The branch, master has been updated
       via  e206109... s4:ldb python bindings - implement comparison on Python LDB Message objects
       via  315aeef... s4: Remove an uselessly exposed control
      from  e271a2b... s4-smbtorture: handle printservers w/o printers in RPC-SPOOLSS-ACCESS.

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


- Log -----------------------------------------------------------------
commit e2061095b52a198fa221d190117dcebbb63058e6
Author: Matthieu Patou <mat at matws.net>
Date:   Fri May 7 04:15:28 2010 +0400

    s4:ldb python bindings - implement comparison on Python LDB Message objects
    
    Coauthors: Jelmer Vernooij, Matthias Dieter Wallnöfer

commit 315aeef0f9fa20a4628783241f90dbeacf0b6dc4
Author: Matthieu Patou <mat at matws.net>
Date:   Sat Jun 5 19:25:18 2010 +0400

    s4: Remove an uselessly exposed control

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

Summary of changes:
 source4/lib/ldb/pyldb.c             |   40 +++++++++++++++++++++++++++++++++-
 source4/libcli/ldap/ldap_controls.c |    1 -
 2 files changed, 38 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index fd7584d..bbb2e71 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -5,8 +5,8 @@
 
    Copyright (C) 2005,2006 Tim Potter <tpot at samba.org>
    Copyright (C) 2006 Simo Sorce <idra at samba.org>
-   Copyright (C) 2007-2009 Jelmer Vernooij <jelmer at samba.org>
-   Copyright (C) 2009 Matthias Dieter Wallnöfer
+   Copyright (C) 2007-2010 Jelmer Vernooij <jelmer at samba.org>
+   Copyright (C) 2009-2010 Matthias Dieter Wallnöfer
 
 	 ** NOTE! The following LGPL license applies to the ldb
 	 ** library. This does NOT imply that all of Samba is released
@@ -2079,6 +2079,41 @@ static void py_ldb_msg_dealloc(PyLdbMessageObject *self)
 	self->ob_type->tp_free(self);
 }
 
+static int py_ldb_msg_compare(PyLdbMessageObject *py_msg1,
+			      PyLdbMessageObject *py_msg2)
+{
+	struct ldb_message *msg1 = PyLdbMessage_AsMessage(py_msg1),
+			   *msg2 = PyLdbMessage_AsMessage(py_msg2);
+	unsigned int i;
+	int ret;
+
+	ret = ldb_dn_compare(msg1->dn, msg2->dn);
+	if (ret != 0) {
+		return ret;
+	}
+
+	ret = msg1->num_elements - msg2->num_elements;
+	if (ret != 0) {
+		return ret;
+	}
+
+	for (i = 0; i < msg1->num_elements; i++) {
+		ret = ldb_msg_element_compare_name(&msg1->elements[i],
+						   &msg2->elements[i]);
+		if (ret != 0) {
+			return ret;
+		}
+
+		ret = ldb_msg_element_compare(&msg1->elements[i],
+					      &msg2->elements[i]);
+		if (ret != 0) {
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
 PyTypeObject PyLdbMessage = {
 	.tp_name = "ldb.Message",
 	.tp_methods = py_ldb_msg_methods,
@@ -2090,6 +2125,7 @@ PyTypeObject PyLdbMessage = {
 	.tp_repr = (reprfunc)py_ldb_msg_repr,
 	.tp_flags = Py_TPFLAGS_DEFAULT,
 	.tp_iter = (getiterfunc)py_ldb_msg_iter,
+	.tp_compare = (cmpfunc)py_ldb_msg_compare,
 };
 
 PyObject *PyLdbTree_FromTree(struct ldb_parse_tree *tree)
diff --git a/source4/libcli/ldap/ldap_controls.c b/source4/libcli/ldap/ldap_controls.c
index b0c024a..40ce50f 100644
--- a/source4/libcli/ldap/ldap_controls.c
+++ b/source4/libcli/ldap/ldap_controls.c
@@ -1315,7 +1315,6 @@ static const struct ldap_control_handler ldap_known_controls[] = {
 	{ "1.3.6.1.4.1.7165.4.3.7", NULL, NULL },
 /* DSDB_EXTENDED_REPLICATED_OBJECTS_OID is internal only, and has no network representation */
 	{ "1.3.6.1.4.1.7165.4.4.1", NULL, NULL },
-	{ LDB_CONTROL_RECALCULATE_SD_OID,  decode_recalculate_sd_request, encode_recalculate_sd_request},
 	{ DSDB_OPENLDAP_DEREFERENCE_CONTROL, decode_openldap_dereference, encode_openldap_dereference},
 	{ LDB_CONTROL_RELAX_OID, decode_relax_request, encode_relax_request },
 	{ NULL, NULL, NULL }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list