Diff for /servers/slapd/ava.c between versions 1.35 and 1.40

version 1.35, 2003/11/27 00:17:15 version 1.40, 2004/09/04 02:54:29
Line 1 Line 1
 /* ava.c - routines for dealing with attribute value assertions */  /* ava.c - routines for dealing with attribute value assertions */
 /* $OpenLDAP: pkg/ldap/servers/slapd/ava.c,v 1.34 2003/04/10 23:29:29 hyc Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/ava.c,v 1.39 2004/05/19 17:39:40 kurt Exp $ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
  * Copyright 1998-2003 The OpenLDAP Foundation.   * Copyright 1998-2004 The OpenLDAP Foundation.
  * All rights reserved.   * All rights reserved.
  *   *
  * Redistribution and use in source and binary forms, with or without   * Redistribution and use in source and binary forms, with or without
Line 38  void Line 38  void
 ava_free(  ava_free(
         Operation *op,          Operation *op,
         AttributeAssertion *ava,          AttributeAssertion *ava,
         int     freeit          int     freeit )
 )  
 {  {
         op->o_tmpfree( ava->aa_value.bv_val, op->o_tmpmemctx );          op->o_tmpfree( ava->aa_value.bv_val, op->o_tmpmemctx );
         if ( freeit ) {          if ( freeit ) op->o_tmpfree( (char *) ava, op->o_tmpmemctx );
                 op->o_tmpfree( (char *) ava, op->o_tmpmemctx );  
         }  
 }  }
   
 int  int
Line 53  get_ava( Line 50  get_ava(
         BerElement      *ber,          BerElement      *ber,
         AttributeAssertion      **ava,          AttributeAssertion      **ava,
         unsigned usage,          unsigned usage,
         const char **text          const char **text )
 )  
 {  {
         int rc;          int rc;
         ber_tag_t rtag;          ber_tag_t rtag;
Line 64  get_ava( Line 60  get_ava(
         rtag = ber_scanf( ber, "{mm}", &type, &value );          rtag = ber_scanf( ber, "{mm}", &type, &value );
   
         if( rtag == LBER_ERROR ) {          if( rtag == LBER_ERROR ) {
 #ifdef NEW_LOGGING  
                 LDAP_LOG( FILTER, ERR, "get_ava:  ber_scanf failure\n", 0, 0, 0 );  
 #else  
                 Debug( LDAP_DEBUG_ANY, "  get_ava ber_scanf\n", 0, 0, 0 );                  Debug( LDAP_DEBUG_ANY, "  get_ava ber_scanf\n", 0, 0, 0 );
 #endif  
                 *text = "Error decoding attribute value assertion";                  *text = "Error decoding attribute value assertion";
                 return SLAPD_DISCONNECT;                  return SLAPD_DISCONNECT;
         }          }
Line 80  get_ava( Line 72  get_ava(
         rc = slap_bv2ad( &type, &aa->aa_desc, text );          rc = slap_bv2ad( &type, &aa->aa_desc, text );
   
         if( rc != LDAP_SUCCESS ) {          if( rc != LDAP_SUCCESS ) {
                   Debug( LDAP_DEBUG_FILTER,
                   "get_ava: unknown attributeType %s\n", type.bv_val, 0, 0 );
                 op->o_tmpfree( aa, op->o_tmpmemctx );                  op->o_tmpfree( aa, op->o_tmpmemctx );
                 return rc;                  return rc;
         }          }
Line 89  get_ava( Line 83  get_ava(
                 usage, &value, &aa->aa_value, text, op->o_tmpmemctx );                  usage, &value, &aa->aa_value, text, op->o_tmpmemctx );
   
         if( rc != LDAP_SUCCESS ) {          if( rc != LDAP_SUCCESS ) {
                   Debug( LDAP_DEBUG_FILTER,
                   "get_ava: illegal value for attributeType %s\n", type.bv_val, 0, 0 );
                 op->o_tmpfree( aa, op->o_tmpmemctx );                  op->o_tmpfree( aa, op->o_tmpmemctx );
                 return rc;                  return rc;
         }          }
   
         *ava = aa;          *ava = aa;
   
         return LDAP_SUCCESS;          return LDAP_SUCCESS;
 }  }

Removed from v.1.35  
changed lines
  Added in v.1.40


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org