]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/modify.c
Patch: ACL #access-id#<invalid-DN> granted access to everyone (ITS#2006)
[openldap] / servers / slapd / back-sql / modify.c
index fa5bc70b6e616fdd91261dc2ac863d06a2f526cb..9514da01552c760cbb3c5140c9195b495b93d0f7 100644 (file)
@@ -68,11 +68,11 @@ int backsql_modify(BackendDB *be,Connection *conn,Operation *op,
  for(ml=modlist;ml!=NULL;ml=ml->sml_next)
  {
   c_mod=&ml->sml_mod;
-  Debug(LDAP_DEBUG_TRACE,"backsql_modify(): attribute '%s'\n",c_mod->sm_desc->ad_cname->bv_val,0,0);
-  at=backsql_at_with_name(oc,c_mod->sm_desc->ad_cname->bv_val);
+  Debug(LDAP_DEBUG_TRACE,"backsql_modify(): attribute '%s'\n",c_mod->sm_desc->ad_cname.bv_val,0,0);
+  at=backsql_at_with_name(oc,c_mod->sm_desc->ad_cname.bv_val);
   if (at==NULL)
   {
-   Debug(LDAP_DEBUG_TRACE,"backsql_modify(): attribute provided is not registered in this objectclass ('%s')\n",c_mod->sm_desc->ad_cname->bv_val,0,0);
+   Debug(LDAP_DEBUG_TRACE,"backsql_modify(): attribute provided is not registered in this objectclass ('%s')\n",c_mod->sm_desc->ad_cname.bv_val,0,0);
    continue;
   }
   
@@ -336,8 +336,6 @@ int backsql_modrdn(BackendDB *be,Connection *conn,Operation *op,
  send_ldap_result(conn,op,LDAP_SUCCESS,"",NULL,NULL,NULL);
 modrdn_return:
  SQLFreeStmt(sth,SQL_DROP);
- if (p_dn)
-  ch_free(p_dn);
  if (newSuperior && new_pdn)
   ch_free(new_pdn);
  if (new_dn)
@@ -371,7 +369,7 @@ int backsql_add(BackendDB *be,Connection *conn,Operation *op,Entry *e)
  for(at=e->e_attrs;at!=NULL;at=at->a_next)
  {
   /*Debug(LDAP_DEBUG_TRACE,"backsql_add(): scanning entry -- %s\n",at->a_type,0,0);*/
-  if (!strcasecmp(at->a_desc->ad_cname->bv_val,"objectclass"))
+  if (!strcasecmp(at->a_desc->ad_cname.bv_val,"objectclass"))
   {
    oc=backsql_oc_with_name(bi,at->a_vals[0]->bv_val);
    break;
@@ -417,16 +415,16 @@ int backsql_add(BackendDB *be,Connection *conn,Operation *op,Entry *e)
 
  for(at=e->e_attrs;at!=NULL;at=at->a_next)
  {
-  at_rec=backsql_at_with_name(oc,at->a_desc->ad_cname->bv_val); 
+  at_rec=backsql_at_with_name(oc,at->a_desc->ad_cname.bv_val); 
   
   if (at_rec==NULL)
   {
-   Debug(LDAP_DEBUG_TRACE,"backsql_add(): attribute provided is not registered in this objectclass ('%s')\n",at->a_desc->ad_cname->bv_val,0,0);
+   Debug(LDAP_DEBUG_TRACE,"backsql_add(): attribute provided is not registered in this objectclass ('%s')\n",at->a_desc->ad_cname.bv_val,0,0);
    continue;
   }
   if (at_rec->add_proc==NULL)
   {
-   Debug(LDAP_DEBUG_TRACE,"backsql_add(): add procedure is not defined for this attribute ('%s')\n",at->a_desc->ad_cname->bv_val,0,0);
+   Debug(LDAP_DEBUG_TRACE,"backsql_add(): add procedure is not defined for this attribute ('%s')\n",at->a_desc->ad_cname.bv_val,0,0);
    continue;
   }
   
@@ -462,7 +460,6 @@ int backsql_add(BackendDB *be,Connection *conn,Operation *op,Entry *e)
   send_ldap_result(conn,op,LDAP_OTHER,"","SQL-backend error",NULL,NULL);
   return 1;
  }
- free(pdn);
  backsql_BindParamStr(sth,1,e->e_dn,BACKSQL_MAX_DN_LEN);
  SQLBindParameter(sth,2,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,0,0,&oc->id,0,0);
  SQLBindParameter(sth,3,SQL_PARAM_INPUT,SQL_C_LONG,SQL_INTEGER,0,0,&parent_id.id,0,0);