From: Kurt Zeilenga Date: Tue, 22 Aug 2006 20:57:33 +0000 (+0000) Subject: remove dontusecopy ifdefs X-Git-Tag: OPENLDAP_REL_ENG_2_3_MP~264 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3d667a470546b1470489db09504ecebed14dd158;p=openldap remove dontusecopy ifdefs --- diff --git a/clients/tools/ldapcompare.c b/clients/tools/ldapcompare.c index 5c42585f48..f7347c7b3d 100644 --- a/clients/tools/ldapcompare.c +++ b/clients/tools/ldapcompare.c @@ -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 [!][=] 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(); diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index e02ba915c8..578bda60e6 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -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 [!][=] 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= (matched values filter)\n")); fprintf( stderr, _(" [!]pr=[/prompt|noprompt] (paged results/prompt)\n")); fprintf( stderr, _(" [!]subentries[=true|false] (subentries)\n")); diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 48a2640156..857a13e573 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -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 ( diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 5ed8fedd58..9e0bec8193 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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 diff --git a/tests/scripts/test009-referral b/tests/scripts/test009-referral index 40118f8fcc..2df3fde1eb 100755 --- a/tests/scripts/test009-referral +++ b/tests/scripts/test009-referral @@ -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