]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/modrdn.c
ITS#5360 move tls option setup
[openldap] / libraries / libldap / modrdn.c
index 4f59a09df25060bf57b4dd2f627a0ff2ea3a50f2..c25d96a1f9021e96fa34d2a9d1425ca0bdd15ebf 100644 (file)
@@ -1,18 +1,21 @@
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 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-2008 The OpenLDAP Foundation.
+ * All rights reserved.
  *
- * Copyright 1999, Juan C. Gomez, 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.
+ *
+ * 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.
  *
  * is preserved.
  */
 
-/*
- * A modify rdn request looks like this:
- *     ModifyRDNRequest ::= SEQUENCE {
- *             entry           DistinguishedName,
- *             newrdn          RelativeDistinguishedName,
- *             deleteoldrdn    BOOLEAN
- *             newSuperior     [0] DistinguishedName   [v3 only]
- *     }
+/* ACKNOWLEDGEMENTS:
+ *     Juan C. Gomez
  */
 
 #include "portable.h"
 
 #include "ldap-int.h"
 
+/*
+ * A modify rdn request looks like this:
+ *     ModifyRDNRequest ::= SEQUENCE {
+ *             entry           DistinguishedName,
+ *             newrdn          RelativeDistinguishedName,
+ *             deleteoldrdn    BOOLEAN
+ *             newSuperior     [0] DistinguishedName   [v3 only]
+ *     }
+ */
+
+
 /*
  * ldap_rename - initiate an ldap extended modifyDN operation.
  *
@@ -69,11 +77,7 @@ ldap_rename(
        int rc;
        ber_int_t id;
 
-#ifdef NEW_LOGGING
-       LDAP_LOG ( OPERATION, ENTRY, "ldap_rename\n", 0, 0, 0 );
-#else
        Debug( LDAP_DEBUG_TRACE, "ldap_rename\n", 0, 0, 0 );
-#endif
 
        /* check client controls */
        rc = ldap_int_client_controls( ld, cctrls );
@@ -156,11 +160,7 @@ ldap_rename2(
        int msgid;
        int rc;
 
-#ifdef NEW_LOGGING
-       LDAP_LOG ( OPERATION, ENTRY, "ldap_rename2\n", 0, 0, 0 );
-#else
        Debug( LDAP_DEBUG_TRACE, "ldap_rename2\n", 0, 0, 0 );
-#endif
 
        rc = ldap_rename( ld, dn, newrdn, newSuperior,
                deleteoldrdn, NULL, NULL, &msgid );
@@ -217,9 +217,9 @@ ldap_rename_s(
                return rc;
        }
 
-       rc = ldap_result( ld, msgid, 1, NULL, &res );
+       rc = ldap_result( ld, msgid, LDAP_MSG_ALL, NULL, &res );
 
-       if( rc == -1 ) {
+       if( rc == -1 || !res ) {
                return ld->ld_errno;
        }