Commit 48d47954 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Rework #ifdef'ing of expermental controls to ease release engineering

using LDAP_DEVEL (to indicate experimental) to enable experimental features
(true for HEAD unless LDAP_REL_ENG is defined)
parent a256e503
......@@ -88,12 +88,17 @@
# include <stddef.h>
#endif
#ifndef LDAP_REL_ENG
#if (LDAP_VENDOR_VERSION == 000000) && !defined(LDAP_DEVEL)
#define LDAP_DEVEL
#endif
#if defined(LDAP_DEVEL) && !defined(LDAP_TEST)
#define LDAP_TEST
#endif
#if defined(LDAP_TEST) && !defined(LDAP_DEBUG)
#define LDAP_DEBUG
#endif
#endif
#ifdef HAVE_EBCDIC
/* ASCII/EBCDIC converting replacements for stdio funcs
......
......@@ -65,7 +65,9 @@ usage( void )
" -b basedn base dn for search\n"
" -E [!]<ctrl>[=<ctrlparam>] search controls (! indicates criticality)\n"
" [!]mv=<filter> (matched values filter)\n"
#ifdef LDAP_CONTROL_PAGEDRESULTS
" [!]pr=<size> (paged results)\n"
#endif
#ifdef LDAP_CONTROL_SUBENTRIES
" [!]subentries[=true|false] (subentries)\n"
#endif
......@@ -167,6 +169,7 @@ static struct berval sync_cookie = { 0, NULL };
static int sync_slimit = -1;
#endif
#ifdef LDAP_CONTROL_PAGEDRESULTS
static int pagedResults = 0;
static ber_int_t pageSize = 0;
static ber_int_t entriesLeft = 0;
......@@ -182,6 +185,7 @@ static int parse_page_control(
LDAP *ld,
LDAPMessage *result,
struct berval *cookie );
#endif
static void
urlize(char *url)
......@@ -266,6 +270,7 @@ handle_private_option( int i )
vrFilter = cvalue;
protocol = LDAP_VERSION3;
#ifdef LDAP_CONTROL_PAGEDRESULTS
} else if ( strcasecmp( control, "pr" ) == 0 ) {
int num, tmp;
/* PagedResults control */
......@@ -283,6 +288,7 @@ handle_private_option( int i )
pageSize = (ber_int_t) tmp;
pagedResults = 1 + crit;
#endif
#ifdef LDAP_CONTROL_SUBENTRIES
} else if ( strcasecmp( control, "subentries" ) == 0 ) {
if( subentries ) {
......@@ -508,8 +514,10 @@ main( int argc, char **argv )
struct berval *syncbvalp = NULL;
#endif
#ifdef LDAP_CONTROL_PAGEDRESULTS
npagedresponses = npagedentries = npagedreferences =
npagedextended = npagedpartial = 0;
#endif
prog = lutil_progname( "ldapsearch", argc, argv );
......@@ -600,8 +608,10 @@ main( int argc, char **argv )
tool_bind( ld );
getNextPage:
if ( manageDSAit || noop || subentries
|| valuesReturnFilter || pageSize
if ( manageDSAit || noop || subentries || valuesReturnFilter
#ifdef LDAP_CONTROL_PAGEDRESULTS
|| pageSize
#endif
#ifdef LDAP_CLIENT_UPDATE
|| lcup
#endif
......@@ -716,6 +726,7 @@ getNextPage:
i++;
}
#ifdef LDAP_CONTROL_PAGEDRESULTS
if ( pagedResults ) {
if (( prber = ber_alloc_t(LBER_USE_DER)) == NULL ) {
return EXIT_FAILURE;
......@@ -730,6 +741,7 @@ getNextPage:
c[i].ldctl_iscritical = pagedResults > 1;
i++;
}
#endif
tool_server_controls( ld, c, i );
......@@ -796,11 +808,13 @@ getNextPage:
printf("\n# with valuesReturnFilter %scontrol: %s",
valuesReturnFilter > 1 ? "critical " : "", vrFilter );
}
#ifdef LDAP_CONTROL_PAGEDRESULTS
if ( pageSize ) {
printf("\n# with pagedResults %scontrol: size=%d",
(pagedResults > 1) ? "critical " : "",
pageSize );
}
#endif
printf( "\n#\n\n" );
}
......@@ -827,7 +841,8 @@ getNextPage:
}
}
if ( ( pageSize != 0 ) && ( morePagedResults != 0 ) ) {
#ifdef LDAP_CONTROL_PAGEDRESULTS
if ( ( pageSize != 0 ) && ( morePagedResults != 0 ) ) {
char buf[6];
int i, moreEntries, tmpSize;
......@@ -862,6 +877,7 @@ getNextPage:
goto getNextPage;
}
#endif
ldap_unbind( ld );
return( rc );
......@@ -996,9 +1012,11 @@ static int dosearch(
case LDAP_RES_SEARCH_RESULT:
rc = print_result( ld, msg, 1 );
#ifdef LDAP_CONTROL_PAGEDRESULTS
if ( pageSize != 0 ) {
rc = parse_page_control( ld, msg, &cookie );
}
#endif
#ifdef LDAP_CLIENT_UPDATE
if ( lcup == LDAP_CUP_PERSIST_ONLY ||
......@@ -1067,6 +1085,7 @@ static int dosearch(
}
done:
#ifdef LDAP_CONTROL_PAGEDRESULTS
if ( pageSize != 0 ) {
npagedresponses = npagedresponses + nresponses;
npagedentries = npagedentries + nentries;
......@@ -1080,7 +1099,9 @@ done:
if( npartial ) printf( "# numPartial: %d\n", npagedpartial );
if( nreferences ) printf( "# numReferences: %d\n", npagedreferences );
}
} else if ( ldif < 2 ) {
} else
#endif
if ( ldif < 2 ) {
printf( "\n# numResponses: %d\n", nresponses );
if( nentries ) printf( "# numEntries: %d\n", nentries );
if( nextended ) printf( "# numExtended: %d\n", nextended );
......@@ -1583,6 +1604,7 @@ write_ldif( int type, char *name, char *value, ber_len_t vallen )
}
#ifdef LDAP_CONTROL_PAGEDRESULTS
static int
parse_page_control(
LDAP *ld,
......@@ -1597,7 +1619,6 @@ parse_page_control(
ber_tag_t tag;
struct berval servercookie = { 0, NULL };
rc = ldap_parse_result( ld, result,
&err, NULL, NULL, NULL, &ctrl, 0 );
......@@ -1616,6 +1637,7 @@ parse_page_control(
* size INTEGER (0..maxInt),
* -- result set size estimate from server - unused
* cookie OCTET STRING
* }
*/
ctrlp = *ctrl;
ber = ber_init( &ctrlp->ldctl_value );
......@@ -1629,20 +1651,23 @@ parse_page_control(
(void) ber_free( ber, 1 );
if( tag == LBER_ERROR ) {
fprintf( stderr, "Paged results response control could not be decoded.\n" );
fprintf( stderr,
"Paged results response control could not be decoded.\n" );
return EXIT_FAILURE;
}
if( entriesLeft < 0 ) {
fprintf( stderr, "Invalid entries estimate in paged results response.\n" );
fprintf( stderr,
"Invalid entries estimate in paged results response.\n" );
return EXIT_FAILURE;
}
ldap_controls_free( ctrl );
} else {
morePagedResults = 0;
}
return err;
}
#endif
......@@ -143,7 +143,6 @@ LDAP_BEGIN_DECL
#define LDAP_OPT_X_SASL_SSF_MAX 0x6108
#define LDAP_OPT_X_SASL_MAXBUFSIZE 0x6109
/* on/off values */
#define LDAP_OPT_ON ((void *) 1)
#define LDAP_OPT_OFF ((void *) 0)
......@@ -181,18 +180,11 @@ typedef struct ldapcontrol {
} LDAPControl;
/* LDAP Controls */
#if 0
/* chase referrals client control (not yet implemented) */
#define LDAP_CONTROL_REFERRALS "1.2.840.113666.1.4.616"
#define LDAP_CHASE_SUBORDINATE_REFERRALS 0x0020U
#define LDAP_CHASE_EXTERNAL_REFERRALS 0x0040U
#endif
#define LDAP_CONTROL_PROXY_AUTHZ "2.16.840.1.113730.3.4.18"
#define LDAP_CONTROL_MANAGEDSAIT "2.16.840.1.113730.3.4.2"
#define LDAP_CONTROL_VALUESRETURNFILTER "1.2.826.0.1.334810.2.3"
#define LDAP_CONTROL_SUBENTRIES "1.3.6.1.4.1.4203.1.10.1"
#define LDAP_CONTROL_NOOP "1.3.6.1.4.1.4203.1.10.2"
#define LDAP_CONTROL_MANAGEDSAIT "2.16.840.1.113730.3.4.2"
#define LDAP_CONTROL_PROXY_AUTHZ "2.16.840.1.113730.3.4.18"
#if 0
#define LDAP_CONTROL_DUPENT_REQUEST "2.16.840.1.113719.1.27.101.1"
......@@ -201,12 +193,14 @@ typedef struct ldapcontrol {
#define LDAP_CONTROL_DUPENT LDAP_CONTROL_DUPENT_REQUEST
#endif
#ifdef LDAP_DEVEL
#define LDAP_CONTROL_PAGEDRESULTS "1.2.840.113556.1.4.319"
#endif
/*
#ifdef LDAP_DEVEL
#define LDAP_CLIENT_UPDATE 1
#define LDAP_SYNC 2
*/
#endif
#ifdef LDAP_CLIENT_UPDATE
#define LDAP_CONTROL_CLIENT_UPDATE "1.3.6.1.4.1.4203.666.5.3"
......@@ -235,10 +229,10 @@ typedef struct ldapcontrol {
#define LDAP_CONTROL_VLVREQUEST "2.16.840.1.113730.3.4.9"
#define LDAP_CONTROL_VLVRESPONSE "2.16.840.1.113730.3.4.10"
#define LDAP_CONTROL_VALUESRETURNFILTER "1.2.826.0.1.334810.2.3"
#ifdef LDAP_DEVEL
#define LDAP_CONTROL_PERMITMODIFY "1.2.840.113556.1.4.1413"
#define LDAP_CONTROL_NOREFERRALS "1.2.840.113556.1.4.1339"
#endif
/* LDAP Unsolicited Notifications */
#define LDAP_NOTICE_OF_DISCONNECTION "1.3.6.1.4.1.1466.20036"
......@@ -253,7 +247,9 @@ typedef struct ldapcontrol {
#define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW ((ber_tag_t) 0x82U)
#define LDAP_TAG_EXOP_MODIFY_PASSWD_GEN ((ber_tag_t) 0x80U)
#ifdef LDAP_DEVEL
#define LDAP_EXOP_X_CANCEL "1.3.6.1.4.1.4203.666.6.3"
#endif
#define LDAP_EXOP_X_WHO_AM_I "1.3.6.1.4.1.4203.1.11.3"
/* LDAP Features */
......@@ -288,21 +284,9 @@ typedef struct ldapcontrol {
#define LDAP_TAG_MESSAGE ((ber_tag_t) 0x30U) /* constructed + 16 */
#define LDAP_TAG_MSGID ((ber_tag_t) 0x02U) /* integer */
#ifdef LDAP_CLIENT_UPDATE
#define LDAP_TAG_INTERVAL ((ber_tag_t) 0x02U) /* integer */
#endif /* LDAP_CLIENT_UPDATE */
#define LDAP_TAG_LDAPDN ((ber_tag_t) 0x04U) /* octet string */
#define LDAP_TAG_LDAPCRED ((ber_tag_t) 0x04U) /* octet string */
#ifdef LDAP_CLIENT_UPDATE
#define LDAP_LCUP_TAG_COOKIE ((ber_tag_t) 0x30U) /* sequence */
#endif
#ifdef LDAP_SYNC
#define LDAP_SYNC_TAG_COOKIE ((ber_tag_t) 0x04U) /* octet string */
#endif
#define LDAP_TAG_CONTROLS ((ber_tag_t) 0xa0U) /* context specific + constructed + 0 */
#define LDAP_TAG_REFERRAL ((ber_tag_t) 0xa3U) /* context specific + constructed + 3 */
......@@ -315,6 +299,15 @@ typedef struct ldapcontrol {
#define LDAP_TAG_SASL_RES_CREDS ((ber_tag_t) 0x87U) /* context specific + primitive */
#ifdef LDAP_CLIENT_UPDATE
#define LDAP_TAG_INTERVAL ((ber_tag_t) 0x02U) /* integer */
#define LDAP_LCUP_TAG_COOKIE ((ber_tag_t) 0x30U) /* sequence */
#endif
#ifdef LDAP_SYNC
#define LDAP_SYNC_TAG_COOKIE ((ber_tag_t) 0x04U) /* octet string */
#endif
/* possible operations a client can invoke */
#define LDAP_REQ_BIND ((ber_tag_t) 0x60U) /* application + constructed */
......@@ -344,7 +337,9 @@ typedef struct ldapcontrol {
#define LDAP_RES_COMPARE ((ber_tag_t) 0x6fU) /* application + constructed */
#define LDAP_RES_EXTENDED ((ber_tag_t) 0x78U) /* V3: application + constructed */
#define LDAP_RES_EXTENDED_PARTIAL ((ber_tag_t) 0x79U) /* V3+: application + constructed */
#ifdef LDAP_DEVEL
#define LDAP_RES_INTERMEDIATE_RESP ((ber_tag_t) 0x7aU)
#endif
#define LDAP_RES_ANY (-1)
#define LDAP_RES_UNSOLICITED (0)
......@@ -493,31 +488,33 @@ typedef struct ldapcontrol {
#ifdef LDAP_CLIENT_UPDATE
/* resultCode for LCUP */
#define LDAP_CUP_RESOURCES_EXHAUSTED 0x62
#define LDAP_CUP_SECURITY_VIOLATION 0x63
#define LDAP_CUP_INVALID_COOKIE 0x64
#define LDAP_CUP_UNSUPPORTED_SCHEME 0x65
#define LDAP_CUP_CLIENT_DISCONNECT 0x66
#define LDAP_CUP_RELOAD_REQUIRED 0x67
#define LDAP_CUP_RESOURCES_EXHAUSTED 0x100
#define LDAP_CUP_SECURITY_VIOLATION 0x101
#define LDAP_CUP_INVALID_COOKIE 0x102
#define LDAP_CUP_UNSUPPORTED_SCHEME 0x103
#define LDAP_CUP_CLIENT_DISCONNECT 0x104
#define LDAP_CUP_RELOAD_REQUIRED 0x105
#endif
#ifdef LDAP_EXOP_X_CANCEL
/* resultCode for Cancel Response */
#define LDAP_CANCELLED 0x68
#define LDAP_NO_SUCH_OPERATION 0x69
#define LDAP_TOO_LATE 0x6a
#define LDAP_CANNOT_CANCEL 0x6b
#define LDAP_CANCEL_NONE 0x00
#define LDAP_CANCEL_REQ 0x01
#define LDAP_CANCEL_ACK 0x02
#define LDAP_CANCEL_DONE 0x03
#define LDAP_CANCELLED 0x110
#define LDAP_NO_SUCH_OPERATION 0x111
#define LDAP_TOO_LATE 0x112
#define LDAP_CANNOT_CANCEL 0x113
#define LDAP_CANCEL_NONE 0x00
#define LDAP_CANCEL_REQ 0x01
#define LDAP_CANCEL_ACK 0x02
#define LDAP_CANCEL_DONE 0x03
#endif
#ifdef LDAP_CLIENT_UPDATE
/* LCUP update type */
#define LDAP_CUP_NONE 0x00
#define LDAP_CUP_SYNC_ONLY 0x01
#define LDAP_CUP_PERSIST_ONLY 0x02
#define LDAP_CUP_SYNC_AND_PERSIST 0x03
#define LDAP_CUP_NONE 0x00
#define LDAP_CUP_SYNC_ONLY 0x01
#define LDAP_CUP_PERSIST_ONLY 0x02
#define LDAP_CUP_SYNC_AND_PERSIST 0x03
/* LCUP default cookie interval */
#define LDAP_CUP_DEFAULT_SEND_COOKIE_INTERVAL 0x01
......@@ -525,8 +522,8 @@ typedef struct ldapcontrol {
/* LDAP SYNC request type */
#ifdef LDAP_SYNC
#define LDAP_SYNC_NONE 0x00
#define LDAP_SYNC_REFRESH_ONLY 0x01
#define LDAP_SYNC_NONE 0x00
#define LDAP_SYNC_REFRESH_ONLY 0x01
#define LDAP_SYNC_REFRESH_AND_PERSIST 0x03
#endif
......@@ -1261,9 +1258,9 @@ typedef struct ldap_ava {
struct berval la_attr;
struct berval la_value;
unsigned la_flags;
#define LDAP_AVA_STRING 0x0000U
#define LDAP_AVA_BINARY 0x0001U
#define LDAP_AVA_NONPRINTABLE 0x0002U
#define LDAP_AVA_STRING 0x0000U
#define LDAP_AVA_BINARY 0x0001U
#define LDAP_AVA_NONPRINTABLE 0x0002U
void *la_private;
} LDAPAVA;
......@@ -1272,28 +1269,25 @@ typedef LDAPAVA** LDAPRDN;
typedef LDAPRDN** LDAPDN;
/* DN formats */
#define LDAP_DN_FORMAT_LDAP 0x0000U
#define LDAP_DN_FORMAT_LDAP 0x0000U
#define LDAP_DN_FORMAT_LDAPV3 0x0010U
#define LDAP_DN_FORMAT_LDAPV2 0x0020U
#define LDAP_DN_FORMAT_DCE 0x0030U
#define LDAP_DN_FORMAT_UFN 0x0040U /* dn2str only */
#define LDAP_DN_FORMAT_DCE 0x0030U
#define LDAP_DN_FORMAT_UFN 0x0040U /* dn2str only */
#define LDAP_DN_FORMAT_AD_CANONICAL 0x0050U /* dn2str only */
#define LDAP_DN_FORMAT_LBER 0x00F0U /* for testing only */
#define LDAP_DN_FORMAT_MASK 0x00F0U
#define LDAP_DN_FORMAT_LBER 0x00F0U /* for testing only */
#define LDAP_DN_FORMAT_MASK 0x00F0U
/* DN flags */
#define LDAP_DN_PRETTY 0x0100U
#define LDAP_DN_SKIP 0x0200U
#define LDAP_DN_PRETTY 0x0100U
#define LDAP_DN_SKIP 0x0200U
#define LDAP_DN_P_NOLEADTRAILSPACES 0x1000U
#define LDAP_DN_P_NOSPACEAFTERRDN 0x2000U
#define LDAP_DN_PEDANTIC 0xF000U
#define LDAP_DN_PEDANTIC 0xF000U
LDAP_F( void )
ldap_avafree LDAP_P(( LDAPAVA *ava ));
LDAP_F( void )
ldap_rdnfree LDAP_P(( LDAPRDN *rdn ));
LDAP_F( void )
ldap_dnfree LDAP_P(( LDAPDN *dn ));
LDAP_F( void ) ldap_avafree LDAP_P(( LDAPAVA *ava ));
LDAP_F( void ) ldap_rdnfree LDAP_P(( LDAPRDN *rdn ));
LDAP_F( void ) ldap_dnfree LDAP_P(( LDAPDN *dn ));
LDAP_F( int )
ldap_bv2dn LDAP_P((
......
......@@ -1039,12 +1039,17 @@
# include <stddef.h>
#endif
#ifndef LDAP_REL_ENG
#if (LDAP_VENDOR_VERSION == 000000) && !defined(LDAP_DEVEL)
#define LDAP_DEVEL
#endif
#if defined(LDAP_DEVEL) && !defined(LDAP_TEST)
#define LDAP_TEST
#endif
#if defined(LDAP_TEST) && !defined(LDAP_DEBUG)
#define LDAP_DEBUG
#endif
#endif
#ifdef HAVE_EBCDIC
/* ASCII/EBCDIC converting replacements for stdio funcs
......
......@@ -20,6 +20,8 @@
#include "ldap-int.h"
#include "ldap_log.h"
#ifdef LDAP_EXOP_X_CANCEL
int
ldap_cancel(
LDAP *ld,
......@@ -60,3 +62,5 @@ ldap_cancel_s(
ber_free( cancelidber, 1 );
return rc;
}
#endif /* LDAP_EXOP_X_CANCEL */
......@@ -92,18 +92,22 @@ static struct ldaperror ldap_builtin_errlist[] = {
{LDAP_MORE_RESULTS_TO_RETURN, "More results to return" },
{LDAP_CLIENT_LOOP, "Client Loop" },
{LDAP_REFERRAL_LIMIT_EXCEEDED, "Referral Limit Exceeded" },
#ifdef LDAP_CLIENT_UPDATE
{LDAP_CUP_RESOURCES_EXHAUSTED, "LDAP Client Update Resource Exhausted" },
{LDAP_CUP_SECURITY_VIOLATION, "LDAP Client Update Security Violation" },
{LDAP_CUP_INVALID_COOKIE, "LDAP Client Update Invalid Cookie" },
{LDAP_CUP_UNSUPPORTED_SCHEME, "LDAP Client Update Unsupported Scheme" },
{LDAP_CUP_CLIENT_DISCONNECT, "LDAP Client Update Client Disconnect" },
{LDAP_CUP_RELOAD_REQUIRED, "LDAP Client Update Reload Required" },
{LDAP_CUP_RESOURCES_EXHAUSTED, "Client Update Resource Exhausted" },
{LDAP_CUP_SECURITY_VIOLATION, "Client Update Security Violation" },
{LDAP_CUP_INVALID_COOKIE, "Client Update Invalid Cookie" },
{LDAP_CUP_UNSUPPORTED_SCHEME, "Client Update Unsupported Scheme" },
{LDAP_CUP_CLIENT_DISCONNECT, "Client Update Client Disconnect" },
{LDAP_CUP_RELOAD_REQUIRED, "Client Update Reload Required" },
#endif
#ifdef LDAP_EXOP_X_CANCEL
{LDAP_CANCELLED, "Cancelled" },
{LDAP_NO_SUCH_OPERATION, "No Operation to Cancel" },
{LDAP_TOO_LATE, "Too Late to Cancel" },
{LDAP_CANNOT_CANCEL, "Cannot Cancel" },
#endif
{LDAP_CANCELLED, "LDAP Cancelled" },
{LDAP_NO_SUCH_OPERATION, "LDAP No Operation to Cancel" },
{LDAP_TOO_LATE, "LDAP Too Late to Cancel" },
{LDAP_CANNOT_CANCEL, "LDAP Cannot Cancel" },
{-1, NULL}
};
......
......@@ -394,6 +394,7 @@ free_and_return:
return LDAP_SUCCESS;
}
#ifdef LDAP_RES_INTERMEDIATE_RESP
/* Parse an intermediate response result */
int
ldap_parse_intermediate_resp_result (
......@@ -508,3 +509,4 @@ ldap_parse_intermediate_resp_result (
return LDAP_SUCCESS;
}
#endif
......@@ -645,8 +645,11 @@ retry_ber:
* go through the following code. This code also chases V2 referrals
* and checks if all referrals have been chased.
*/
if ( (tag != LDAP_RES_SEARCH_ENTRY) && (v3ref > -1) &&
(tag != LDAP_RES_INTERMEDIATE_RESP ) ) {
if ( (tag != LDAP_RES_SEARCH_ENTRY) && (v3ref > -1)
#ifdef LDAP_RES_INTERMEDIATE_RESP
&& (tag != LDAP_RES_INTERMEDIATE_RESP )
#endif
) {
/* For a v3 search referral/reference, only come here if already chased it */
if ( ld->ld_version >= LDAP_VERSION2 &&
( lr->lr_parent != NULL ||
......
......@@ -535,7 +535,9 @@ bdb_initialize(
static char *controls[] = {
LDAP_CONTROL_MANAGEDSAIT,
LDAP_CONTROL_NOOP,
#ifdef LDAP_CONTROL_PAGEDRESULTS
LDAP_CONTROL_PAGEDRESULTS,
#endif
LDAP_CONTROL_VALUESRETURNFILTER,
#ifdef LDAP_CONTROL_SUBENTRIES
LDAP_CONTROL_SUBENTRIES,
......
......@@ -56,7 +56,8 @@ int bdb_modify_internal(
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: add\n", 0, 0, 0);
#endif
err = modify_add_values( e, mod, op->o_permitmodify, text, textbuf, textlen );
err = modify_add_values( e, mod, get_permitmodify(op),
text, textbuf, textlen );
if( err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
......@@ -75,7 +76,8 @@ int bdb_modify_internal(
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: delete\n", 0, 0, 0);
#endif
err = modify_delete_values( e, mod, op->o_permitmodify, text, textbuf, textlen );
err = modify_delete_values( e, mod, get_permitmodify(op),
text, textbuf, textlen );
assert( err != LDAP_TYPE_OR_VALUE_EXISTS );
if( err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
......@@ -95,7 +97,8 @@ int bdb_modify_internal(
#else
Debug(LDAP_DEBUG_ARGS, "bdb_modify_internal: replace\n", 0, 0, 0);
#endif
err = modify_replace_values( e, mod, op->o_permitmodify, text, textbuf, textlen );
err = modify_replace_values( e, mod, get_permitmodify(op),
text, textbuf, textlen );
if( err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
......@@ -119,7 +122,8 @@ int bdb_modify_internal(
*/
mod->sm_op = LDAP_MOD_ADD;
err = modify_add_values( e, mod, op->o_permitmodify, text, textbuf, textlen );
err = modify_add_values( e, mod, get_permitmodify(op),
text, textbuf, textlen );
if ( err == LDAP_TYPE_OR_VALUE_EXISTS ) {
err = LDAP_SUCCESS;
}
......
......@@ -61,7 +61,6 @@ bdb_search(
struct berval realbase = { 0, NULL };
int nentries = 0;
int manageDSAit;
int pagedresults;
int tentries = 0;
ID lastid = NOID;
......@@ -125,7 +124,6 @@ bdb_search(
manageDSAit = get_manageDSAit( op );
pagedresults = get_pagedresults( op );
rc = LOCK_ID (bdb->bi_dbenv, &locker );
......@@ -312,7 +310,7 @@ dn2entry_retry:
/* if no limit is required, use soft limit */
if ( slimit <= 0 ) {
if ( pagedresults && limit->lms_s_pr != 0 ) {
if ( get_pagedresults(op) && limit->lms_s_pr != 0 ) {
slimit = limit->lms_s_pr;
} else {
slimit = limit->lms_s_soft;
......@@ -396,7 +394,8 @@ dn2entry_retry:
tentries = BDB_IDL_N(candidates);
}
if ( pagedresults ) {
#ifdef LDAP_CONTROL_PAGEDRESULTS
if ( get_pagedresults(op) ) {
if ( op->o_pagedresults_state.ps_cookie == 0 ) {
id = 0;
} else {
......@@ -427,6 +426,7 @@ dn2entry_retry:
}
goto loop_begin;
}
#endif
#ifdef LDAP_CLIENT_UPDATE
if ( op->o_clientupdate_type & SLAP_LCUP_SYNC ) {
......@@ -498,6 +498,7 @@ loop_begin:
goto done;
}
#ifdef LDAP_EXOP_X_CANCEL
if ( op->o_cancel ) {
assert( op->o_cancel == LDAP_CANCEL_REQ );
rc = 0;
......@@ -506,6 +507,7 @@ loop_begin:
op->o_cancel = LDAP_CANCEL_ACK;
goto done;
}
#endif
/* check time limit */
if ( tlimit != -1 && slap_get_time() > stoptime ) {
......@@ -717,13 +719,16 @@ id2entry_retry:
goto done;
}