summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2009-05-29 14:11:41 -0700
committerNathan Kinder <nkinder@redhat.com>2009-05-29 14:11:41 -0700
commite36fcec6d950634ab65d22199f1ea4cc5bed8dea (patch)
tree8e4a9315069b3276f9b8c81dd2426086eab61b93
parent4d32ce1809dfead6697404edaff066608c4bad9d (diff)
downloadds-e36fcec6d950634ab65d22199f1ea4cc5bed8dea.tar.gz
ds-e36fcec6d950634ab65d22199f1ea4cc5bed8dea.tar.xz
ds-e36fcec6d950634ab65d22199f1ea4cc5bed8dea.zip
Bug: 181465 - Handle spacing issues in objectClass SUP list.
Our schema parser requires a space after the opening paran when multiple SUP objectclasses are listed in the definition of an objectclass. The RFCs show that a space is not required. This patch simply removes the requirement that a space be present after the opening paran.
-rw-r--r--ldap/servers/slapd/schema.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c
index e331a946..c2600f41 100644
--- a/ldap/servers/slapd/schema.c
+++ b/ldap/servers/slapd/schema.c
@@ -2896,7 +2896,7 @@ read_oc_ldif ( const char *input, struct objclass **oc, char *errorbuf,
* XXXmcs: Since we do not yet support multiple superior objectclasses, we
* just grab the first OID in a parenthesized list.
*/
- if ( NULL == ( pOcSup = get_tagged_oid( " SUP ( ", &nextinput,
+ if ( NULL == ( pOcSup = get_tagged_oid( " SUP (", &nextinput,
keyword_strstr_fn ))) {
pOcSup = get_tagged_oid( " SUP ", &nextinput, keyword_strstr_fn );
}
@@ -4332,10 +4332,15 @@ get_flag_keyword( const char *keyword, int flag_value, const char **inputp,
* The `strstr_fn' function pointer is used to search for `tag', e.g., it
* could be PL_strcasestr().
*
- * The string passed in `tag' MUST include a trailing space, e.g.,
+ * The string passed in `tag' SHOULD generally include a trailing space, e.g.,
*
* pSuperior = get_tagged_oid( "SUP ", &input, PL_strcasestr );
*
+ * The exception to this is when the tag contains '(' as a trailing character.
+ * This is used to process lists of oids, such as the following:
+ *
+ * SUP (inetOrgPerson $ testUser)
+ *
* A malloc'd string is returned if `tag; is found and NULL if not.
*/
static char *
@@ -4350,7 +4355,7 @@ get_tagged_oid( const char *tag, const char **inputp,
PR_ASSERT( NULL != tag );
PR_ASSERT( '\0' != tag[ 0 ] );
if('(' !=tag[0])
- PR_ASSERT( ' ' == tag[ strlen( tag ) - 1 ] );
+ PR_ASSERT((' ' == tag[ strlen( tag ) - 1 ]) || ('(' == tag[ strlen( tag ) - 1 ]));
if ( NULL == strstr_fn ) {
strstr_fn = PL_strcasestr;