>From 9f337eb80b6446c2f99eef600f55392dbf4970cb Mon Sep 17 00:00:00 2001 From: Nathan Kinder Date: Fri, 11 Dec 2009 08:54:16 -0800 Subject: [PATCH] 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. --- ldap/servers/slapd/attr.c | 4 ++-- ldap/servers/slapd/attrsyntax.c | 4 ++-- ldap/servers/slapd/slap.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ldap/servers/slapd/attr.c b/ldap/servers/slapd/attr.c index d78342e..89aa9f5 100644 --- a/ldap/servers/slapd/attr.c +++ b/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 { diff --git a/ldap/servers/slapd/attrsyntax.c b/ldap/servers/slapd/attrsyntax.c index 32ad410..e88f4ba 100644 --- a/ldap/servers/slapd/attrsyntax.c +++ b/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; diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h index 0e37c85..93f8470 100644 --- a/ldap/servers/slapd/slap.h +++ b/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 */ -- 1.6.2.5