If the AS_SYSTEM control is present, we know we have system privileges,
and have no need to call dsdb_module_am_system().
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15270
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
int ret;
struct aclread_context *ac;
struct ldb_request *down_req;
int ret;
struct aclread_context *ac;
struct ldb_request *down_req;
- struct ldb_control *as_system = ldb_request_get_control(req, LDB_CONTROL_AS_SYSTEM_OID);
struct ldb_result *res;
struct aclread_private *p;
bool need_sd = false;
struct ldb_result *res;
struct aclread_private *p;
bool need_sd = false;
ldb = ldb_module_get_ctx(module);
p = talloc_get_type(ldb_module_get_private(module), struct aclread_private);
ldb = ldb_module_get_ctx(module);
p = talloc_get_type(ldb_module_get_private(module), struct aclread_private);
+ am_system = ldb_request_get_control(req, LDB_CONTROL_AS_SYSTEM_OID) != NULL;
+ if (!am_system) {
+ am_system = dsdb_module_am_system(module);
+ }
+
/* skip access checks if we are system or system control is supplied
* or this is not LDAP server request */
if (!p || !p->enabled ||
/* skip access checks if we are system or system control is supplied
* or this is not LDAP server request */
if (!p || !p->enabled ||
- dsdb_module_am_system(module)
- || as_system || !is_untrusted) {
+ am_system ||
+ !is_untrusted) {
return ldb_next_request(module, req);
}
/* no checks on special dn */
return ldb_next_request(module, req);
}
/* no checks on special dn */