From: Kurt Zeilenga Date: Sat, 4 Nov 2000 20:31:50 +0000 (+0000) Subject: Update printableString to restrict characters per RFC1778 not isprint() X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1658 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=17bcb2b3bbd81cb645392d7a5f4fb274ec1c04b2;p=openldap Update printableString to restrict characters per RFC1778 not isprint() --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 2e46cac040..8aa1368a32 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -2325,7 +2325,9 @@ printableStringValidate( if( !val->bv_len ) return LDAP_INVALID_SYNTAX; for(i=0; i < val->bv_len; i++) { - if( !isprint(val->bv_val[i]) ) return LDAP_INVALID_SYNTAX; + if( !SLAP_PRINTABLE(val->bv_val[i]) ) { + return LDAP_INVALID_SYNTAX; + } } return LDAP_SUCCESS; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 48d69172f1..be6dde3829 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -101,6 +101,11 @@ LDAP_BEGIN_DECL #define AD_LEADCHAR(c) ( ATTR_CHAR(c) ) #define AD_CHAR(c) ( ATTR_CHAR(c) || (c) == ';' ) +#define SLAP_PRINTABLE(c) ( ASCII_ALNUM(c) || (c) == '\'' || \ + (c) == '(' || (c) == ')' || (c) == '+' || (c) == ',' || \ + (c) == '-' || (c) == '.' || (c) == '/' || (c) == ':' || \ + (c) == '?' || (c) == ' ' ) + /* must match in schema_init.c */ #define SLAPD_DN_SYNTAX "1.3.6.1.4.1.1466.115.121.1.12" #define SLAPD_NAMEUID_SYNTAX "1.3.6.1.4.1.1466.115.121.1.34"