#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/*
* Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*/
/*
* rename.c
*/
#if 0
#ifndef lint
static char copyright[] = "@(#) Copyright (c) 1990 Regents of the University of Michigan.\nAll rights reserved.\n";
#endif
#endif
#include "ldap-int.h"
/*
* ldap_rename - initiate an ldap modifyDN operation. Parameters:
*
* ld LDAP descriptor
* dn DN of the object to modify
* newrdn RDN that will form leftmost component of entry's new name
* newparent if present, this is the Distinguished Name of the entry
* which becomes the immediate parent of the existing entry
* deleteoldrdn nonzero means to delete old rdn values from the entry
* while zero means to retain them as attributes of the entry
* serverctrls list of LDAP server controls
* clientctrls list of client controls
* msgidp this result parameter will be set to the message id of the
* request if the ldap_rename() call succeeds
*
* Example:
* int rc;
* rc = ldap_rename( ld, dn, newrdn, newparent, deleteoldrdn, serverctrls, clientctrls, &msgid );
*/
int
const char *dn,
const char *newrdn,
const char *newparent,
int deleteoldrdn,
int *msgidp
)
{
/*
* A modify dn request looks like this:
* ModifyDNRequest ::= SEQUENCE {
* entry LDAPDN,
* newrdn RelativeLDAPDN,
* newparent [0] LDAPDN OPTIONAL,
* deleteoldrdn BOOLEAN
* }
*/
if ( !NSLDAPI_VALID_LDAP_POINTER( ld )) {
return( LDAP_PARAM_ERROR );
}
return( LDAP_PARAM_ERROR );
}
/* only ldapv3 or higher can do a proper rename
*/
|| (clientctrls != NULL))) {
return( LDAP_NOT_SUPPORTED );
}
return( LDAP_PARAM_ERROR );
}
/* see if modRDN or modDN is handled by the cache */
if ( ld->ld_cache_on ) {
!= 0 ) {
return( LDAP_SUCCESS );
}
#if 0
deleteoldrdn )) != 0 ) {
return( LDAP_SUCCESS );
}
#endif
}
}
/* create a message to send */
!= LDAP_SUCCESS ) {
return( err );
}
/* fill it in */
return( LDAP_ENCODING_ERROR );
}
return( LDAP_ENCODING_ERROR );
}
} else {
== -1 ) {
return( LDAP_ENCODING_ERROR );
}
}
!= LDAP_SUCCESS ) {
return( rc );
}
/* send the message */
}
int
{
int msgid;
return( msgid );
} else {
return( -1 ); /* error is in ld handle */
}
}
int
{
}
int
const char *dn,
const char *newrdn,
const char *newparent,
int deleteoldrdn,
)
{
int msgid;
if ( ldap_rename( ld, dn, newrdn, newparent, deleteoldrdn, serverctrls, clientctrls, &msgid ) != LDAP_SUCCESS ) {
}
if ( msgid == -1 )
}
int
{
int msgid;
}
int
{
}