amoralej / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 years ago
Clone
Blob Blame History Raw
From ba9f2607b8bf565e2f6d1f8751c16c0b485a7210 Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Mon, 24 Aug 2015 16:13:12 -0700
Subject: [PATCH 51/52] 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)
(cherry picked from commit 626f2d7060390a3234ebb50b92937d1ec5a89481)
---
 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 35c2564..f476a4d 100644
--- a/ldap/servers/plugins/deref/deref.c
+++ b/ldap/servers/plugins/deref/deref.c
@@ -20,6 +20,9 @@
 #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
@@ -290,7 +293,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);
     }
-- 
1.9.3