1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

sort: enable custom behaviour on critical control

The sort module should simply return unsorted results when a sort is
unsupported but not critical. A similar custom behaviour should be
expected with VLV pagination when it is enabled.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Garming Sam 2016-03-10 15:25:44 +13:00 committed by Andrew Bartlett
parent a3ffac33f2
commit cd594a3cb3
2 changed files with 15 additions and 4 deletions

View File

@ -309,6 +309,8 @@ static int server_sort_search(struct ldb_module *module, struct ldb_request *req
}
}
control->critical = 0;
/* We are asked to sort on an attribute, and if that attribute is not
already in the search attributes we need to add it (and later
remove it on the return journey).

View File

@ -701,11 +701,20 @@ static int rootdse_filter_controls(struct ldb_module *module, struct ldb_request
continue;
}
/* If the control is DIRSYNC control then we keep the critical
* flag as the dirsync module will need to act upon it
/*
* If the control is DIRSYNC, SORT or VLV then we keep the
* critical flag as the modules will need to act upon it.
*
* These modules have to unset the critical flag after the
* request has been seen by the correct module.
*/
if (is_registered && strcmp(req->controls[i]->oid,
LDB_CONTROL_DIRSYNC_OID)!= 0) {
if (is_registered &&
strcmp(req->controls[i]->oid,
LDB_CONTROL_DIRSYNC_OID) != 0 &&
strcmp(req->controls[i]->oid,
LDB_CONTROL_VLV_REQ_OID) != 0 &&
strcmp(req->controls[i]->oid,
LDB_CONTROL_SERVER_SORT_OID) != 0) {
req->controls[i]->critical = 0;
}
}