]> git.sur5r.net Git - openldap/commitdiff
ITS#2117: remove suffixalias support until someone fixes it
authorKurt Zeilenga <kurt@openldap.org>
Sun, 9 Feb 2003 07:20:03 +0000 (07:20 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 9 Feb 2003 07:20:03 +0000 (07:20 +0000)
12 files changed:
servers/slapd/bind.c
servers/slapd/compare.c
servers/slapd/config.c
servers/slapd/delete.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/proto-slap.h
servers/slapd/saslauthz.c
servers/slapd/search.c
servers/slapd/slap.h
servers/slapd/slapi/slapi_ops.c
servers/slapd/suffixalias.c [deleted file]

index bd4816c4b32b2d0f7c86d8101af78bcc92b84a3c..34e18e58e8f2d2b543327951273fe57137fb77c5 100644 (file)
@@ -603,9 +603,6 @@ do_bind(
        if ( be->be_bind ) {
                int ret;
 
-               /* deref suffix alias if appropriate */
-               suffix_alias( be, &ndn );
-
                ret = (*be->be_bind)( be, conn, op,
                        &pdn, &ndn, method, &cred, &edn );
 
index 832c5eae8e0d2df4a6d4737e45fca6d7417a5235..b9c88d8d29c3085faf8a63f1b388f7cb95a9699c 100644 (file)
@@ -268,10 +268,6 @@ do_compare(
            op->o_connid, op->o_opid, pdn.bv_val,
                ava.aa_desc->ad_cname.bv_val, 0 );
 
-
-       /* deref suffix alias if appropriate */
-       suffix_alias( be, &ndn );
-
 #if defined( LDAP_SLAPI )
        slapi_x_backend_set_pb( pb, be );
        slapi_x_connection_set_pb( pb, conn );
index 42956da98b001acb47e4ab80d44cb54427b2eb93..c83f13148a75203b902a68ead92381e1773e07ea 100644 (file)
@@ -954,141 +954,6 @@ read_config( const char *fname, int depth )
                        ber_bvarray_add( &be->be_suffix, &pdn );
                        ber_bvarray_add( &be->be_nsuffix, &ndn );
 
-               /* set database suffixAlias */
-               } else if ( strcasecmp( cargv[0], "suffixAlias" ) == 0 ) {
-                       Backend *tmp_be;
-                       struct berval alias, palias, nalias;
-                       struct berval aliased, paliased, naliased;
-
-                       if ( cargc < 2 ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG( CONFIG, CRIT, 
-                                       "%s: line %d: missing alias and aliased_dn in "
-                                       "\"suffixAlias <alias> <aliased_dn>\" line.\n",
-                                       fname, lineno, 0 );
-#else
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s: line %d: missing alias and aliased_dn in "
-                                       "\"suffixAlias <alias> <aliased_dn>\" line.\n",
-                                       fname, lineno, 0 );
-#endif
-
-                               return( 1 );
-                       } else if ( cargc < 3 ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG( CONFIG, CRIT, 
-                                       "%s: line %d: missing aliased_dn in "
-                                       "\"suffixAlias <alias> <aliased_dn>\" line\n",
-                                       fname, lineno, 0 );
-#else
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s: line %d: missing aliased_dn in "
-                                       "\"suffixAlias <alias> <aliased_dn>\" line\n",
-                                       fname, lineno, 0 );
-#endif
-                               return( 1 );
-
-                       } else if ( cargc > 3 ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG( CONFIG, CRIT, 
-                                       "%s: line %d: extra cruft in suffixAlias line (ignored)\n",
-                                       fname, lineno, 0 );
-#else
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s: line %d: extra cruft in suffixAlias line (ignored)\n",
-                                       fname, lineno, 0 );
-#endif
-                       }
-
-                       if ( be == NULL ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG( CONFIG, INFO, 
-                                       "%s: line %d: suffix line must appear inside a database "
-                                       "definition.\n", fname, lineno, 0 );
-#else
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s: line %d: suffixAlias line"
-                                       " must appear inside a database definition.\n",
-                                       fname, lineno, 0 );
-#endif
-                               return 1;
-                       }
-
-                       if ( load_ucdata( NULL ) < 0 ) return 1;
-                       
-                       alias.bv_val = cargv[1];
-                       alias.bv_len = strlen( cargv[1] );
-
-                       rc = dnPrettyNormal( NULL, &alias, &palias, &nalias );
-                       if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG( CONFIG, CRIT, 
-                                       "%s: line %d: alias DN is invalid.\n", fname, lineno, 0 );
-#else
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s: line %d: alias DN is invalid\n",
-                                  fname, lineno, 0 );
-#endif
-                               return( 1 );
-                       }
-
-                       tmp_be = select_backend( &nalias, 0, 0 );
-                       free( nalias.bv_val );
-                       if ( tmp_be && tmp_be != be ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG( CONFIG, INFO, 
-                                       "%s: line %d: suffixAlias served by a preceeding "
-                                       "backend \"%s\"\n", fname, lineno, 
-                                       tmp_be->be_suffix[0].bv_val );
-#else
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s: line %d: suffixAlias served by"
-                                       "  a preceeding backend \"%s\"\n",
-                                       fname, lineno, tmp_be->be_suffix[0].bv_val );
-#endif
-                               free( palias.bv_val );
-                               return -1;
-                       }
-
-                       aliased.bv_val = cargv[2];
-                       aliased.bv_len = strlen( cargv[2] );
-
-                       rc = dnPrettyNormal( NULL, &aliased, &paliased, &naliased );
-                       if( rc != LDAP_SUCCESS ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG( CONFIG, CRIT, 
-                                       "%s: line %d: aliased DN is invalid.\n", fname, lineno,0 );
-#else
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s: line %d: aliased DN is invalid\n",
-                                  fname, lineno, 0 );
-#endif
-                               free( palias.bv_val );
-                               return( 1 );
-                       }
-
-                       tmp_be = select_backend( &naliased, 0, 0 );
-                       free( naliased.bv_val );
-                       if ( tmp_be && tmp_be != be ) {
-#ifdef NEW_LOGGING
-                               LDAP_LOG( CONFIG, INFO, 
-                                       "%s: line %d: suffixAlias derefs to a different backend "
-                                       "a preceeding backend \"%s\"\n",
-                                       fname, lineno, tmp_be->be_suffix[0].bv_val );
-#else
-                               Debug( LDAP_DEBUG_ANY,
-                                       "%s: line %d: suffixAlias derefs to differnet backend"
-                                       "  a preceeding backend \"%s\"\n",
-                                       fname, lineno, tmp_be->be_suffix[0].bv_val );
-#endif
-                               free( palias.bv_val );
-                               free( paliased.bv_val );
-                               return -1;
-                       }
-
-                       ber_bvarray_add( &be->be_suffixAlias, &palias ); 
-                       ber_bvarray_add( &be->be_suffixAlias, &paliased );
-
                /* set max deref depth */
                } else if ( strcasecmp( cargv[0], "maxDerefDepth" ) == 0 ) {
                                        int i;
index 4d14b040ec516cb6c107f4a14d5966a52c657339..02d37bd4228b1808a967d0f38302799afbd21699 100644 (file)
@@ -155,9 +155,6 @@ do_delete(
                goto cleanup;
        }
 
-       /* deref suffix alias if appropriate */
-       suffix_alias( be, &ndn );
-
 #if defined( LDAP_SLAPI )
        slapi_x_backend_set_pb( pb, be );
        slapi_x_connection_set_pb( pb, conn );
index a07396679c2fbc309b3fd7a64dddd25b5dca04b9..d57a9b7ca12301871cc5766008cfb8bc2bc364a8 100644 (file)
@@ -329,9 +329,6 @@ do_modify(
                goto cleanup;
        }
 
-       /* deref suffix alias if appropriate */
-       suffix_alias( be, &ndn );
-
 #if defined( LDAP_SLAPI )
        slapi_x_backend_set_pb( pb, be );
        slapi_x_connection_set_pb( pb, conn );
index 62f0c6a2a0eb97979599c9f22b9d45ffd73b817c..f496b92a35b60159ac465fddbbaa48d24ff4381a 100644 (file)
@@ -321,14 +321,8 @@ do_modrdn(
 
                        goto cleanup;
                }
-
-               /* deref suffix alias if appropriate */
-               suffix_alias( be, &nnewSuperior );
        }
 
