"Syntax not found",
"Duplicate ldapSyntax",
"Superior syntax not found",
+ "Substitute syntax not specified",
+ "Substitute syntax not found",
"OID or name required",
"Qualifier not supported",
"Invalid NAME",
SLAP_SCHERR_SYN_NOT_FOUND,
SLAP_SCHERR_SYN_DUP,
SLAP_SCHERR_SYN_SUP_NOT_FOUND,
+ SLAP_SCHERR_SYN_SUBST_NOT_SPECIFIED,
+ SLAP_SCHERR_SYN_SUBST_NOT_FOUND,
SLAP_SCHERR_NO_NAME,
SLAP_SCHERR_NOT_SUPPORTED,
SLAP_SCHERR_BAD_DESCR,
ssyn->ssyn_str2ber = def->sd_str2ber;
#endif
+ if ( def->sd_validate == NULL && def->sd_pretty == NULL && syn->syn_extensions != NULL ) {
+ LDAPSchemaExtensionItem **lsei;
+ Syntax *subst = NULL;
+
+ for ( lsei = syn->syn_extensions; *lsei != NULL; lsei++) {
+ if ( strcmp( (*lsei)->lsei_name, "X-SUBST" ) != 0 ) {
+ continue;
+ }
+
+ assert( (*lsei)->lsei_values != NULL );
+ if ( (*lsei)->lsei_values[0] == '\0'
+ || (*lsei)->lsei_values[1] != '\0' )
+ {
+ Debug( LDAP_DEBUG_ANY, "syn_add(%s): exactly one substitute syntax must be present\n",
+ ssyn->ssyn_syn.syn_oid, 0, 0 );
+ return SLAP_SCHERR_SYN_SUBST_NOT_SPECIFIED;
+ }
+
+ subst = syn_find( (*lsei)->lsei_values[0] );
+ if ( subst == NULL ) {
+ Debug( LDAP_DEBUG_ANY, "syn_add(%s): substitute syntax %s not found\n",
+ ssyn->ssyn_syn.syn_oid, (*lsei)->lsei_values[0], 0 );
+ return SLAP_SCHERR_SYN_SUBST_NOT_FOUND;
+ }
+ break;
+ }
+
+ if ( subst != NULL ) {
+ ssyn->ssyn_flags = subst->ssyn_flags;
+ ssyn->ssyn_validate = subst->ssyn_validate;
+ ssyn->ssyn_pretty = subst->ssyn_pretty;
+
+ ssyn->ssyn_sups = NULL;
+
+#ifdef SLAPD_BINARY_CONVERSION
+ ssyn->ssyn_ber2str = subst->ssyn_ber2str;
+ ssyn->ssyn_str2ber = subst->ssyn_str2ber;
+#endif
+ }
+ }
+
if ( def->sd_sups != NULL ) {
int cnt;