From: Julio Sánchez Fernández Date: Sun, 30 May 1999 00:05:24 +0000 (+0000) Subject: Lose previously commented out old code. X-Git-Tag: OPENLDAP_REL_ENG_2_BP~473 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=663d7e8627f9bdd703bf0b329254bb94b8060d0f;p=openldap Lose previously commented out old code. Robustness fixes. Fixed error reporting of non-existing attribute superior. --- diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 799a8a194d..77fdc7a1fe 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -179,62 +179,6 @@ attr_delete( #define DEFAULT_SYNTAX SYNTAX_CIS -/* Force compilation errors by commenting out this -struct asyntaxinfo { - char **asi_names; - int asi_syntax; -}; -static Avlnode *attr_syntaxes = NULL; - -static int -attr_syntax_cmp( - struct asyntaxinfo *a1, - struct asyntaxinfo *a2 -) -{ - return( strcasecmp( a1->asi_names[0], a2->asi_names[0] ) ); -} - -static int -attr_syntax_name_cmp( - char *type, - struct asyntaxinfo *a -) -{ - return( strcasecmp( type, a->asi_names[0] ) ); -} - -static int -attr_syntax_names_cmp( - char *type, - struct asyntaxinfo *a -) -{ - int i; - - for ( i = 0; a->asi_names[i] != NULL; i++ ) { - if ( strcasecmp( type, a->asi_names[i] ) == 0 ) { - return( 0 ); - } - } - return( 1 ); -} - -static int -attr_syntax_dup( - struct asyntaxinfo *a1, - struct asyntaxinfo *a2 -) -{ - if ( a1->asi_syntax != a2->asi_syntax ) { - return( -1 ); - } - - return( 1 ); -} - -*/ - /* * attr_syntax - return the syntax of attribute type */ @@ -552,25 +496,32 @@ at_add( return SLAP_SCHERR_OUTOFMEM; } } else { - *err = errattr; + *err = at->at_sup_oid; return SLAP_SCHERR_ATTR_NOT_FOUND; } } - if ( !strcmp(at->at_syntax_oid, "1.3.6.1.4.1.1466.115.121.1.15") ) { - if ( !strcmp(at->at_equality_oid, - "1.3.6.1.4.1.1466.109.114.1") ) { - sat->sat_syntax_compat = SYNTAX_CES; + if ( at->at_syntax_oid ) { + if ( !strcmp(at->at_syntax_oid, + "1.3.6.1.4.1.1466.115.121.1.15") ) { + if ( at->at_equality_oid && + !strcmp(at->at_equality_oid, + "1.3.6.1.4.1.1466.109.114.1") ) { + sat->sat_syntax_compat = SYNTAX_CES; + } else { + sat->sat_syntax_compat = SYNTAX_CIS; + } + } else if ( !strcmp(at->at_syntax_oid, + "1.3.6.1.4.1.1466.115.121.1.50") ) { + sat->sat_syntax_compat = SYNTAX_CIS | SYNTAX_TEL; + } else if ( !strcmp(at->at_syntax_oid, + "1.3.6.1.4.1.1466.115.121.1.12") ) { + sat->sat_syntax_compat = SYNTAX_CIS | SYNTAX_DN; + } else if ( !strcmp(at->at_syntax_oid, "1.3.6.1.4.1.1466.115.121.1.5") ) { + sat->sat_syntax_compat = SYNTAX_BIN; } else { - sat->sat_syntax_compat = SYNTAX_CIS; + sat->sat_syntax_compat = DEFAULT_SYNTAX; } - } else if ( !strcmp(at->at_syntax_oid, - "1.3.6.1.4.1.1466.115.121.1.50") ) { - sat->sat_syntax_compat = SYNTAX_CIS | SYNTAX_TEL; - } else if ( !strcmp(at->at_syntax_oid, "1.3.6.1.4.1.1466.115.121.1.12") ) { - sat->sat_syntax_compat = SYNTAX_CIS | SYNTAX_DN; - } else if ( !strcmp(at->at_syntax_oid, "1.3.6.1.4.1.1466.115.121.1.5") ) { - sat->sat_syntax_compat = SYNTAX_BIN; } else { sat->sat_syntax_compat = DEFAULT_SYNTAX; }