/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* Note: tags in a choice are always explicit
*/
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, ARGS, "ldap_pvt_put_filter: \"%s\"\n", str_in,0,0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_filter: \"%s\"\n", str_in, 0, 0 );
-#endif
freeme = LDAP_STRDUP( str_in );
if( freeme == NULL ) return LDAP_NO_MEMORY;
switch ( *str ) {
case '&':
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: AND\n", 0,0,0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_filter: AND\n",
0, 0, 0 );
-#endif
str = put_complex_filter( ber, str,
LDAP_FILTER_AND, 0 );
break;
case '|':
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: OR\n", 0,0,0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_filter: OR\n",
0, 0, 0 );
-#endif
str = put_complex_filter( ber, str,
LDAP_FILTER_OR, 0 );
break;
case '!':
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: NOT\n", 0,0,0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_filter: NOT\n",
0, 0, 0 );
-#endif
str = put_complex_filter( ber, str,
LDAP_FILTER_NOT, 0 );
break;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: simple\n", 0,0,0);
-#else
Debug( LDAP_DEBUG_TRACE, "put_filter: simple\n",
0, 0, 0 );
-#endif
balance = 1;
escape = 0;
break;
case /*'('*/ ')':
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: end\n", 0,0,0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_filter: end\n",
0, 0, 0 );
-#endif
if ( ber_printf( ber, /*"["*/ "]" ) == -1 ) {
rc = -1;
goto done;
break;
default: /* assume it's a simple type=value filter */
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, DETAIL1, "ldap_pvt_put_filter: default\n", 0,0,0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_filter: default\n",
0, 0, 0 );
-#endif
next = strchr( str, '\0' );
if ( put_simple_filter( ber, str ) == -1 ) {
rc = -1;
char *next = NULL;
char save;
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, ARGS, "put_filter_list \"%s\"\n", str,0,0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_filter_list \"%s\"\n",
str, 0, 0 );
-#endif
while ( *str ) {
while ( *str && LDAP_SPACE( (unsigned char) *str ) ) {
ber_tag_t ftype;
int rc = -1;
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, ARGS, "put_simple_filter: \"%s\"\n", str,0,0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_simple_filter: \"%s\"\n",
str, 0, 0 );
-#endif
str = LDAP_STRDUP( str );
if( str == NULL ) return -1;
if( rule == NULL ) {
/* one colon */
- if ( strcmp(dn, "dn") == 0 ) {
+ if ( strcasecmp(dn, "dn") == 0 ) {
/* must have attribute */
if( !ldap_is_desc( str ) ) {
goto done;
/* two colons */
*rule++ = '\0';
- if ( strcmp(dn, "dn") != 0 ) {
+ if ( strcasecmp(dn, "dn") != 0 ) {
/* must have "dn" */
goto done;
}
int gotstar = 0;
ber_tag_t ftype = LDAP_FILTER_SUBSTRINGS;
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, ARGS, "put_substring_filter \"%s=%s\"\n", type, val, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_substring_filter \"%s=%s\"\n",
type, val, 0 );
-#endif
if ( ber_printf( ber, "t{s{" /*"}}"*/, ftype, type ) == -1 ) {
return -1;
* matchValue [3] AssertionValue }
*/
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, ARGS, "put_vrFilter: \"%s\"\n", str_in, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_vrFilter: \"%s\"\n", str_in, 0, 0 );
-#endif
freeme = LDAP_STRDUP( str_in );
if( freeme == NULL ) return LDAP_NO_MEMORY;
default:
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, DETAIL1,
- "put_vrFilter: simple\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_vrFilter: simple\n",
0, 0, 0 );
-#endif
balance = 1;
escape = 0;
break;
case /*'('*/ ')':
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, DETAIL1, "put_vrFilter: end\n", 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_vrFilter: end\n",
0, 0, 0 );
-#endif
if ( ber_printf( ber, /*"["*/ "]" ) == -1 ) {
rc = -1;
goto done;
break;
default: /* assume it's a simple type=value filter */
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, DETAIL1, "put_vrFilter: default\n",
- 0, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_vrFilter: default\n",
0, 0, 0 );
-#endif
next = strchr( str, '\0' );
- if ( put_simple_filter( ber, str ) == -1 ) {
+ if ( put_simple_vrFilter( ber, str ) == -1 ) {
rc = -1;
goto done;
}
char *next = NULL;
char save;
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, ARGS, "put_vrFilter_list \"%s\"\n", str, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_vrFilter_list \"%s\"\n",
str, 0, 0 );
-#endif
while ( *str ) {
while ( *str && LDAP_SPACE( (unsigned char) *str ) ) {
ber_tag_t ftype;
int rc = -1;
-#ifdef NEW_LOGGING
- LDAP_LOG ( FILTER, ARGS, "put_simple_vrFilter: \"%s\"\n", str, 0, 0 );
-#else
Debug( LDAP_DEBUG_TRACE, "put_simple_vrFilter: \"%s\"\n",
str, 0, 0 );
-#endif
str = LDAP_STRDUP( str );
if( str == NULL ) return -1;
{
char *rule = strchr( str, ':' );
- *rule++ = '\0';
if( rule == NULL ) {
/* must have attribute */
goto done;
}
rule = "";
-
} else {
*rule++ = '\0';
}
-
if ( *str == '\0' && ( !rule || *rule == '\0' ) ) {
/* must have either type or rule */
goto done;