]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-shell/modrdn.c
ITS#4310 seems to affect also back-ldbm
[openldap] / servers / slapd / back-shell / modrdn.c
index ddffb9149318afca99636e4e3227933144117cb4..1d660a3920b272c17262e99f7e5bfb38b2524846 100644 (file)
@@ -1,21 +1,31 @@
 /* modrdn.c - shell backend modrdn function */
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
- */
-
-/*
- * LDAP v3 newSuperior support.
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999, Juan C. Gomez, All rights reserved.
- * This software is not subject to any license of Silicon Graphics 
- * Inc. or Purdue University.
+ * Copyright 1998-2006 The OpenLDAP Foundation.
+ * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * without restriction or fee of any kind as long as this notice
- * is preserved.
+ * 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) 1995 Regents of the University of Michigan.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that this notice is preserved and that due credit is given
+ * to the University of Michigan at Ann Arbor. The name of the University
+ * may not be used to endorse or promote products derived from this
+ * software without specific prior written permission. This software
+ * is provided ``as is'' without express or implied warranty.
+ */
+/* ACKNOWLEDGEMENTS:
+ * This work was originally developed by the University of Michigan
+ * (as part of U-MICH LDAP).
  */
 
 #include "portable.h"
@@ -53,8 +63,9 @@ shell_back_modrdn(
        e.e_bv.bv_val = NULL;
        e.e_private = NULL;
 
-       if ( ! access_allowed( op, &e,
-               entry, NULL, ACL_WRITE, NULL ) )
+       if ( ! access_allowed( op, &e, entry, NULL,
+                       op->oq_modrdn.rs_newSup ? ACL_WDEL : ACL_WRITE,
+                       NULL ) )
        {
                send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, NULL );
                return -1;
@@ -73,7 +84,7 @@ shell_back_modrdn(
        fprintf( wfp, "dn: %s\n", op->o_req_dn.bv_val );
        fprintf( wfp, "newrdn: %s\n", op->oq_modrdn.rs_newrdn.bv_val );
        fprintf( wfp, "deleteoldrdn: %d\n", op->oq_modrdn.rs_deleteoldrdn ? 1 : 0 );
-       if (op->oq_modrdn.rs_newSup != NULL) {
+       if ( op->oq_modrdn.rs_newSup != NULL ) {
                fprintf( wfp, "newSuperior: %s\n", op->oq_modrdn.rs_newSup->bv_val );
        }
        fclose( wfp );