From: Howard Chu Date: Tue, 27 Oct 2015 03:41:17 +0000 (+0000) Subject: ITS#8289 fix mod Increment with inherited attr type X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0d9b8ebe4bfe584e796f683be6203d4a4eb421a2;p=openldap ITS#8289 fix mod Increment with inherited attr type --- diff --git a/servers/slapd/mods.c b/servers/slapd/mods.c index 5c8ee547ff..763e2e377f 100644 --- a/servers/slapd/mods.c +++ b/servers/slapd/mods.c @@ -388,6 +388,7 @@ modify_increment_values( char *textbuf, size_t textlen ) { Attribute *a; + const char *syn_oid; a = attr_find( e->e_attrs, mod->sm_desc ); if( a == NULL ) { @@ -406,7 +407,8 @@ modify_increment_values( } } - if ( !strcmp( a->a_desc->ad_type->sat_syntax_oid, SLAPD_INTEGER_SYNTAX )) { + syn_oid = at_syntax( a->a_desc->ad_type ); + if ( syn_oid && !strcmp( syn_oid, SLAPD_INTEGER_SYNTAX )) { int i; char str[sizeof(long)*3 + 2]; /* overly long */ long incr; @@ -446,7 +448,7 @@ modify_increment_values( snprintf( textbuf, textlen, "modify/increment: %s: increment not supported for value syntax %s", mod->sm_desc->ad_cname.bv_val, - a->a_desc->ad_type->sat_syntax_oid ); + syn_oid ? syn_oid : "(NULL)" ); return LDAP_CONSTRAINT_VIOLATION; }