From: Matthieu Patou Date: Tue, 1 Nov 2011 22:12:47 +0000 (+0100) Subject: s4-ldb: Add isRecycled when is defined in the schema X-Git-Url: http://git.samba.org/?p=mat%2Fsamba.git;a=commitdiff_plain;h=4b09ea5cc3def5e1917f576bcaa4c7317fd7b49f s4-ldb: Add isRecycled when is defined in the schema Signed-off-by: Stefan Metzmacher --- diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index eb5d036e62..daca5da5bb 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -3008,9 +3008,15 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req) case OBJECT_RECYCLED: case OBJECT_TOMBSTONE: - /* we also mark it as recycled, meaning this object can't be - recovered (we are stripping its attributes) */ - if (functional_level >= DS_DOMAIN_FUNCTION_2008_R2) { + /* + * we also mark it as recycled, meaning this object can't be + * recovered (we are stripping its attributes). + * This is done only if we have this schema object of course ... + * This behavior is identical to the one of Windows 2008R2 which + * always set the isRecycled attribute, even if the recycle-bin is + * not activated and what ever the forest level is. + */ + if (dsdb_attribute_by_lDAPDisplayName(schema, "isRecycled") != NULL) { ret = ldb_msg_add_string(msg, "isRecycled", "TRUE"); if (ret != LDB_SUCCESS) { DEBUG(0,(__location__ ": Failed to add isRecycled string to the msg\n"));