[Fedora-directory-commits] ldapserver/ldap/servers/slapd attrsyntax.c, 1.5, 1.6 dn.c, 1.9, 1.10 libslapd.def, 1.17, 1.18 slapi-plugin.h, 1.17, 1.18

Nathan Kinder (nkinder) fedora-directory-commits at redhat.com
Thu Oct 4 16:27:49 UTC 2007


Author: nkinder

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv434/slapd

Modified Files:
	attrsyntax.c dn.c libslapd.def slapi-plugin.h 
Log Message:
Resolves: 288321
Summary: Handle poorly formatted DN's when normalizing.  Also only check modify values against authenticated DN for DN syntax attributes.



Index: attrsyntax.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/attrsyntax.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- attrsyntax.c	10 Nov 2006 23:45:40 -0000	1.5
+++ attrsyntax.c	4 Oct 2007 16:27:47 -0000	1.6
@@ -731,6 +731,22 @@
 	}
 }
 
+/* Returns the oid of the syntax of the Slapi_Attr that's passed in.
+ * The caller must dispose of oid by calling slapi_ch_free_string(). */
+int
+slapi_attr_get_syntax_oid_copy( const Slapi_Attr *a, char **oidp )
+{
+	void *pi = NULL;
+
+	if (a && (slapi_attr_type2plugin(a->a_type, &pi) == 0)) {
+		*oidp = slapi_ch_strdup(plugin_syntax2oid(pi));
+		return( 0 );
+	} else {
+		*oidp = NULL;
+		return( -1 );
+	}
+}
+
 #ifdef ATTR_LDAP_DEBUG
 
 PRIntn


Index: dn.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/dn.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- dn.c	10 Nov 2006 23:45:40 -0000	1.9
+++ dn.c	4 Oct 2007 16:27:47 -0000	1.10
@@ -342,7 +342,13 @@
 	/*
 	 * Track and sort attribute values within multivalued RDNs.
 	 */
-	if ( rdn_av_count > 0 ) {
+	/* We may still be in an unexpected state, such as B4TYPE if
+	 * we encountered something odd like a '+' at the end of the
+	 * rdn.  If this is the case, we don't want to add this bogus
+	 * rdn to our list to sort.  We should only be in the INVALUE
+	 * or B4SEPARATOR state if we have a valid rdn component to 
+	 * be added. */
+	if ((rdn_av_count > 0) && ((state == INVALUE) || (state == B4SEPARATOR))) {
 	    add_rdn_av( typestart, d, &rdn_av_count,
 		    &rdn_avs, initial_rdn_av_stack );
 	}
@@ -352,7 +358,6 @@
 	if ( rdn_av_count > 0 ) {
 	    reset_rdn_avs( &rdn_avs, &rdn_av_count );
 	}
-
 	/* Trim trailing spaces */
 	while ( d != dn && *(d - 1) == ' ' ) d--;  /* XXX 518524 */
 


Index: libslapd.def
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/libslapd.def,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- libslapd.def	13 Oct 2006 01:06:28 -0000	1.17
+++ libslapd.def	4 Oct 2007 16:27:47 -0000	1.18
@@ -1180,6 +1180,7 @@
 	sasl_map_done @1179
 	slapd_SECITEM_FreeItem @1180
 	slapi_op_type_to_string @1181
+	slapi_attr_get_syntax_oid_copy @1182
 ; password syntax functions
         config_set_pw_mindigits @1190
         config_set_pw_minalphas @1191


Index: slapi-plugin.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slapi-plugin.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- slapi-plugin.h	2 Oct 2007 18:39:50 -0000	1.17
+++ slapi-plugin.h	4 Oct 2007 16:27:47 -0000	1.18
@@ -398,6 +398,7 @@
 int slapi_attr_type2plugin( const char *type, void **pi );
 int slapi_attr_get_type( Slapi_Attr *attr, char **type );
 int slapi_attr_get_oid_copy( const Slapi_Attr *attr, char **oidp );
+int slapi_attr_get_syntax_oid_copy( const Slapi_Attr *a, char **oidp );
 int slapi_attr_get_flags( const Slapi_Attr *attr, unsigned long *flags );
 int slapi_attr_flag_is_set( const Slapi_Attr *attr, unsigned long flag );
 int slapi_attr_value_cmp( const Slapi_Attr *attr, const struct berval *v1, const struct berval *v2 );




More information about the Fedora-directory-commits mailing list