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
Joe Martin
OpenLDAP
Commits
c4dbe1a2
Commit
c4dbe1a2
authored
Sep 21, 2007
by
Howard Chu
Browse files
Attribute/Modification value counters
parent
b99749ab
Changes
27
Hide whitespace changes
Inline
Side-by-side
servers/slapd/add.c
View file @
c4dbe1a2
...
...
@@ -380,6 +380,7 @@ slap_mods2entry(
char
*
textbuf
,
size_t
textlen
)
{
Attribute
**
tail
;
int
i
;
if
(
initial
)
{
assert
(
(
*
e
)
->
e_attrs
==
NULL
);
...
...
@@ -400,7 +401,7 @@ slap_mods2entry(
if
(
attr
!=
NULL
)
{
#define SLURPD_FRIENDLY
#ifdef SLURPD_FRIENDLY
ber_len_t
i
,
j
;
int
j
;
if
(
!
initial
)
{
/*
...
...
@@ -413,12 +414,9 @@ slap_mods2entry(
return
LDAP_SUCCESS
;
}
for
(
i
=
0
;
attr
->
a_vals
[
i
].
bv_val
;
i
++
)
{
/* count them */
}
for
(
j
=
0
;
mods
->
sml_values
[
j
].
bv_val
;
j
++
)
{
/* count them */
}
i
=
attr
->
a_numvals
;
j
=
mods
->
sml_numvals
;
attr
->
a_numvals
+=
j
;
j
++
;
/* NULL */
attr
->
a_vals
=
ch_realloc
(
attr
->
a_vals
,
...
...
@@ -466,9 +464,9 @@ slap_mods2entry(
attr
=
attr_alloc
(
mods
->
sml_desc
);
/* move values to attr structure */
i
=
mods
->
sml_numvals
;
attr
->
a_numvals
=
mods
->
sml_numvals
;
if
(
dup
)
{
int
i
;
for
(
i
=
0
;
mods
->
sml_values
[
i
].
bv_val
;
i
++
)
/* EMPTY */
;
attr
->
a_vals
=
(
BerVarray
)
ch_calloc
(
i
+
1
,
sizeof
(
BerValue
));
for
(
i
=
0
;
mods
->
sml_values
[
i
].
bv_val
;
i
++
)
{
ber_dupbv
(
&
attr
->
a_vals
[
i
],
&
mods
->
sml_values
[
i
]
);
...
...
@@ -480,8 +478,7 @@ slap_mods2entry(
if
(
mods
->
sml_nvalues
)
{
if
(
dup
)
{
int
i
;
for
(
i
=
0
;
mods
->
sml_nvalues
[
i
].
bv_val
;
i
++
)
/* EMPTY */
;
i
=
mods
->
sml_numvals
;
attr
->
a_nvals
=
(
BerVarray
)
ch_calloc
(
i
+
1
,
sizeof
(
BerValue
));
for
(
i
=
0
;
mods
->
sml_nvalues
[
i
].
bv_val
;
i
++
)
{
ber_dupbv
(
&
attr
->
a_nvals
[
i
],
&
mods
->
sml_nvalues
[
i
]
);
...
...
@@ -528,7 +525,8 @@ slap_entry2mods(
mod
->
sml_type
=
a_new_desc
->
ad_cname
;
for
(
count
=
0
;
a_new
->
a_vals
[
count
].
bv_val
;
count
++
)
/* EMPTY */
;
count
=
a_new
->
a_numvals
;
mod
->
sml_numvals
=
a_new
->
a_numvals
;
mod
->
sml_values
=
(
struct
berval
*
)
malloc
(
(
count
+
1
)
*
sizeof
(
struct
berval
)
);
...
...
servers/slapd/attr.c
View file @
c4dbe1a2
...
...
@@ -153,6 +153,7 @@ attr_clean( Attribute *a )
a
->
a_comp_data
=
NULL
;
#endif
a
->
a_flags
=
0
;
a
->
a_numvals
=
0
;
}
void
...
...
@@ -213,12 +214,9 @@ attr_dup2( Attribute *tmp, Attribute *a )
if
(
a
->
a_vals
!=
NULL
)
{
int
i
;
for
(
i
=
0
;
!
BER_BVISNULL
(
&
a
->
a_vals
[
i
]
);
i
++
)
{
/* EMPTY */
;
}
tmp
->
a_vals
=
ch_malloc
(
(
i
+
1
)
*
sizeof
(
struct
berval
)
);
for
(
i
=
0
;
!
BER_BVISNULL
(
&
a
->
a_vals
[
i
]
);
i
++
)
{
tmp
->
a_numvals
=
a
->
a_numvals
;
tmp
->
a_vals
=
ch_malloc
(
(
tmp
->
a_numvals
+
1
)
*
sizeof
(
struct
berval
)
);
for
(
i
=
0
;
i
<
tmp
->
a_numvals
;
i
++
)
{
ber_dupbv
(
&
tmp
->
a_vals
[
i
],
&
a
->
a_vals
[
i
]
);
if
(
BER_BVISNULL
(
&
tmp
->
a_vals
[
i
]
)
)
break
;
/* FIXME: error? */
...
...
@@ -231,7 +229,7 @@ attr_dup2( Attribute *tmp, Attribute *a )
if
(
a
->
a_nvals
!=
a
->
a_vals
)
{
int
j
;
tmp
->
a_nvals
=
ch_malloc
(
(
i
+
1
)
*
sizeof
(
struct
berval
)
);
tmp
->
a_nvals
=
ch_malloc
(
(
tmp
->
a_numvals
+
1
)
*
sizeof
(
struct
berval
)
);
for
(
j
=
0
;
!
BER_BVISNULL
(
&
a
->
a_nvals
[
j
]
);
j
++
)
{
assert
(
j
<
i
);
ber_dupbv
(
&
tmp
->
a_nvals
[
j
],
&
a
->
a_nvals
[
j
]
);
...
...
@@ -283,6 +281,55 @@ attrs_dup( Attribute *a )
return
anew
;
}
int
attr_valadd
(
Attribute
*
a
,
BerVarray
vals
,
BerVarray
nvals
,
int
nn
)
{
int
i
;
BerVarray
v2
;
v2
=
(
BerVarray
)
SLAP_REALLOC
(
(
char
*
)
a
->
a_vals
,
(
a
->
a_numvals
+
nn
+
1
)
*
sizeof
(
struct
berval
)
);
if
(
v2
==
NULL
)
{
Debug
(
LDAP_DEBUG_TRACE
,
"attr_valadd: SLAP_REALLOC failed.
\n
"
,
0
,
0
,
0
);
return
LBER_ERROR_MEMORY
;
}
a
->
a_vals
=
v2
;
if
(
nvals
)
{
v2
=
(
BerVarray
)
SLAP_REALLOC
(
(
char
*
)
a
->
a_nvals
,
(
a
->
a_numvals
+
nn
+
1
)
*
sizeof
(
struct
berval
)
);
if
(
v2
==
NULL
)
{
Debug
(
LDAP_DEBUG_TRACE
,
"attr_valadd: SLAP_REALLOC failed.
\n
"
,
0
,
0
,
0
);
return
LBER_ERROR_MEMORY
;
}
a
->
a_nvals
=
v2
;
}
else
{
a
->
a_nvals
=
a
->
a_vals
;
}
v2
=
&
a
->
a_vals
[
a
->
a_numvals
];
for
(
i
=
0
;
i
<
nn
;
i
++
)
{
ber_dupbv
(
&
v2
[
i
],
&
vals
[
i
]
);
if
(
BER_BVISNULL
(
&
v2
[
i
]
)
)
break
;
}
BER_BVZERO
(
&
v2
[
i
]
);
if
(
nvals
)
{
v2
=
&
a
->
a_nvals
[
a
->
a_numvals
];
for
(
i
=
0
;
i
<
nn
;
i
++
)
{
ber_dupbv
(
&
v2
[
i
],
&
nvals
[
i
]
);
if
(
BER_BVISNULL
(
&
v2
[
i
]
)
)
break
;
}
BER_BVZERO
(
&
v2
[
i
]
);
}
a
->
a_numvals
+=
i
;
return
0
;
}
/*
* attr_merge - merge the given type and value with the list of
...
...
@@ -302,7 +349,7 @@ attr_merge(
BerVarray
vals
,
BerVarray
nvals
)
{
int
rc
;
int
i
=
0
;
Attribute
**
a
;
...
...
@@ -325,18 +372,10 @@ attr_merge(
||
(
(
*
a
)
->
a_nvals
!=
(
*
a
)
->
a_vals
)
)
)
);
}
rc
=
value_add
(
&
(
*
a
)
->
a_vals
,
vals
);
if
(
rc
==
LDAP_SUCCESS
)
{
if
(
nvals
)
{
rc
=
value_add
(
&
(
*
a
)
->
a_nvals
,
nvals
);
/* FIXME: what if rc != LDAP_SUCCESS ? */
}
else
{
(
*
a
)
->
a_nvals
=
(
*
a
)
->
a_vals
;
}
if
(
vals
!=
NULL
)
{
for
(
;
!
BER_BVISNULL
(
&
vals
[
i
]
);
i
++
)
;
}
return
rc
;
return
attr_valadd
(
*
a
,
vals
,
nvals
,
i
);
}
/*
...
...
@@ -415,7 +454,6 @@ attr_merge_one(
struct
berval
*
val
,
struct
berval
*
nval
)
{
int
rc
;
Attribute
**
a
;
for
(
a
=
&
e
->
e_attrs
;
*
a
!=
NULL
;
a
=
&
(
*
a
)
->
a_next
)
{
...
...
@@ -428,17 +466,7 @@ attr_merge_one(
*
a
=
attr_alloc
(
desc
);
}
rc
=
value_add_one
(
&
(
*
a
)
->
a_vals
,
val
);
if
(
rc
==
LDAP_SUCCESS
)
{
if
(
nval
)
{
rc
=
value_add_one
(
&
(
*
a
)
->
a_nvals
,
nval
);
/* FIXME: what if rc != LDAP_SUCCESS ? */
}
else
{
(
*
a
)
->
a_nvals
=
(
*
a
)
->
a_vals
;
}
}
return
rc
;
return
attr_valadd
(
*
a
,
val
,
nval
,
1
);
}
/*
...
...
servers/slapd/back-bdb/monitor.c
View file @
c4dbe1a2
...
...
@@ -371,26 +371,22 @@ bdb_monitor_db_open( BackendDB *be )
}
a
->
a_desc
=
slap_schema
.
si_ad_objectClass
;
value_add_one
(
&
a
->
a_vals
,
&
oc_olmBDBDatabase
->
soc_cname
);
a
->
a_nvals
=
a
->
a_vals
;
attr_valadd
(
a
,
&
oc_olmBDBDatabase
->
soc_cname
,
NULL
,
1
);
next
=
a
->
a_next
;
{
struct
berval
bv
=
BER_BVC
(
"0"
);
next
->
a_desc
=
ad_olmBDBEntryCache
;
value_add_one
(
&
next
->
a_vals
,
&
bv
);
next
->
a_nvals
=
next
->
a_vals
;
attr_valadd
(
next
,
&
bv
,
NULL
,
1
);
next
=
next
->
a_next
;
next
->
a_desc
=
ad_olmBDBDNCache
;
value_add_one
(
&
next
->
a_vals
,
&
bv
);
next
->
a_nvals
=
next
->
a_vals
;
attr_valadd
(
next
,
&
bv
,
NULL
,
1
);
next
=
next
->
a_next
;
next
->
a_desc
=
ad_olmBDBIDLCache
;
value_add_one
(
&
next
->
a_vals
,
&
bv
);
next
->
a_nvals
=
next
->
a_vals
;
attr_valadd
(
next
,
&
bv
,
NULL
,
1
);
next
=
next
->
a_next
;
}
...
...
@@ -432,6 +428,7 @@ bdb_monitor_db_open( BackendDB *be )
next
->
a_desc
=
ad_olmDbDirectory
;
next
->
a_vals
=
ch_calloc
(
sizeof
(
struct
berval
),
2
);
next
->
a_vals
[
0
]
=
bv
;
next
->
a_numvals
=
1
;
if
(
BER_BVISNULL
(
&
nbv
)
)
{
next
->
a_nvals
=
next
->
a_vals
;
...
...
servers/slapd/back-ldap/search.c
View file @
c4dbe1a2
...
...
@@ -682,6 +682,7 @@ ldap_build_entry(
for
(
last
=
0
;
!
BER_BVISNULL
(
&
attr
->
a_vals
[
last
]
);
last
++
)
/* just count vals */
;
}
attr
->
a_numvals
=
last
;
validate
=
attr
->
a_desc
->
ad_type
->
sat_syntax
->
ssyn_validate
;
pretty
=
attr
->
a_desc
->
ad_type
->
sat_syntax
->
ssyn_pretty
;
...
...
servers/slapd/back-meta/search.c
View file @
c4dbe1a2
...
...
@@ -1885,6 +1885,7 @@ meta_send_entry(
for
(
last
=
0
;
!
BER_BVISNULL
(
&
attr
->
a_vals
[
last
]
);
++
last
)
;
}
attr
->
a_numvals
=
last
;
validate
=
attr
->
a_desc
->
ad_type
->
sat_syntax
->
ssyn_validate
;
pretty
=
attr
->
a_desc
->
ad_type
->
sat_syntax
->
ssyn_pretty
;
...
...
servers/slapd/back-sql/entry-id.c
View file @
c4dbe1a2
...
...
@@ -645,13 +645,13 @@ backsql_get_attr_vals( void *v_at, void *v_bsi )
/* Make space for the array of values */
attr
=
attr_alloc
(
at
->
bam_true_ad
);
attr
->
a_numvals
=
count
;
attr
->
a_vals
=
ch_calloc
(
count
+
1
,
sizeof
(
struct
berval
)
);
if
(
attr
->
a_vals
==
NULL
)
{
Debug
(
LDAP_DEBUG_TRACE
,
"Out of memory!
\n
"
,
0
,
0
,
0
);
ch_free
(
attr
);
return
1
;
}
memset
(
attr
->
a_vals
,
0
,
(
count
+
1
)
*
sizeof
(
struct
berval
)
);
if
(
normfunc
)
{
attr
->
a_nvals
=
ch_calloc
(
count
+
1
,
sizeof
(
struct
berval
)
);
if
(
attr
->
a_nvals
==
NULL
)
{
...
...
@@ -659,8 +659,6 @@ backsql_get_attr_vals( void *v_at, void *v_bsi )
ch_free
(
attr
);
return
1
;
}
else
{
memset
(
attr
->
a_nvals
,
0
,
(
count
+
1
)
*
sizeof
(
struct
berval
)
);
}
}
else
{
...
...
servers/slapd/back-sql/operational.c
View file @
c4dbe1a2
...
...
@@ -55,6 +55,7 @@ backsql_operational_entryUUID( backsql_info *bi, backsql_entryID *id )
a
=
attr_alloc
(
desc
);
a
->
a_numvals
=
1
;
a
->
a_vals
=
(
BerVarray
)
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
a
->
a_vals
[
0
]
=
val
;
BER_BVZERO
(
&
a
->
a_vals
[
1
]
);
...
...
@@ -74,6 +75,7 @@ backsql_operational_entryCSN( Operation *op )
Attribute
*
a
;
a
=
attr_alloc
(
slap_schema
.
si_ad_entryCSN
);
a
->
a_numvals
=
1
;
a
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
BER_BVZERO
(
&
a
->
a_vals
[
1
]
);
...
...
servers/slapd/bconfig.c
View file @
c4dbe1a2
...
...
@@ -5384,6 +5384,7 @@ config_check_schema(Operation *op, CfBackInfo *cfb)
ber_bvarray_free
(
a
->
a_vals
);
a
->
a_vals
=
NULL
;
a
->
a_nvals
=
NULL
;
a
->
a_numvals
=
0
;
}
oidm_unparse
(
&
bv
,
NULL
,
NULL
,
1
);
attr_merge_normalize
(
e
,
cfAd_om
,
bv
,
NULL
);
...
...
@@ -5398,6 +5399,7 @@ config_check_schema(Operation *op, CfBackInfo *cfb)
ber_bvarray_free
(
a
->
a_vals
);
a
->
a_vals
=
NULL
;
a
->
a_nvals
=
NULL
;
a
->
a_numvals
=
0
;
}
at_unparse
(
&
bv
,
NULL
,
NULL
,
1
);
attr_merge_normalize
(
e
,
cfAd_attr
,
bv
,
NULL
);
...
...
@@ -5412,6 +5414,7 @@ config_check_schema(Operation *op, CfBackInfo *cfb)
ber_bvarray_free
(
a
->
a_vals
);
a
->
a_vals
=
NULL
;
a
->
a_nvals
=
NULL
;
a
->
a_numvals
=
0
;
}
oc_unparse
(
&
bv
,
NULL
,
NULL
,
1
);
attr_merge_normalize
(
e
,
cfAd_oc
,
bv
,
NULL
);
...
...
servers/slapd/entry.c
View file @
c4dbe1a2
...
...
@@ -280,6 +280,7 @@ str2entry2( char *s, int checkvals )
atail
->
a_next
=
attr_alloc
(
NULL
);
atail
=
atail
->
a_next
;
atail
->
a_flags
=
0
;
atail
->
a_numvals
=
attr_cnt
;
atail
->
a_desc
=
ad_prev
;
atail
->
a_vals
=
ch_malloc
(
(
attr_cnt
+
1
)
*
sizeof
(
struct
berval
));
if
(
ad_prev
->
ad_type
->
sat_equality
&&
...
...
@@ -744,6 +745,7 @@ int entry_encode(Entry *e, struct berval *bv)
*
ptr
++
=
'\0'
;
if
(
a
->
a_vals
)
{
for
(
i
=
0
;
a
->
a_vals
[
i
].
bv_val
;
i
++
);
assert
(
i
==
a
->
a_numvals
);
entry_putlen
(
&
ptr
,
i
);
for
(
i
=
0
;
a
->
a_vals
[
i
].
bv_val
;
i
++
)
{
entry_putlen
(
&
ptr
,
a
->
a_vals
[
i
].
bv_len
);
...
...
@@ -805,7 +807,7 @@ int entry_decode(EntryHeader *eh, Entry **e, void *ctx)
int
entry_decode
(
EntryHeader
*
eh
,
Entry
**
e
)
#endif
{
int
i
,
j
,
count
,
nattrs
,
nvals
;
int
i
,
j
,
nattrs
,
nvals
;
int
rc
;
Attribute
*
a
;
Entry
*
x
;
...
...
@@ -857,7 +859,8 @@ int entry_decode(EntryHeader *eh, Entry **e)
ptr
+=
i
+
1
;
a
->
a_desc
=
ad
;
a
->
a_flags
=
SLAP_ATTR_DONT_FREE_DATA
|
SLAP_ATTR_DONT_FREE_VALS
;
count
=
j
=
entry_getlen
(
&
ptr
);
j
=
entry_getlen
(
&
ptr
);
a
->
a_numvals
=
j
;
a
->
a_vals
=
bptr
;
while
(
j
)
{
...
...
@@ -962,6 +965,7 @@ Entry *entry_dup_bv( Entry *e )
dst
->
a_desc
=
src
->
a_desc
;
dst
->
a_flags
=
SLAP_ATTR_DONT_FREE_DATA
|
SLAP_ATTR_DONT_FREE_VALS
;
dst
->
a_vals
=
bvl
;
dst
->
a_numvals
=
src
->
a_numvals
;
for
(
i
=
0
;
src
->
a_vals
[
i
].
bv_val
;
i
++
)
{
bvl
->
bv_len
=
src
->
a_vals
[
i
].
bv_len
;
bvl
->
bv_val
=
ptr
;
...
...
servers/slapd/modify.c
View file @
c4dbe1a2
...
...
@@ -585,6 +585,7 @@ int slap_mods_check(
ml
->
sml_values
[
nvals
]
=
pval
;
}
}
ml
->
sml_numvals
=
nvals
;
/*
* a rough single value check... an additional check is needed
...
...
@@ -946,6 +947,7 @@ void slap_mods_opattrs(
mod
->
sml_next
=
NULL
;
BER_BVZERO
(
&
mod
->
sml_type
);
mod
->
sml_desc
=
slap_schema
.
si_ad_entryCSN
;
mod
->
sml_numvals
=
1
;
mod
->
sml_values
=
(
BerVarray
)
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_dupbv
(
&
mod
->
sml_values
[
0
],
&
csn
);
BER_BVZERO
(
&
mod
->
sml_values
[
1
]
);
...
...
@@ -963,6 +965,7 @@ void slap_mods_opattrs(
mod
->
sml_next
=
NULL
;
BER_BVZERO
(
&
mod
->
sml_type
);
mod
->
sml_desc
=
slap_schema
.
si_ad_modifiersName
;
mod
->
sml_numvals
=
1
;
mod
->
sml_values
=
(
BerVarray
)
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_dupbv
(
&
mod
->
sml_values
[
0
],
&
name
);
BER_BVZERO
(
&
mod
->
sml_values
[
1
]
);
...
...
@@ -983,6 +986,7 @@ void slap_mods_opattrs(
mod
->
sml_next
=
NULL
;
BER_BVZERO
(
&
mod
->
sml_type
);
mod
->
sml_desc
=
slap_schema
.
si_ad_modifyTimestamp
;
mod
->
sml_numvals
=
1
;
mod
->
sml_values
=
(
BerVarray
)
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_dupbv
(
&
mod
->
sml_values
[
0
],
&
timestamp
);
BER_BVZERO
(
&
mod
->
sml_values
[
1
]
);
...
...
servers/slapd/modrdn.c
View file @
c4dbe1a2
...
...
@@ -428,6 +428,7 @@ slap_modrdn2mods(
mod_tmp
=
(
Modifications
*
)
ch_malloc
(
sizeof
(
Modifications
)
);
mod_tmp
->
sml_desc
=
desc
;
BER_BVZERO
(
&
mod_tmp
->
sml_type
);
mod_tmp
->
sml_numvals
=
1
;
mod_tmp
->
sml_values
=
(
BerVarray
)
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_dupbv
(
&
mod_tmp
->
sml_values
[
0
],
&
new_rdn
[
a_cnt
]
->
la_value
);
mod_tmp
->
sml_values
[
1
].
bv_val
=
NULL
;
...
...
@@ -469,6 +470,7 @@ slap_modrdn2mods(
mod_tmp
=
(
Modifications
*
)
ch_malloc
(
sizeof
(
Modifications
)
);
mod_tmp
->
sml_desc
=
desc
;
BER_BVZERO
(
&
mod_tmp
->
sml_type
);
mod_tmp
->
sml_numvals
=
1
;
mod_tmp
->
sml_values
=
(
BerVarray
)
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_dupbv
(
&
mod_tmp
->
sml_values
[
0
],
&
old_rdn
[
d_cnt
]
->
la_value
);
mod_tmp
->
sml_values
[
1
].
bv_val
=
NULL
;
...
...
servers/slapd/mods.c
View file @
c4dbe1a2
...
...
@@ -289,6 +289,7 @@ modify_delete_vindex(
free
(
a
->
a_nvals
[
j
].
bv_val
);
a
->
a_nvals
[
j
].
bv_val
=
&
dummy
;
}
a
->
a_numvals
--
;
break
;
}
...
...
servers/slapd/operational.c
View file @
c4dbe1a2
...
...
@@ -31,6 +31,7 @@ slap_operational_subschemaSubentry( Backend *be )
a
=
attr_alloc
(
slap_schema
.
si_ad_subschemaSubentry
);
a
->
a_numvals
=
1
;
a
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_dupbv
(
a
->
a_vals
,
&
frontendDB
->
be_schemadn
);
a
->
a_vals
[
1
].
bv_len
=
0
;
...
...
@@ -55,6 +56,7 @@ slap_operational_entryDN( Entry *e )
a
=
attr_alloc
(
slap_schema
.
si_ad_entryDN
);
a
->
a_numvals
=
1
;
a
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_dupbv
(
&
a
->
a_vals
[
0
],
&
e
->
e_name
);
BER_BVZERO
(
&
a
->
a_vals
[
1
]
);
...
...
@@ -75,6 +77,7 @@ slap_operational_hasSubordinate( int hs )
val
=
hs
?
slap_true_bv
:
slap_false_bv
;
a
=
attr_alloc
(
slap_schema
.
si_ad_hasSubordinates
);
a
->
a_numvals
=
1
;
a
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_dupbv
(
&
a
->
a_vals
[
0
],
&
val
);
...
...
servers/slapd/overlays/accesslog.c
View file @
c4dbe1a2
...
...
@@ -1383,6 +1383,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
vals
[
i
].
bv_val
=
NULL
;
vals
[
i
].
bv_len
=
0
;
a
=
attr_alloc
(
logop
==
LOG_EN_ADD
?
ad_reqMod
:
ad_reqOld
);
a
->
a_numvals
=
i
;
a
->
a_vals
=
vals
;
a
->
a_nvals
=
vals
;
last_attr
->
a_next
=
a
;
...
...
@@ -1478,6 +1479,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
if
(
i
>
0
)
{
BER_BVZERO
(
&
vals
[
i
]
);
a
=
attr_alloc
(
ad_reqMod
);
a
->
a_numvals
=
i
;
a
->
a_vals
=
vals
;
a
->
a_nvals
=
vals
;
last_attr
->
a_next
=
a
;
...
...
@@ -1509,6 +1511,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
vals
[
i
].
bv_val
=
NULL
;
vals
[
i
].
bv_len
=
0
;
a
=
attr_alloc
(
ad_reqOld
);
a
->
a_numvals
=
i
;
a
->
a_vals
=
vals
;
a
->
a_nvals
=
vals
;
last_attr
->
a_next
=
a
;
...
...
@@ -1788,10 +1791,9 @@ accesslog_operational( Operation *op, SlapReply *rs )
ad_inlist
(
ad_auditContext
,
rs
->
sr_attrs
)
)
{
*
ap
=
attr_alloc
(
ad_auditContext
);
value_add_one
(
&
(
*
ap
)
->
a_vals
,
&
li
->
li_db
->
be_suffix
[
0
]
);
value_add_one
(
&
(
*
ap
)
->
a_nvals
,
&
li
->
li_db
->
be_nsuffix
[
0
]
);
attr_valadd
(
*
ap
,
&
li
->
li_db
->
be_suffix
[
0
],
&
li
->
li_db
->
be_nsuffix
[
0
],
1
);
}
}
...
...
servers/slapd/overlays/dds.c
View file @
c4dbe1a2
...
...
@@ -788,6 +788,7 @@ done:;
tmpmod
->
sml_op
=
LDAP_MOD_REPLACE
;
value_add_one
(
&
tmpmod
->
sml_values
,
&
bv
);
value_add_one
(
&
tmpmod
->
sml_nvalues
,
&
bv
);
tmpmod
->
sml_numvals
=
1
;
}
}
...
...
servers/slapd/overlays/ppolicy.c
View file @
c4dbe1a2
...
...
@@ -921,6 +921,7 @@ ppolicy_bind_response( Operation *op, SlapReply *rs )
m
->
sml_flags
=
0
;
m
->
sml_type
=
ad_pwdFailureTime
->
ad_cname
;
m
->
sml_desc
=
ad_pwdFailureTime
;
m
->
sml_numvals
=
1
;
m
->
sml_values
=
ch_calloc
(
sizeof
(
struct
berval
),
2
);
m
->
sml_nvalues
=
ch_calloc
(
sizeof
(
struct
berval
),
2
);
...
...
@@ -970,6 +971,7 @@ ppolicy_bind_response( Operation *op, SlapReply *rs )
m
->
sml_flags
=
0
;
m
->
sml_type
=
ad_pwdAccountLockedTime
->
ad_cname
;
m
->
sml_desc
=
ad_pwdAccountLockedTime
;
m
->
sml_numvals
=
1
;
m
->
sml_values
=
ch_calloc
(
sizeof
(
struct
berval
),
2
);
m
->
sml_nvalues
=
ch_calloc
(
sizeof
(
struct
berval
),
2
);
ber_dupbv
(
&
m
->
sml_values
[
0
],
&
timestamp
);
...
...
@@ -1062,6 +1064,7 @@ grace:
m
->
sml_flags
=
0
;
m
->
sml_type
=
ad_pwdGraceUseTime
->
ad_cname
;
m
->
sml_desc
=
ad_pwdGraceUseTime
;
m
->
sml_numvals
=
1
;
m
->
sml_values
=
ch_calloc
(
sizeof
(
struct
berval
),
2
);
m
->
sml_nvalues
=
ch_calloc
(
sizeof
(
struct
berval
),
2
);
ber_dupbv
(
&
m
->
sml_values
[
0
],
&
timestamp
);
...
...
@@ -1469,6 +1472,7 @@ ppolicy_modify( Operation *op, SlapReply *rs )
ml
->
sml_flags
=
SLAP_MOD_INTERNAL
;
ml
->
sml_type
.
bv_val
=
NULL
;
ml
->
sml_desc
=
ad_pwdGraceUseTime
;
ml
->
sml_numvals
=
0
;
ml
->
sml_values
=
NULL
;
ml
->
sml_nvalues
=
NULL
;
ml
->
sml_next
=
NULL
;
...
...
@@ -1481,6 +1485,7 @@ ppolicy_modify( Operation *op, SlapReply *rs )
ml
->
sml_flags
=
SLAP_MOD_INTERNAL
;
ml
->
sml_type
.
bv_val
=
NULL
;
ml
->
sml_desc
=
ad_pwdAccountLockedTime
;
ml
->
sml_numvals
=
0
;
ml
->
sml_values
=
NULL
;
ml
->
sml_nvalues
=
NULL
;
ml
->
sml_next
=
NULL
;
...
...
@@ -1492,6 +1497,7 @@ ppolicy_modify( Operation *op, SlapReply *rs )
ml
->
sml_flags
=
SLAP_MOD_INTERNAL
;
ml
->
sml_type
.
bv_val
=
NULL
;
ml
->
sml_desc
=
ad_pwdFailureTime
;
ml
->
sml_numvals
=
0
;
ml
->
sml_values
=
NULL
;
ml
->
sml_nvalues
=
NULL
;
ml
->
sml_next
=
NULL
;
...
...
@@ -1671,6 +1677,7 @@ ppolicy_modify( Operation *op, SlapReply *rs )
ml
->
sml_flags
=
SLAP_MOD_INTERNAL
;
ml
->
sml_desc
=
pp
.
ad
;
ml
->
sml_type
=
pp
.
ad
->
ad_cname
;
ml
->
sml_numvals
=
1
;
ml
->
sml_values
=
(
BerVarray
)
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_dupbv
(
&
ml
->
sml_values
[
0
],
&
oldpw
);
BER_BVZERO
(
&
ml
->
sml_values
[
1
]
);
...
...
@@ -1838,6 +1845,7 @@ do_modify:
mods
->
sml_desc
=
ad_pwdChangedTime
;
if
(
pwmop
!=
LDAP_MOD_DELETE
)
{
mods
->
sml_op
=
LDAP_MOD_REPLACE
;
mods
->
sml_numvals
=
1
;
mods
->
sml_values
=
(
BerVarray
)
ch_malloc
(
2
*
sizeof
(
struct
berval
)
);
ber_dupbv
(
&
mods
->
sml_values
[
0
],
&
timestamp
);
BER_BVZERO
(
&
mods
->
sml_values
[
1
]
);
...
...
@@ -1914,6 +1922,7 @@ do_modify:
mods
->
sml_op
=
LDAP_MOD_DELETE
;
mods
->
sml_flags
=
SLAP_MOD_INTERNAL
;
mods
->
sml_desc
=
ad_pwdHistory
;
mods
->
sml_numvals
=
hsize
-
pp
.
pwdInHistory
+
1
;
mods
->
sml_values
=
ch_calloc
(
sizeof
(
struct
berval
),
hsize
-
pp
.
pwdInHistory
+
2
);
BER_BVZERO
(
&
mods
->
sml_values
[
hsize
-
pp
.
pwdInHistory
+
1
]
);
...
...
@@ -1945,6 +1954,7 @@ do_modify:
mods
->
sml_type
.
bv_val
=
NULL
;
mods
->
sml_desc
=
ad_pwdHistory
;
mods
->
sml_nvalues
=
NULL
;
mods
->
sml_numvals
=
1
;
mods
->
sml_values
=
ch_calloc
(
sizeof
(
struct
berval
),
2
);
mods
->
sml_values
[
1
].
bv_val
=
NULL
;
mods
->
sml_values
[
1
].
bv_len
=
0
;
...
...
servers/slapd/overlays/refint.c
View file @
c4dbe1a2
...
...
@@ -461,7 +461,7 @@ refint_search_cb(
ber_bvarray_add_x
(
&
na
->
new_nvals
,
&
newdn
,
op
->
o_tmpmemctx
);
}
/* count de
tel
es */
/* count de
let
es */
if
(
BER_BVISEMPTY
(
&
rq
->
newdn
)
)
{
deleted
++
;
}
...
...
@@ -642,6 +642,7 @@ refint_qtask( void *ctx, void *arg )
m
->
sml_flags
=
SLAP_MOD_INTERNAL
;
m
->
sml_desc
=
slap_schema
.
si_ad_modifiersName
;
m
->
sml_type
=
m
->
sml_desc
->
ad_cname
;
m
->
sml_numvals
=
1
;
m
->
sml_values
=
(
BerVarray
)(
m
+
1
);
m
->
sml_nvalues
=
m
->
sml_values
+
2
;
BER_BVZERO
(
&
m
->
sml_values
[
1
]
);
...
...
@@ -672,6 +673,7 @@ refint_qtask( void *ctx, void *arg )
m
->
sml_nvalues
=
m
->
sml_values
+
2
;
BER_BVZERO
(
&
m
->
sml_values
[
1
]
);
BER_BVZERO
(
&
m
->
sml_nvalues
[
1
]
);
m
->
sml_numvals
=
1
;
if
(
BER_BVISEMPTY
(
&
rq
->
newdn
))
{
op
->
o_tmpfree
(
ra
,
op
->
o_tmpmemctx
);
ra
=
dp
->
attrs
;
...
...
servers/slapd/overlays/rwm.c
View file @
c4dbe1a2
...
...
@@ -1225,6 +1225,7 @@ cleanup_attr:;
mod
.
sm_op
=
LDAP_MOD_ADD
;
mod
.
sm_desc
=
(
*
ap
)
->
a_desc
;