Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
3a5cd746
Commit
3a5cd746
authored
Apr 16, 2003
by
Pierangelo Masarati
Browse files
use global bervals for TRUE/FALSE
parent
58d1df26
Changes
5
Show whitespace changes
Inline
Side-by-side
servers/slapd/filterentry.c
View file @
3a5cd746
...
@@ -467,12 +467,10 @@ test_ava_filter(
...
@@ -467,12 +467,10 @@ test_ava_filter(
}
}
if
(
hasSubordinates
==
LDAP_COMPARE_TRUE
)
{
if
(
hasSubordinates
==
LDAP_COMPARE_TRUE
)
{
hs
.
bv_val
=
"TRUE"
;
hs
=
slap_true_bv
;
hs
.
bv_len
=
sizeof
(
"TRUE"
)
-
1
;
}
else
if
(
hasSubordinates
==
LDAP_COMPARE_FALSE
)
{
}
else
if
(
hasSubordinates
==
LDAP_COMPARE_FALSE
)
{
hs
.
bv_val
=
"FALSE"
;
hs
=
slap_false_bv
;
hs
.
bv_len
=
sizeof
(
"FALSE"
)
-
1
;
}
else
{
}
else
{
return
LDAP_OTHER
;
return
LDAP_OTHER
;
...
...
servers/slapd/globals.c
View file @
3a5cd746
...
@@ -22,3 +22,7 @@
...
@@ -22,3 +22,7 @@
const
struct
berval
slap_empty_bv
=
BER_BVC
(
""
);
const
struct
berval
slap_empty_bv
=
BER_BVC
(
""
);
const
struct
berval
slap_unknown_bv
=
BER_BVC
(
"unknown"
);
const
struct
berval
slap_unknown_bv
=
BER_BVC
(
"unknown"
);
/* normalized boolean values */
const
struct
berval
slap_true_bv
=
BER_BVC
(
"TRUE"
);
const
struct
berval
slap_false_bv
=
BER_BVC
(
"FALSE"
);
servers/slapd/operational.c
View file @
3a5cd746
...
@@ -43,24 +43,20 @@ Attribute *
...
@@ -43,24 +43,20 @@ Attribute *
slap_operational_hasSubordinate
(
int
hs
)
slap_operational_hasSubordinate
(
int
hs
)
{
{
Attribute
*
a
;
Attribute
*
a
;
char
*
val
;
struct
berval
val
;
ber_len_t
len
;
if
(
hs
)
{
if
(
hs
)
{
val
=
"TRUE"
;
val
=
slap_true_bv
;
len
=
sizeof
(
"TRUE"
)
-
1
;
}
else
{
}
else
{
val
=
"FALSE"
;
val
=
slap_false_bv
;
len
=
sizeof
(
"FALSE"
)
-
1
;
}
}
a
=
ch_malloc
(
sizeof
(
Attribute
)
);
a
=
ch_malloc
(
sizeof
(
Attribute
)
);
a
->
a_desc
=
slap_schema
.
si_ad_hasSubordinates
;
a
->
a_desc
=
slap_schema
.
si_ad_hasSubordinates
;
a
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
a
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_
str2bv
(
val
,
len
,
1
,
a
->
a_vals
);
ber_
dupbv
(
&
a
->
a_vals
[
0
],
&
val
);
a
->
a_vals
[
1
].
bv_val
=
NULL
;
a
->
a_vals
[
1
].
bv_val
=
NULL
;
a
->
a_nvals
=
a
->
a_vals
;
a
->
a_nvals
=
a
->
a_vals
;
...
...
servers/slapd/proto-slap.h
View file @
3a5cd746
...
@@ -510,6 +510,8 @@ LDAP_SLAPD_F (int) test_filter LDAP_P(( Operation *op, Entry *e, Filter *f ));
...
@@ -510,6 +510,8 @@ LDAP_SLAPD_F (int) test_filter LDAP_P(( Operation *op, Entry *e, Filter *f ));
LDAP_SLAPD_V
(
const
struct
berval
)
slap_empty_bv
;
LDAP_SLAPD_V
(
const
struct
berval
)
slap_empty_bv
;
LDAP_SLAPD_V
(
const
struct
berval
)
slap_unknown_bv
;
LDAP_SLAPD_V
(
const
struct
berval
)
slap_unknown_bv
;
LDAP_SLAPD_V
(
const
struct
berval
)
slap_true_bv
;
LDAP_SLAPD_V
(
const
struct
berval
)
slap_false_bv
;
/*
/*
* index.c
* index.c
...
...
servers/slapd/schema_init.c
View file @
3a5cd746
...
@@ -822,11 +822,11 @@ booleanValidate(
...
@@ -822,11 +822,11 @@ booleanValidate(
*/
*/
if
(
in
->
bv_len
==
4
)
{
if
(
in
->
bv_len
==
4
)
{
if
(
!
memcmp
(
in
->
bv_val
,
"TRUE"
,
4
)
)
{
if
(
bvmatch
(
in
,
&
slap_true_bv
)
)
{
return
LDAP_SUCCESS
;
return
LDAP_SUCCESS
;
}
}
}
else
if
(
in
->
bv_len
==
5
)
{
}
else
if
(
in
->
bv_len
==
5
)
{
if
(
!
memcmp
(
in
->
bv_val
,
"FALSE"
,
5
)
)
{
if
(
bvmatch
(
in
,
&
slap_false_bv
)
)
{
return
LDAP_SUCCESS
;
return
LDAP_SUCCESS
;
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment