X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fmodrdn.c;h=5e4c45f9971825cf9b55ba9b61f72dc464989234;hb=b898f1271db5021e1873e38e1498a99d9450b646;hp=da58a3f06c3368d5db98f35881e2e73a70965ed5;hpb=3c598e89fb34a892d369a138daa8c3314294493c;p=openldap
diff --git a/libraries/libldap/modrdn.c b/libraries/libldap/modrdn.c
index da58a3f06c..5e4c45f997 100644
--- a/libraries/libldap/modrdn.c
+++ b/libraries/libldap/modrdn.c
@@ -1,7 +1,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software .
*
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2010 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,14 +23,21 @@
* 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
*/
+#include "portable.h"
+
+#include
+
+#include
+#include
+#include
+
+#include "ldap-int.h"
+
/*
* A modify rdn request looks like this:
* ModifyRDNRequest ::= SEQUENCE {
@@ -41,15 +48,6 @@
* }
*/
-#include "portable.h"
-
-#include
-
-#include
-#include
-#include
-
-#include "ldap-int.h"
/*
* ldap_rename - initiate an ldap extended modifyDN operation.
@@ -79,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 );
@@ -166,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 );
@@ -227,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;
}