summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2016-07-13 13:29:19 +1200
committerGarming Sam <garming@samba.org>2016-07-15 10:01:29 +0200
commit31ffe971785333d6afb4885aba41d8be29c6e0e5 (patch)
treecd499284068af1a8ef1dc0761c6be9017f1b2aa5 /source4
parent00e828a8a8bf56b93fe650faaa9652081ebd27f7 (diff)
downloadsamba-31ffe971785333d6afb4885aba41d8be29c6e0e5.tar.gz
extended_dn_out: Force showing of one-way links if they exist
Signed-off-by: Garming Sam <garming@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/extended_dn_out.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
index 31835a73d29..d29a50ce053 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
@@ -325,7 +325,8 @@ struct extended_search_context {
renames of the target
*/
static int fix_one_way_link(struct extended_search_context *ac, struct ldb_dn *dn,
- bool is_deleted_objects, bool *remove_value)
+ bool is_deleted_objects, bool *remove_value,
+ uint32_t linkID)
{
struct GUID guid;
NTSTATUS status;
@@ -348,9 +349,9 @@ static int fix_one_way_link(struct extended_search_context *ac, struct ldb_dn *d
search_flags = DSDB_FLAG_NEXT_MODULE | DSDB_SEARCH_SEARCH_ALL_PARTITIONS | DSDB_SEARCH_ONE_ONLY;
- if (ldb_request_get_control(ac->req, LDB_CONTROL_SHOW_DEACTIVATED_LINK_OID) ||
- is_deleted_objects) {
- search_flags |= DSDB_SEARCH_SHOW_DELETED;
+ if (linkID == 0) {
+ /* You must ALWAYS show one-way links regardless of the state of the target */
+ search_flags |= (DSDB_SEARCH_SHOW_DELETED | DSDB_SEARCH_SHOW_RECYCLED);
}
ret = dsdb_module_search(ac->module, tmp_ctx, &res, NULL, LDB_SCOPE_SUBTREE, attrs,
@@ -611,7 +612,8 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares,
if (attribute->one_way_link &&
strcasecmp(attribute->lDAPDisplayName, "objectCategory") != 0) {
bool remove_value;
- ret = fix_one_way_link(ac, dn, is_deleted_objects, &remove_value);
+ ret = fix_one_way_link(ac, dn, is_deleted_objects, &remove_value,
+ attribute->linkID);
if (ret != LDB_SUCCESS) {
talloc_free(dsdb_dn);
return ldb_module_done(ac->req, NULL, NULL, ret);