[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-1169-g61ca4c4

Andrew Tridgell tridge at samba.org
Tue Aug 25 01:01:15 MDT 2009


The branch, master has been updated
       via  61ca4c491e1c13eb7d97847f743b0f540f1117c4 (commit)
       via  3c7cbd60e5a63496a523086fdfcf5c43301e78f7 (commit)
      from  436d8b6e06c555b2f3dabad8218f08b713e7664c (commit)

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


- Log -----------------------------------------------------------------
commit 61ca4c491e1c13eb7d97847f743b0f540f1117c4
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Aug 25 17:00:27 2009 +1000

    fixed DRS rename of deleted objects
    
    The objectclass module checks that the target parent exists, and
    refuses renames if it doesn't exist. For this to work for deleted
    objects we have to do the search in the objectclass module with the
    "show deleted" control enabled.

commit 3c7cbd60e5a63496a523086fdfcf5c43301e78f7
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Aug 25 16:59:25 2009 +1000

    fixed a double free bug on error in net export

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

Summary of changes:
 source4/dsdb/samdb/ldb_modules/objectclass.c |   21 ++++++++++++++++++++-
 source4/kdc/hdb-samba4.c                     |    1 -
 2 files changed, 20 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c
index 4f01370..eb35ad0 100644
--- a/source4/dsdb/samdb/ldb_modules/objectclass.c
+++ b/source4/dsdb/samdb/ldb_modules/objectclass.c
@@ -997,6 +997,7 @@ static int objectclass_rename(struct ldb_module *module, struct ldb_request *req
 	struct oc_context *ac;
 	struct ldb_dn *parent_dn;
 	int ret;
+	struct ldb_control **ctrl;
 
 	ldb = ldb_module_get_ctx(module);
 
@@ -1025,12 +1026,30 @@ static int objectclass_rename(struct ldb_module *module, struct ldb_request *req
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
 
+	/* we have to add the show deleted control, as otherwise DRS
+	   deletes will be refused as we will think the target parent
+	   does not exist */
+	ctrl = talloc_array(req, struct ldb_control, 2);
+	if (!ctrl) {
+		ldb_oom(ldb);
+		return LDB_ERR_OPERATIONS_ERROR;
+	}
+	ctrl[0] = talloc(ctrl, struct ldb_control);
+	if (!ctrl[0]) {
+		ldb_oom(ldb);
+		return LDB_ERR_OPERATIONS_ERROR;
+	}
+	ctrl[0]->oid = LDB_CONTROL_SHOW_DELETED_OID;
+	ctrl[0]->critical = 0;
+	ctrl[0]->data = NULL;
+	ctrl[1] = NULL;
+
 	/* note that the results of this search are kept and used to
 	   update the parentGUID in objectclass_rename_callback() */
 	ret = ldb_build_search_req(&search_req, ldb,
 				   ac, parent_dn, LDB_SCOPE_BASE,
 				   "(objectClass=*)",
-				   attrs, NULL, 
+				   attrs, ctrl, 
 				   ac, get_search_callback,
 				   req);
 	if (ret != LDB_SUCCESS) {
diff --git a/source4/kdc/hdb-samba4.c b/source4/kdc/hdb-samba4.c
index d782254..502b4e0 100644
--- a/source4/kdc/hdb-samba4.c
+++ b/source4/kdc/hdb-samba4.c
@@ -1348,7 +1348,6 @@ static krb5_error_code hdb_samba4_seq(krb5_context context, HDB *db, unsigned fl
 	}
 
 	if (ret != 0) {
-		talloc_free(priv);
 		db->hdb_dbc = NULL;
 	} else {
 		talloc_free(mem_ctx);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list