]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/modrdn.c
Add LDAP_DEPRECATED macro
[openldap] / libraries / libldap / modrdn.c
index 6907a2299859d5f5fd532d656c905485577bd145..964942fd47a513d3ac8e5ea9cbe73bb37d21a0b0 100644 (file)
@@ -1,18 +1,21 @@
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
- */
-/*  Portions
- *  Copyright (c) 1990 Regents of the University of Michigan.
- *  All rights reserved.
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- *  modrdn.c
- */
-/*
- * Support for MODIFYDN REQUEST V3 (newSuperior) by:
+ * Copyright 1998-2003 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
  *
- * Copyright 1999, Juan C. Gomez, All rights reserved.
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* Portions Copyright (c) 1990 Regents of the University of Michigan.
+ * All rights reserved.
+ */
+/* Copyright 1999, Juan C. Gomez, All rights reserved.
  * This software is not subject to any license of Silicon Graphics 
  * Inc. or Purdue University.
  *
  * without restriction or fee of any kind as long as this notice
  * is preserved.
  */
+/* Portions Copyright (C) The Internet Society (1997)
+ * ASN.1 fragments are from RFC 2251; see RFC 2251 for full legal notices.
+ */
+
+/* ACKNOWLEDGEMENTS:
+ *     Juan C. Gomez
+ */
 
 /*
  * A modify rdn request looks like this:
@@ -67,6 +77,7 @@ ldap_rename(
 {
        BerElement      *ber;
        int rc;
+       ber_int_t id;
 
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ENTRY, "ldap_rename\n", 0, 0, 0 );
@@ -83,6 +94,7 @@ ldap_rename(
                return( LDAP_NO_MEMORY );
        }
 
+       LDAP_NEXT_MSGID( ld, id );
        if( newSuperior != NULL ) {
                /* must be version 3 (or greater) */
                if ( ld->ld_version < LDAP_VERSION3 ) {
@@ -90,15 +102,14 @@ ldap_rename(
                        ber_free( ber, 1 );
                        return( ld->ld_errno );
                }
-
                rc = ber_printf( ber, "{it{ssbtsN}", /* '}' */ 
-                       ++ld->ld_msgid, LDAP_REQ_MODDN,
+                       id, LDAP_REQ_MODDN,
                        dn, newrdn, (ber_int_t) deleteoldrdn,
                        LDAP_TAG_NEWSUPERIOR, newSuperior );
 
        } else {
                rc = ber_printf( ber, "{it{ssbN}", /* '}' */ 
-                       ++ld->ld_msgid, LDAP_REQ_MODDN,
+                       id, LDAP_REQ_MODDN,
                        dn, newrdn, (ber_int_t) deleteoldrdn );
        }
 
@@ -122,7 +133,7 @@ ldap_rename(
        }
 
        /* send the message */
-       *msgidp = ldap_send_initial_request( ld, LDAP_REQ_MODRDN, dn, ber );
+       *msgidp = ldap_send_initial_request( ld, LDAP_REQ_MODRDN, dn, ber, id );
        
        if( *msgidp < 0 ) {
                return( ld->ld_errno );