Răsfoiți Sursa

Set unknown attribute syntax to Octet String.

When an unknown attribute type is used (when adding an entry using
the extensibleObject objectclass for example), the syntax of the
attribute defaults to "Directory String".  This places syntax
restrictions on the attribute, limiting the attribtues use to
specific types of values.  This patch changes the syntax for
unknown attribute to "Octet String", which allows 0 or more UTF-8
bytes.  This will allow unknown attributes to store binary or empty
values.
Nathan Kinder 16 ani în urmă
părinte
comite
9f337eb80b

+ 2 - 2
ldap/servers/slapd/attr.c

@@ -255,12 +255,12 @@ slapi_attr_init_locking_optional(Slapi_Attr *a, const char *type, PRBool use_loc
 		{
 			a->a_type = attr_syntax_normalize_no_lookup( type );
 			/*
-			 * no syntax for this type... return DirectoryString
+			 * no syntax for this type... return Octet String
 			 * syntax.  we accomplish this by looking up a well known
 			 * attribute type that has that syntax.
 			 */
 			asi = attr_syntax_get_by_name_locking_optional(
-					ATTR_WITH_DIRSTRING_SYNTAX, use_lock);
+					ATTR_WITH_OCTETSTRING_SYNTAX, use_lock);
 		}
 		else
 		{

+ 2 - 2
ldap/servers/slapd/attrsyntax.c

@@ -515,11 +515,11 @@ attr_syntax_get_plugin_by_name_with_default( const char *type )
 	 */
 	if ( (asi = attr_syntax_get_by_name(type)) == NULL ) {
 		/*
-		 * no syntax for this type... return DirectoryString
+		 * no syntax for this type... return Octet String
 		 * syntax.  we accomplish this by looking up a well known
 		 * attribute type that has that syntax.
 		 */
-		asi = attr_syntax_get_by_name(ATTR_WITH_DIRSTRING_SYNTAX);
+		asi = attr_syntax_get_by_name(ATTR_WITH_OCTETSTRING_SYNTAX);
 	}
 	if ( NULL != asi ) {
 		plugin = asi->asi_plugin;

+ 1 - 1
ldap/servers/slapd/slap.h

@@ -2074,7 +2074,7 @@ int slapd_bind_local_user(Connection *conn);
 
 extern char	*attr_dataversion;
 #define	ATTR_DATAVERSION				"dataVersion"
-#define ATTR_WITH_DIRSTRING_SYNTAX		"cn"
+#define ATTR_WITH_OCTETSTRING_SYNTAX		"userPassword"
 
 #define SLAPD_SNMP_UPDATE_INTERVAL (10 * 1000) /* 10 seconds */