]> git.sur5r.net Git - openldap/blobdiff - contrib/slapd-modules/addpartial/addpartial-overlay.c
Merge branch 'mdb.master' of ssh://git-master.openldap.org/~git/git/openldap
[openldap] / contrib / slapd-modules / addpartial / addpartial-overlay.c
index 85fb6c3a167b7dbed4e2c1689c2b9b0394921efc..8c5032d6e651f9e8fb0aedef111389a061b0b8ac 100644 (file)
@@ -1,7 +1,9 @@
-/**
- * $Id: addpartial-overlay.c 6588 2007-11-07 18:29:25Z dhawes $
+/* addpartial-overlay.c */
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright (C) 2004 Virginia Tech, David Hawes.
+ * Copyright 2004-2011 The OpenLDAP Foundation.
+ * Portions Copyright (C) 2004 Virginia Tech, David Hawes.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * A copy of this license is available in file LICENSE in the
  * top-level directory of the distribution or, alternatively, at
  * http://www.OpenLDAP.org/license.html.
- *
- * SEE LICENSE FOR MORE INFORMATION
- *
- * Author:  David H. Hawes, Jr.
- * Email:   dhawes@vt.edu
- * Version: $Revision: 8385 $
- * Updated: $Date: 2008-11-04 12:19:52 -0500 (Tue, 04 Nov 2008) $
- * 
- * addpartial-overlay
+ */
+/* ACKNOLEDGEDMENTS:
+ * This work was initially developed by David Hawes of Virginia Tech
+ * for inclusion in OpenLDAP Software.
+ */
+/* addpartial-overlay
  *
  * This is an OpenLDAP overlay that intercepts ADD requests, determines if a
  * change has actually taken place for that record, and then performs a modify
@@ -44,7 +43,6 @@ static slap_overinst addpartial;
 static int addpartial_add( Operation *op, SlapReply *rs)
 {
     Operation nop = *op;
-    SlapReply nrs = { REP_RESULT };
     Entry *toAdd = NULL;
     Entry *found = NULL;
     slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
@@ -259,12 +257,6 @@ static int addpartial_add( Operation *op, SlapReply *rs)
                 Debug(LDAP_DEBUG_TRACE, "%s: mods to do...\n",
                       addpartial.on_bi.bi_type, 0, 0);
 
-                memset(&nrs, 0, sizeof(nrs));
-                nrs.sr_type = REP_RESULT;
-                nrs.sr_err = LDAP_SUCCESS;
-                nrs.sr_entry = NULL;
-                nrs.sr_text = NULL;
-
                 nop.o_tag = LDAP_REQ_MODIFY;
                 nop.orm_modlist = mods;
                 nop.orm_no_opattrs = 0;
@@ -282,6 +274,7 @@ static int addpartial_add( Operation *op, SlapReply *rs)
 
                 if(nop.o_bd->be_modify)
                 {
+                    SlapReply nrs = { REP_RESULT };
                     rc = (nop.o_bd->be_modify)(&nop, &nrs);
                 }