andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
Blob Blame History Raw
From 3fcf6086fcaaa6faa02c603f1c352f22dbfc1887 Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Mon, 24 Aug 2015 16:13:12 -0700
Subject: [PATCH] Ticket #47757 - Unable to dereference unqiemember attribute
 because it is dn [#UID] not dn syntax

Description: In addtion to DN syntax, adding Name and Optional UID
syntax to the deref attr's OID check.

https://fedorahosted.org/389/ticket/47757

Reviewed by mreynolds@redhat.com (Thank you, Mark!!)

(cherry picked from commit 2dbbb9df4691590f788049a822c47eb501182c85)
---
 ldap/servers/plugins/deref/deref.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ldap/servers/plugins/deref/deref.c b/ldap/servers/plugins/deref/deref.c
index 06e2df5..6542034 100644
--- a/ldap/servers/plugins/deref/deref.c
+++ b/ldap/servers/plugins/deref/deref.c
@@ -51,6 +51,9 @@ int is_type_forbidden(const char *type); /* from proto-slap.h */
 #ifndef DN_SYNTAX_OID
 #define DN_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.12"
 #endif
+#ifndef NAME_AND_OPTIONAL_UID_SYNTAX_OID
+#define NAME_AND_OPTIONAL_UID_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.34"
+#endif
 
 /*
  * Plug-in globals
@@ -328,7 +331,7 @@ deref_check_for_dn_syntax(const char *derefattr)
 
         slapi_attr_init(attr, derefattr);
         slapi_attr_get_syntax_oid_copy(attr, &oid);
-        ret = oid && !strcmp(oid, DN_SYNTAX_OID);
+        ret = oid && (!strcmp(oid, DN_SYNTAX_OID) || !strcmp(oid, NAME_AND_OPTIONAL_UID_SYNTAX_OID));
         slapi_ch_free_string(&oid);
         slapi_attr_free(&attr);
     }
-- 
2.9.3