]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/modrdn.c
Merge remote-tracking branch 'origin/mdb.RE/0.9' into OPENLDAP_REL_ENG_2_4
[openldap] / libraries / libldap / modrdn.c
index 302ffa703f042febb8338eba9e7780fbbb2c7280..6980593630e9d812e6de764f203948d1bba94b60 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2015 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * 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 <stdio.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
+#include "ldap-int.h"
+
 /*
  * A modify rdn request looks like this:
  *     ModifyRDNRequest ::= SEQUENCE {
  *     }
  */
 
-#include "portable.h"
-
-#include <stdio.h>
-
-#include <ac/socket.h>
-#include <ac/string.h>
-#include <ac/time.h>
-
-#include "ldap-int.h"
 
 /*
  * ldap_rename - initiate an ldap extended modifyDN operation.
@@ -219,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;
        }