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:
parent
a3ffac33f2
commit
cd594a3cb3
@ -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).
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user