-       /* deref suffix alias if appropriate */
-       suffix_alias( be, &ndn );
-
 #if defined( LDAP_SLAPI )
        slapi_x_backend_set_pb( pb, be );
        slapi_x_connection_set_pb( pb, conn );
index 4b26475dfc5f3655f659b80c992a35a0c13dee93..e2df5f9f6c56114646f52d52876faea4053df4fd 100644 (file)
@@ -1016,11 +1016,6 @@ LDAP_SLAPD_F (SLAP_EXTOP_MAIN_FN) starttls_extop;
  */
 LDAP_SLAPD_F (Filter *) str2filter LDAP_P(( const char *str ));
 
-/*
- * suffixalias.c
- */
-LDAP_SLAPD_F (void) suffix_alias LDAP_P(( Backend *be, struct berval *ndn ));
-
 /* syntax.c */
 LDAP_SLAPD_F (Syntax *) syn_find LDAP_P((
        const char *synname ));
index 75007d86f4d6d78358e1d4a84720db9bd2f1b10e..6726639f043b8ad58d9a37407477a2650a576d89 100644 (file)
@@ -463,7 +463,6 @@ int slap_sasl_match(Connection *conn, struct berval *rule, struct berval *assert
                rc = LDAP_INAPPROPRIATE_AUTH;
                goto CONCLUDED;
        }
-       suffix_alias( be, &searchbase );
 
        sm.dn = assertDN;
        sm.match = 0;
@@ -628,7 +627,6 @@ void slap_sasl2dn( Connection *conn,
        if(( be == NULL ) || ( be->be_search == NULL)) {
                goto FINISHED;
        }
-       suffix_alias( be, &dn );
 
        op.o_tag = LDAP_REQ_SEARCH;
        op.o_protocol = LDAP_VERSION3;
index d6e0bf9c476c4ba5665371ab703c246ec320bd23..fcac37b3cc8f5830d0b19c70a38ca6e7b5d55632 100644 (file)
@@ -382,9 +382,6 @@ do_search(
                goto return_results;
        }
 
-       /* deref the base if needed */
-       suffix_alias( be, &nbase );
-
 #ifdef LDAP_SLAPI
        attrs = anlist2charray( an );
        pb = initSearchPlugin( be, conn, op, &pbase,
index 0a63c1f969380d935c10cdcf5532289d3c9b8dfd..c5dff6c12610b142e4233c98c1ceaa2f525d2398 100644 (file)
@@ -1322,7 +1322,6 @@ struct slap_backend_db {
        /* these should be renamed from be_ to bd_ */
        BerVarray       be_suffix;      /* the DN suffixes of data in this backend */
        BerVarray       be_nsuffix;     /* the normalized DN suffixes in this backend */
-       BerVarray       be_suffixAlias; /* pairs of DN suffix aliases and deref values */
        struct berval be_schemadn;      /* per-backend subschema subentry DN */
        struct berval be_schemandn;     /* normalized subschema DN */
        struct berval be_rootdn;        /* the magic "root" name (DN) for this db */
index 650122460834ea7df5742fd79a9f655ebcd0a927..304f32d20ee0e0898d3e9d6bd2508b9da251d67a 100644 (file)
@@ -520,8 +520,6 @@ slapi_delete_internal(
        op->o_dn = pConn->c_dn = be->be_rootdn;
        op->o_ndn = pConn->c_ndn = be->be_rootndn;
 
-       suffix_alias( be, &ndn );
-
        if ( be->be_delete ) {
                int repl_user = be_isupdate( be, &op->o_ndn );
                if ( !be->be_update_ndn.bv_len || repl_user ) {
@@ -793,8 +791,6 @@ slapi_modrdn_internal(
        op->o_dn = pConn->c_dn = be->be_rootdn;
        op->o_ndn = pConn->c_ndn = be->be_rootndn;
 
-       suffix_alias( be, &ndn );
-
        if ( be->be_modrdn ) {
                int repl_user = be_isupdate( be, &op->o_ndn );
                if ( !be->be_update_ndn.bv_len || repl_user ) {
@@ -922,8 +918,6 @@ slapi_modify_internal(
        op->o_dn = pConn->c_dn = be->be_rootdn;
        op->o_ndn = pConn->c_ndn = be->be_rootndn;
 
-       suffix_alias( be, &ndn );
-
        for ( i = 0, pMod = mods[0]; rc == LDAP_SUCCESS && pMod != NULL; 
                        pMod = mods[++i] ) {
                Modifications *mod;
diff --git a/servers/slapd/suffixalias.c b/servers/slapd/suffixalias.c
deleted file mode 100644 (file)
index e42279d..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $OpenLDAP$ */
-/*
- * Copyright 1999-2003 The OpenLDAP Foundation, All Rights Reserved.
- *
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file in the top level
- * directory of this package.
- */
-/* Portions
- * Copyright (c) 1998 Will Ballantyne, ITSD, Government of BC
- * 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 ITSD, Government of BC. The name of ITSD
- * 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.
- */
-
-#include "portable.h"
-
-#include <stdio.h>
-#include <ac/string.h>
-#include <ac/socket.h>
-#include "slap.h"
-
-/* 
- * given a normalized uppercased dn (or root part),
- * return an aliased dn if any of the alias suffixes match
- */
-void suffix_alias(
-       Backend *be,
-       struct berval *dn )
-{
-       int     i, dnLength;
-
-       if(dn == NULL || be == NULL || dn->bv_len == 0)
-               return;
-
-       dnLength = dn->bv_len;
-
-       for ( i = 0;
-               be->be_suffixAlias != NULL && be->be_suffixAlias[i].bv_val != NULL;
-               i += 2 )
-       {
-               int aliasLength = be->be_suffixAlias[i].bv_len;
-               int diff = dnLength - aliasLength;
-
-               if ( diff < 0 ) {
-                       /* alias is longer than dn */
-                       continue;
-               } else if ( diff > 0 ) {
-                       if ( ! DN_SEPARATOR(dn->bv_val[diff-1]) ) {
-                               /* boundary is not at a DN separator */
-                               continue;
-                       }
-                       /* At a DN Separator */
-                       /* XXX or an escaped separator... oh well */
-               }
-
-               if (!strcmp(be->be_suffixAlias[i].bv_val, &dn->bv_val[diff])) {
-                       char *oldDN = dn->bv_val;
-                       dn->bv_len = diff + be->be_suffixAlias[i+1].bv_len;
-                       dn->bv_val = ch_malloc( dn->bv_len + 1 );
-                       strncpy( dn->bv_val, oldDN, diff );
-                       strcpy( &dn->bv_val[diff], be->be_suffixAlias[i+1].bv_val );
-#ifdef NEW_LOGGING
-                       LDAP_LOG( OPERATION, INFO, 
-                               "suffix_alias: converted \"%s\" to \"%s\"\n",
-                               oldDN, dn->bv_val, 0 );
-#else
-                       Debug( LDAP_DEBUG_ARGS,
-                               "suffix_alias: converted \"%s\" to \"%s\"\n",
-                               oldDN, dn->bv_val, 0);
-#endif
-
-                       free (oldDN);
-                       break;
-               }
-       }
-}