diff options
author | Andreas Schneider <asn@samba.org> | 2023-02-03 15:07:49 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2023-02-06 22:51:31 +0000 |
commit | 1379b0e13c02a95954da64a7c8619c2a2111f52a (patch) | |
tree | ef8dec9553566bd40f94794dc136663af44756c6 /lib/ldb-samba | |
parent | 981dcccfd9dd6ee40fe3c700cf6383df062038ea (diff) | |
download | samba-1379b0e13c02a95954da64a7c8619c2a2111f52a.tar.gz |
lib:ldb-samba: Correctly handle search scope
lib/ldb-samba/ldb_ildap.c:482:47: error: implicit conversion from enumeration
type 'enum ldb_scope' to different enumeration type 'enum ldap_scope'
[-Werror,-Wenum-conversion]
msg->r.SearchRequest.scope = req->op.search.scope;
~ ~~~~~~~~~~~~~~~^~~~~
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/ldb-samba')
-rw-r--r-- | lib/ldb-samba/ldb_ildap.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/ldb-samba/ldb_ildap.c b/lib/ldb-samba/ldb_ildap.c index b15f38b3843..d738d1da0cf 100644 --- a/lib/ldb-samba/ldb_ildap.c +++ b/lib/ldb-samba/ldb_ildap.c @@ -476,10 +476,17 @@ static int ildb_search(struct ildb_context *ac) return LDB_ERR_OPERATIONS_ERROR; } - if (req->op.search.scope == LDB_SCOPE_DEFAULT) { + switch (req->op.search.scope) { + case LDB_SCOPE_DEFAULT: + case LDB_SCOPE_SUBTREE: msg->r.SearchRequest.scope = LDAP_SEARCH_SCOPE_SUB; - } else { - msg->r.SearchRequest.scope = req->op.search.scope; + break; + case LDB_SCOPE_BASE: + msg->r.SearchRequest.scope = LDAP_SEARCH_SCOPE_BASE; + break; + case LDB_SCOPE_ONELEVEL: + msg->r.SearchRequest.scope = LDAP_SEARCH_SCOPE_SINGLE; + break; } msg->r.SearchRequest.deref = LDAP_DEREFERENCE_NEVER; |