Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
ffcdc6d1
Commit
ffcdc6d1
authored
Jan 15, 2001
by
Gary Williams
Browse files
More new logging (Behind NEW_LOGGING)
parent
6c2ea5ec
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
servers/slapd/ava.c
View file @
ffcdc6d1
...
...
@@ -43,7 +43,12 @@ get_ava(
rc
=
ber_scanf
(
ber
,
"{oo}"
,
&
type
,
&
value
);
if
(
rc
==
LBER_ERROR
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_ERR
,
"get_ava: ber_scanf failure
\n
"
));
#else
Debug
(
LDAP_DEBUG_ANY
,
" get_ava ber_scanf
\n
"
,
0
,
0
,
0
);
#endif
*
text
=
"Error decoding attribute value assertion"
;
return
SLAPD_DISCONNECT
;
}
...
...
servers/slapd/daemon.c
View file @
ffcdc6d1
This diff is collapsed.
Click to expand it.
servers/slapd/delete.c
View file @
ffcdc6d1
...
...
@@ -37,7 +37,12 @@ do_delete(
int
rc
;
int
manageDSAit
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ENTRY
,
"do_delete: conn %d
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_TRACE
,
"do_delete
\n
"
,
0
,
0
,
0
);
#endif
/*
* Parse the delete request. It looks like this:
...
...
@@ -46,28 +51,48 @@ do_delete(
*/
if
(
ber_scanf
(
op
->
o_ber
,
"a"
,
&
dn
)
==
LBER_ERROR
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"do_delete: conn: %d ber_scanf failed
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"ber_scanf failed
\n
"
,
0
,
0
,
0
);
#endif
send_ldap_disconnect
(
conn
,
op
,
LDAP_PROTOCOL_ERROR
,
"decoding error"
);
return
SLAPD_DISCONNECT
;
}
if
(
(
rc
=
get_ctrls
(
conn
,
op
,
1
)
)
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"oepration"
,
LDAP_LEVEL_ERR
,
"do_delete: conn %d get_ctrls failed
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"do_delete: get_ctrls failed
\n
"
,
0
,
0
,
0
);
#endif
goto
cleanup
;
}
ndn
=
ch_strdup
(
dn
);
if
(
dn_normalize
(
ndn
)
==
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"do_delete: conn %d invalid dn (%s).
\n
"
,
conn
->
c_connid
,
dn
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"do_delete: invalid dn (%s)
\n
"
,
dn
,
0
,
0
);
#endif
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_INVALID_DN_SYNTAX
,
NULL
,
"invalid DN"
,
NULL
,
NULL
);
goto
cleanup
;
}
if
(
ndn
==
'\0'
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_INFO
,
"do_delete: conn %d Attempt to delete root DSE.
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"do_delete: root dse!
\n
"
,
0
,
0
,
0
);
#endif
/* protocolError would likely be a more appropriate error */
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_UNWILLING_TO_PERFORM
,
NULL
,
"cannot delete the root DSE"
,
NULL
,
NULL
);
...
...
servers/slapd/dn.c
View file @
ffcdc6d1
...
...
@@ -235,8 +235,14 @@ dn_validate( char *dn_in )
default:
dn
=
NULL
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"dn_validate: unknown state %d for dn
\"
%s
\"
.
\n
"
,
state
,
dn_in
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"dn_validate - unknown state %d
\n
"
,
state
,
0
,
0
);
#endif
break
;
}
...
...
servers/slapd/entry.c
View file @
ffcdc6d1
...
...
@@ -58,16 +58,26 @@ str2entry( char *s )
* or newline.
*/
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ARGS
,
"str2entry:
\"
%s
\"\n
"
,
s
?
s
:
"NULL"
));
#else
Debug
(
LDAP_DEBUG_TRACE
,
"=> str2entry
\n
"
,
s
?
s
:
"NULL"
,
0
,
0
);
#endif
/* initialize reader/writer lock */
e
=
(
Entry
*
)
ch_malloc
(
sizeof
(
Entry
)
);
if
(
e
==
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"str2entry: entry allocation failed.
\n
"
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"<= str2entry NULL (entry allocation failed)
\n
"
,
0
,
0
,
0
);
#endif
return
(
NULL
);
}
...
...
@@ -89,8 +99,13 @@ str2entry( char *s )
}
if
(
ldif_parse_line
(
s
,
&
type
,
&
value
.
bv_val
,
&
value
.
bv_len
)
!=
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"str2entry: NULL (parse_line)
\n
"
));
#else
Debug
(
LDAP_DEBUG_TRACE
,
"<= str2entry NULL (parse_line)
\n
"
,
0
,
0
,
0
);
#endif
continue
;
}
...
...
@@ -98,10 +113,16 @@ str2entry( char *s )
free
(
type
);
if
(
e
->
e_dn
!=
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"str2entry: entry %ld has multiple dns
\"
%s
\"
and
\"
%s
\"
(second ignored)
\n
"
,
e
->
e_id
,
e
->
e_dn
,
value
.
bv_val
!=
NULL
?
value
.
bv_val
:
""
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"str2entry: entry %ld has multiple dns
\"
%s
\"
and
\"
%s
\"
(second ignored)
\n
"
,
e
->
e_id
,
e
->
e_dn
,
value
.
bv_val
!=
NULL
?
value
.
bv_val
:
""
);
#endif
if
(
value
.
bv_val
!=
NULL
)
free
(
value
.
bv_val
);
continue
;
}
...
...
@@ -114,10 +135,14 @@ str2entry( char *s )
rc
=
slap_str2ad
(
type
,
&
ad
,
&
text
);
if
(
rc
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"str2entry: str2ad(%s): %s
\n
"
,
type
,
text
));
#else
Debug
(
slapMode
&
SLAP_TOOL_MODE
?
LDAP_DEBUG_ANY
:
LDAP_DEBUG_TRACE
,
"<= str2entry: str2ad(%s): %s
\n
"
,
type
,
text
,
0
);
#endif
if
(
slapMode
&
SLAP_TOOL_MODE
)
{
entry_free
(
e
);
free
(
value
.
bv_val
);
...
...
@@ -128,9 +153,14 @@ str2entry( char *s )
rc
=
slap_str2undef_ad
(
type
,
&
ad
,
&
text
);
if
(
rc
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"str2entry: str2undef_ad(%s): %s
\n
"
,
type
,
text
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"<= str2entry: str2undef_ad(%s): %s
\n
"
,
type
,
text
,
0
);
#endif
entry_free
(
e
);
free
(
value
.
bv_val
);
free
(
type
);
...
...
@@ -143,9 +173,15 @@ str2entry( char *s )
ad
->
ad_type
->
sat_syntax
->
ssyn_validate
;
if
(
!
validate
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_INFO
,
"str2entry: no validator for syntax %s
\n
"
,
ad
->
ad_type
->
sat_syntax
->
ssyn_oid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"str2entry: no validator for syntax %s
\n
"
,
ad
->
ad_type
->
sat_syntax
->
ssyn_oid
,
0
,
0
);
#endif
entry_free
(
e
);
free
(
value
.
bv_val
);
free
(
type
);
...
...
@@ -158,9 +194,15 @@ str2entry( char *s )
rc
=
validate
(
ad
->
ad_type
->
sat_syntax
,
&
value
);
if
(
rc
!=
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"str2entry: invalid value for syntax %s
\n
"
,
ad
->
ad_type
->
sat_syntax
->
ssyn_oid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"str2entry: invalid value for syntax %s
\n
"
,
ad
->
ad_type
->
sat_syntax
->
ssyn_oid
,
0
,
0
);
#endif
entry_free
(
e
);
free
(
value
.
bv_val
);
free
(
type
);
...
...
@@ -173,8 +215,13 @@ str2entry( char *s )
ad_free
(
ad
,
1
);
if
(
rc
!=
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"str2entry: NULL (attr_merge)
\n
"
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"<= str2entry NULL (attr_merge)
\n
"
,
0
,
0
,
0
);
#endif
entry_free
(
e
);
free
(
value
.
bv_val
);
free
(
type
);
...
...
@@ -187,8 +234,13 @@ str2entry( char *s )
/* check to make sure there was a dn: line */
if
(
e
->
e_dn
==
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_INFO
,
"str2entry: entry %ld has no dn.
\n
"
,
e
->
e_id
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"str2entry: entry %ld has no dn
\n
"
,
e
->
e_id
,
0
,
0
);
#endif
entry_free
(
e
);
return
(
NULL
);
}
...
...
@@ -197,9 +249,13 @@ str2entry( char *s )
e
->
e_ndn
=
ch_strdup
(
e
->
e_dn
);
(
void
)
dn_normalize
(
e
->
e_ndn
);
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL2
,
"str2entry(%s) -> 0x%lx
\n
"
,
e
->
e_dn
,
(
unsigned
long
)
e
));
#else
Debug
(
LDAP_DEBUG_TRACE
,
"<= str2entry(%s) -> 0x%lx
\n
"
,
e
->
e_dn
,
(
unsigned
long
)
e
,
0
);
#endif
return
(
e
);
}
...
...
@@ -343,9 +399,14 @@ int entry_decode( struct berval *bv, Entry **entry )
ber
=
ber_init
(
bv
);
if
(
ber
==
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"entry_decode: ber_init failed
\n
"
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"<= entry_decode: ber_init failed
\n
"
,
0
,
0
,
0
);
#endif
return
LDAP_LOCAL_ERROR
;
}
...
...
@@ -353,9 +414,14 @@ int entry_decode( struct berval *bv, Entry **entry )
e
=
(
Entry
*
)
ch_malloc
(
sizeof
(
Entry
)
);
if
(
e
==
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"entry_decode: entry allocation failed.
\n
"
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"<= entry_decode: entry allocation failed
\n
"
,
0
,
0
,
0
);
#endif
return
LDAP_LOCAL_ERROR
;
}
...
...
@@ -372,10 +438,14 @@ int entry_decode( struct berval *bv, Entry **entry )
return
LDAP_PROTOCOL_ERROR
;
}
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL2
,
"entry_decode:
\"
%s
\"\n
"
,
e
->
e_dn
));
#else
Debug
(
LDAP_DEBUG_TRACE
,
"entry_decode:
\"
%s
\"\n
"
,
e
->
e_dn
,
0
,
0
);
#endif
/* get the attrs */
for
(
tag
=
ber_first_element
(
ber
,
&
len
,
&
last
);
tag
!=
LBER_DEFAULT
;
...
...
@@ -389,14 +459,24 @@ int entry_decode( struct berval *bv, Entry **entry )
tag
=
ber_scanf
(
ber
,
"{O{V}}"
,
&
type
,
&
vals
);
if
(
tag
==
LBER_ERROR
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"entry_decode: decoding error (%s)
\n
"
,
e
->
e_dn
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"entry_decode: decoding error
\n
"
,
0
,
0
,
0
);
#endif
entry_free
(
e
);
return
LDAP_PROTOCOL_ERROR
;
}
if
(
vals
==
NULL
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"entry_decode: no values for type %s
\n
"
,
type
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"entry_decode: no values for type %s
\n
"
,
type
,
0
,
0
);
#endif
ber_bvfree
(
type
);
entry_free
(
e
);
return
LDAP_PROTOCOL_ERROR
;
...
...
@@ -406,15 +486,24 @@ int entry_decode( struct berval *bv, Entry **entry )
rc
=
slap_bv2ad
(
type
,
&
ad
,
&
text
);
if
(
rc
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_INFO
,
"entry_decode: str2ad(%s): %s
\n
"
,
type
,
text
));
#else
Debug
(
LDAP_DEBUG_TRACE
,
"<= entry_decode: str2ad(%s): %s
\n
"
,
type
,
text
,
0
);
#endif
rc
=
slap_bv2undef_ad
(
type
,
&
ad
,
&
text
);
if
(
rc
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_INFO
,
"entry_decode: str2undef_ad(%s): %s
\n
"
,
type
,
text
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"<= entry_decode: str2undef_ad(%s): %s
\n
"
,
type
,
text
,
0
);
#endif
ber_bvfree
(
type
);
ber_bvecfree
(
vals
);
entry_free
(
e
);
...
...
@@ -426,8 +515,13 @@ int entry_decode( struct berval *bv, Entry **entry )
ad_free
(
ad
,
1
);
if
(
rc
!=
0
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_INFO
,
"entry_decode: attr_merge failed
\n
"
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"<= entry_decode: attr_merge failed
\n
"
,
0
,
0
,
0
);
#endif
ber_bvfree
(
type
);
ber_bvecfree
(
vals
);
entry_free
(
e
);
...
...
@@ -444,8 +538,13 @@ int entry_decode( struct berval *bv, Entry **entry )
return
LDAP_PROTOCOL_ERROR
;
}
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"entry_decode: %s
\n
"
,
e
->
e_dn
));
#else
Debug
(
LDAP_DEBUG_TRACE
,
"<= entry_decode(%s)
\n
"
,
e
->
e_dn
,
0
,
0
);
#endif
*
entry
=
e
;
return
LDAP_SUCCESS
;
...
...
@@ -459,9 +558,14 @@ int entry_encode(
Attribute
*
a
;
BerElement
*
ber
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ENTRY
,
"entry_encode: id: 0x%08lx
\"
%s
\"\n
"
,
e
->
e_id
,
e
->
e_dn
));
#else
Debug
(
LDAP_DEBUG_TRACE
,
"=> entry_encode(0x%08lx): %s
\n
"
,
e
->
e_id
,
e
->
e_dn
,
0
);
#endif
ber
=
ber_alloc_t
(
LBER_USE_DER
);
if
(
ber
==
NULL
)
{
goto
done
;
...
...
@@ -491,8 +595,13 @@ int entry_encode(
done:
ber_free
(
ber
,
1
);
if
(
rc
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_INFO
,
"entry_encode: id=0x%08lx failed (%d)
\n
"
,
e
->
e_id
,
rc
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"=> entry_encode(0x%08lx): failed (%d)
\n
"
,
e
->
e_id
,
rc
,
0
);
#endif
}
return
rc
;
}
...
...
servers/slapd/extended.c
View file @
ffcdc6d1
...
...
@@ -93,14 +93,23 @@ do_extended(
struct
berval
*
rspdata
;
LDAPControl
**
rspctrls
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ENTRY
,
"do_extended: conn %s
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_TRACE
,
"do_extended
\n
"
,
0
,
0
,
0
);
#endif
reqoid
=
NULL
;
reqdata
=
NULL
;
if
(
op
->
o_protocol
<
LDAP_VERSION3
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"do_extended: protocol version (%d) too low.
\n
"
,
op
->
o_protocol
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"do_extended: protocol version (%d) too low
\n
"
,
op
->
o_protocol
,
0
,
0
);
#endif
send_ldap_disconnect
(
conn
,
op
,
LDAP_PROTOCOL_ERROR
,
"requires LDAPv3"
);
rc
=
-
1
;
...
...
@@ -108,7 +117,12 @@ do_extended(
}
if
(
ber_scanf
(
op
->
o_ber
,
"{a"
/*}*/
,
&
reqoid
)
==
LBER_ERROR
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"do_extended: conn %d ber_scanf failed
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"do_extended: ber_scanf failed
\n
"
,
0
,
0
,
0
);
#endif
send_ldap_disconnect
(
conn
,
op
,
LDAP_PROTOCOL_ERROR
,
"decoding error"
);
rc
=
-
1
;
...
...
@@ -116,8 +130,14 @@ do_extended(
}
if
(
!
(
ext
=
find_extop
(
supp_ext_list
,
reqoid
))
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"do_extended: conn %d unsupported operation
\"
%s
\"\n
"
,
conn
->
c_connid
,
reqoid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"do_extended: unsupported operation
\"
%s
\"\n
"
,
reqoid
,
0
,
0
);
#endif
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_PROTOCOL_ERROR
,
NULL
,
"unsupported extended operation"
,
NULL
,
NULL
);
goto
done
;
...
...
@@ -127,7 +147,12 @@ do_extended(
if
(
ber_peek_tag
(
op
->
o_ber
,
&
len
)
==
LDAP_TAG_EXOP_REQ_VALUE
)
{
if
(
ber_scanf
(
op
->
o_ber
,
"O"
,
&
reqdata
)
==
LBER_ERROR
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"do_extended: conn %d ber_scanf failed
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"do_extended: ber_scanf failed
\n
"
,
0
,
0
,
0
);
#endif
send_ldap_disconnect
(
conn
,
op
,
LDAP_PROTOCOL_ERROR
,
"decoding error"
);
rc
=
-
1
;
...
...
@@ -136,12 +161,21 @@ do_extended(
}
if
(
(
rc
=
get_ctrls
(
conn
,
op
,
1
))
!=
LDAP_SUCCESS
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_ERR
,
"do_extended: conn %d get_ctrls failed
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"do_extended: get_ctrls failed
\n
"
,
0
,
0
,
0
);
#endif
return
rc
;
}
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_DETAIL1
,
"do_extended: conn %d oid=%d
\n
."
,
conn
->
c_connid
,
reqoid
));
#else
Debug
(
LDAP_DEBUG_ARGS
,
"do_extended: oid=%s
\n
"
,
reqoid
,
0
,
0
);
#endif
rspoid
=
NULL
;
rspdata
=
NULL
;
rspctrls
=
NULL
;
...
...
@@ -243,4 +277,4 @@ find_extop( extop_list_t *list, char *oid )
return
(
ext
);
}
return
(
NULL
);
}
\ No newline at end of file
}
servers/slapd/filter.c
View file @
ffcdc6d1
...
...
@@ -47,8 +47,12 @@ get_filter(
char
*
ftmp
=
NULL
;
struct
berval
escaped
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_ENTRY
,
"get_filter: conn %d
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_FILTER
,
"begin get_filter
\n
"
,
0
,
0
,
0
);
#endif
/*
* A filter looks like this coming in:
* Filter ::= CHOICE {
...
...
@@ -98,8 +102,12 @@ get_filter(
switch
(
f
->
f_choice
)
{
case
LDAP_FILTER_EQUALITY
:
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_DETAIL2
,
"get_filter: conn %d EQUALITY
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_FILTER
,
"EQUALITY
\n
"
,
0
,
0
,
0
);
#endif
err
=
get_ava
(
ber
,
&
f
->
f_ava
,
SLAP_MR_EQUALITY
,
text
);
if
(
err
!=
LDAP_SUCCESS
)
{
break
;
...
...
@@ -121,13 +129,22 @@ get_filter(
break
;
case
LDAP_FILTER_SUBSTRINGS
:
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_DETAIL1
,
"get_filter: conn %d SUBSTRINGS
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_FILTER
,
"SUBSTRINGS
\n
"
,
0
,
0
,
0
);
#endif
err
=
get_substring_filter
(
conn
,
ber
,
f
,
fstr
,
text
);
break
;
case
LDAP_FILTER_GE
:
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_DETAIL1
,
"get_filter: conn %d GE
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_FILTER
,
"GE
\n
"
,
0
,
0
,
0
);
#endif
err
=
get_ava
(
ber
,
&
f
->
f_ava
,
SLAP_MR_ORDERING
,
text
);
if
(
err
!=
LDAP_SUCCESS
)
{
break
;
...
...
@@ -147,8 +164,12 @@ get_filter(
break
;
case
LDAP_FILTER_LE
:
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_DETAIL1
,
"get_filter: conn %d LE
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_FILTER
,
"LE
\n
"
,
0
,
0
,
0
);
#endif
err
=
get_ava
(
ber
,
&
f
->
f_ava
,
SLAP_MR_ORDERING
,
text
);
if
(
err
!=
LDAP_SUCCESS
)
{
break
;
...
...
@@ -171,8 +192,12 @@ get_filter(
case
LDAP_FILTER_PRESENT
:
{
struct
berval
type
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_DETAIL1
,
"get_filter: conn %d PRESENT
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_FILTER
,
"PRESENT
\n
"
,
0
,
0
,
0
);
#endif
if
(
ber_scanf
(
ber
,
"o"
,
&
type
)
==
LBER_ERROR
)
{
err
=
SLAPD_DISCONNECT
;
*
text
=
"error decoding filter"
;
...
...
@@ -197,8 +222,12 @@ get_filter(
}
break
;
case
LDAP_FILTER_APPROX
:
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_DETAIL1
,
"get_filter: conn %d APPROX
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_FILTER
,
"APPROX
\n
"
,
0
,
0
,
0
);
#endif
err
=
get_ava
(
ber
,
&
f
->
f_ava
,
SLAP_MR_EQUALITY_APPROX
,
text
);
if
(
err
!=
LDAP_SUCCESS
)
{
break
;
...
...
@@ -218,7 +247,12 @@ get_filter(
break
;
case
LDAP_FILTER_AND
:
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_DETAIL1
,
"get_filter: conn %d AND
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_FILTER
,
"AND
\n
"
,
0
,
0
,
0
);
#endif
err
=
get_filter_list
(
conn
,
ber
,
&
f
->
f_and
,
&
ftmp
,
text
);
if
(
err
!=
LDAP_SUCCESS
)
{
break
;
...
...
@@ -230,7 +264,12 @@ get_filter(
break
;
case
LDAP_FILTER_OR
:
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_DETAIL1
,
"get_filter: conn %d OR
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_FILTER
,
"OR
\n
"
,
0
,
0
,
0
);
#endif
err
=
get_filter_list
(
conn
,
ber
,
&
f
->
f_and
,
&
ftmp
,
text
);
if
(
err
!=
LDAP_SUCCESS
)
{
break
;
...
...
@@ -242,7 +281,12 @@ get_filter(
break
;
case
LDAP_FILTER_NOT
:
#ifdef NEW_LOGGING
LDAP_LOG
((
"filter"
,
LDAP_LEVEL_DETAIL1
,
"get_filter: conn %d NOT
\n
"
,
conn
->
c_connid
));
#else
Debug
(
LDAP_DEBUG_FILTER
,
"NOT
\n
"
,
0
,
0
,
0
);
#endif
(
void
)
ber_skip_tag
(
ber
,
&
len
);
err
=
get_filter
(
conn
,
ber
,
&
f
->
f_not
,
&
ftmp
,
text
);
if
(
err
!=
LDAP_SUCCESS
)
{
...
...
@@ -255,7 +299,12 @@ get_filter(
break
;