This is an automated email from the git hooks/post-receive script.
tbordaz pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.1 by this push:
new 0adfacd Ticket - 50349 - additional fix: filter schema check must handle
subtypes
0adfacd is described below
commit 0adfacd47c6db41cfc2098fe9d2c8a29ac1038f7
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
AuthorDate: Wed Oct 9 16:31:13 2019 +0200
Ticket - 50349 - additional fix: filter schema check must handle subtypes
Bug: if the filter did contain an attribute with a subtype eg givenname;lang-de
then the schema lookup failed.
Fix: The subtype needs to be removed befor asi lookup
Reviewed by: William, Thiery, Mark - thanks
---
ldap/servers/slapd/attrsyntax.c | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/ldap/servers/slapd/attrsyntax.c b/ldap/servers/slapd/attrsyntax.c
index 8d218d4..7de006c 100644
--- a/ldap/servers/slapd/attrsyntax.c
+++ b/ldap/servers/slapd/attrsyntax.c
@@ -394,11 +394,33 @@ attr_syntax_get_by_name_locking_optional(const char *name, PRBool
use_lock, PRUi
* The main reason to use this over attr_syntax_get_by_name_locking_optional is to
* avoid the reference count increment/decrement cycle when we only need a boolean
* of existance, rather than retriving the reference to the attribute itself.
+ *
+ * But we do need to strip subtypes
*/
int32_t
attr_syntax_exist_by_name_nolock(char *name) {
struct asyntaxinfo *asi = NULL;
- asi = (struct asyntaxinfo *)PL_HashTableLookup_const(name2asi, name);
+ char *check_name = NULL;
+ char *p = NULL;
+ int free_attr = 0;
+
+ /* Ignore any attribute subtypes. */
+ if ((p = strchr(name, ';'))) {
+ int check_len = p - name + 1;
+
+ check_name = (char *)slapi_ch_malloc(check_len);
+ PR_snprintf(check_name, check_len, "%s", name);
+ free_attr = 1;
+ } else {
+ check_name = name;
+ }
+
+ asi = (struct asyntaxinfo *)PL_HashTableLookup_const(name2asi, check_name);
+
+ if (free_attr) {
+ slapi_ch_free_string(&check_name);
+ }
+
if (asi != NULL) {
return 1;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.