mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-30 11:39:34 -05:00
Update printableString to restrict characters per RFC1778 not isprint()
This commit is contained in:
parent
a9b601290b
commit
17bcb2b3bb
2 changed files with 8 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue