]> git.sur5r.net Git - openldap/commitdiff
remove dontusecopy ifdefs
authorKurt Zeilenga <kurt@openldap.org>
Tue, 22 Aug 2006 20:57:33 +0000 (20:57 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 22 Aug 2006 20:57:33 +0000 (20:57 +0000)
clients/tools/ldapcompare.c
clients/tools/ldapsearch.c
servers/slapd/controls.c
servers/slapd/slap.h
tests/scripts/test009-referral

index 5c42585f48eb3727640fd237c8b47ab32d322b9b..f7347c7b3d22f9147f8c158df17e25b2112089d6 100644 (file)
@@ -82,10 +82,8 @@ usage( void )
        fprintf( stderr, _("  b64value\tbase64 encoding of assertion value\n"));
 
        fprintf( stderr, _("Compare options:\n"));
-#ifdef LDAP_CONTROL_DONTUSECOPY
        fprintf( stderr, _("  -E [!]<ext>[=<extparam>] compare extensions (! indicates criticality)\n"));
        fprintf( stderr, _("             !dontUseCopy                (Don't Use Copy)\n"));
-#endif
        fprintf( stderr, _("  -z         Quiet mode,"
                " don't print anything, use return values\n"));
        tool_common_usage();
index e02ba915c89a97644c0fed1f7e5c53c1bca868e8..578bda60e6b43f526092517c9cf7f8a94492c44a 100644 (file)
@@ -122,10 +122,8 @@ usage( void )
        fprintf( stderr, _("  -A         retrieve attribute names only (no values)\n"));
        fprintf( stderr, _("  -b basedn  base dn for search\n"));
        fprintf( stderr, _("  -E [!]<ext>[=<extparam>] search extensions (! indicates criticality)\n"));
-#ifdef LDAP_CONTROL_DONTUSECOPY
-       fprintf( stderr, _("             !dontUseCopy                (Don't Use Copy)\n"));
-#endif
        fprintf( stderr, _("             [!]domainScope              (domain scope)\n"));
+       fprintf( stderr, _("             !dontUseCopy                (Don't Use Copy)\n"));
        fprintf( stderr, _("             [!]mv=<filter>              (matched values filter)\n"));
        fprintf( stderr, _("             [!]pr=<size>[/prompt|noprompt]   (paged results/prompt)\n"));
        fprintf( stderr, _("             [!]subentries[=true|false]  (subentries)\n"));
index 48a2640156409a3e12d180d841aea5fe7e16e295..857a13e57387e1887941f82a8001f43ad90cd4c8 100644 (file)
@@ -28,9 +28,7 @@ static SLAP_CTRL_PARSE_FN parseAssert;
 static SLAP_CTRL_PARSE_FN parsePreRead;
 static SLAP_CTRL_PARSE_FN parsePostRead;
 static SLAP_CTRL_PARSE_FN parseProxyAuthz;
-#ifdef SLAP_DONTUSECOPY
 static SLAP_CTRL_PARSE_FN parseDontUseCopy;
-#endif
 #ifdef SLAP_RELAX
 static SLAP_CTRL_PARSE_FN parseManageDIT;
 #endif
@@ -147,6 +145,11 @@ static struct slap_control control_defs[] = {
                SLAP_CTRL_GLOBAL|SLAP_CTRL_SEARCH|SLAP_CTRL_HIDE,
                NULL, NULL,
                parseDomainScope, LDAP_SLIST_ENTRY_INITIALIZER(next) },
+       { LDAP_CONTROL_DONTUSECOPY,
+               (int)offsetof(struct slap_control_ids, sc_dontUseCopy),
+               SLAP_CTRL_GLOBAL|SLAP_CTRL_INTROGATE|SLAP_CTRL_HIDE,
+               NULL, NULL,
+               parseDontUseCopy, LDAP_SLIST_ENTRY_INITIALIZER(next) },
        { LDAP_CONTROL_X_PERMISSIVE_MODIFY,
                (int)offsetof(struct slap_control_ids, sc_permissiveModify),
                SLAP_CTRL_MODIFY|SLAP_CTRL_HIDE,
@@ -174,13 +177,6 @@ static struct slap_control control_defs[] = {
                SLAP_CTRL_ACCESS|SLAP_CTRL_HIDE,
                NULL, NULL,
                parseNoOp, LDAP_SLIST_ENTRY_INITIALIZER(next) },
-#ifdef SLAP_DONTUSECOPY
-       { LDAP_CONTROL_DONTUSECOPY,
-               (int)offsetof(struct slap_control_ids, sc_dontUseCopy),
-               SLAP_CTRL_GLOBAL|SLAP_CTRL_INTROGATE|SLAP_CTRL_HIDE,
-               NULL, NULL,
-               parseDontUseCopy, LDAP_SLIST_ENTRY_INITIALIZER(next) },
-#endif
 #ifdef SLAP_RELAX
        { LDAP_CONTROL_RELAX,
                (int)offsetof(struct slap_control_ids, sc_manageDIT),
@@ -848,7 +844,6 @@ slap_remove_control(
        return rs->sr_err;
 }
 
-#ifdef SLAP_DONTUSECOPY
 static int parseDontUseCopy (
        Operation *op,
        SlapReply *rs,
@@ -872,7 +867,6 @@ static int parseDontUseCopy (
        op->o_dontUseCopy = SLAP_CONTROL_CRITICAL;
        return LDAP_SUCCESS;
 }
-#endif
 
 #ifdef SLAP_RELAX
 static int parseManageDIT (
index 5ed8fedd5812be499e333cf7890ac49e9d46a795..9e0bec8193147e7fa09b3a1a4e9f99d168cab52e 100644 (file)
@@ -67,8 +67,6 @@ LDAP_BEGIN_DECL
 #define LDAP_COLLECTIVE_ATTRIBUTES
 #define LDAP_COMP_MATCH
 #define LDAP_SYNC_TIMESTAMP
-
-#define SLAP_DONTUSECOPY
 #define SLAP_SORTEDRESULTS
 #endif
 
index 40118f8fcc3903a8e34ec7bbd9c0601f1841813b..2df3fde1eb711b3e5e3f898a9a792da70a4078ea 100755 (executable)
@@ -145,6 +145,18 @@ if test $RC != 0 ; then
        exit $RC
 fi
 
+echo "Testing dontUseCopy control..."
+$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
+       -E \!dontUseCopy \
+       'sn=jensen' >! $SEARCHOUT
+RC=$?
+if test $RC = 10 ; then
+       echo "ldapsearch failed as expected ($RC)"
+else
+       echo "ldapsearch did not error as expected ($RC)!"
+       test $KILLSERVERS != no && kill -HUP $KILLPIDS
+       exit $RC
+fi
 
 test $KILLSERVERS != no && kill -HUP $KILLPIDS