Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dimitar Stoychev
OpenLDAP
Commits
69fbd2e6
Commit
69fbd2e6
authored
20 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
propagate opattrs if shadow update
parent
3118f1fd
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servers/slapd/back-meta/add.c
+10
-8
10 additions, 8 deletions
servers/slapd/back-meta/add.c
servers/slapd/back-meta/modify.c
+13
-11
13 additions, 11 deletions
servers/slapd/back-meta/modify.c
servers/slapd/overlays/rwm.c
+9
-3
9 additions, 3 deletions
servers/slapd/overlays/rwm.c
with
32 additions
and
22 deletions
servers/slapd/back-meta/add.c
+
10
−
8
View file @
69fbd2e6
...
@@ -35,13 +35,14 @@
...
@@ -35,13 +35,14 @@
int
int
meta_back_add
(
Operation
*
op
,
SlapReply
*
rs
)
meta_back_add
(
Operation
*
op
,
SlapReply
*
rs
)
{
{
struct
metainfo
*
li
=
(
struct
metainfo
*
)
op
->
o_bd
->
be_private
;
struct
metainfo
*
li
=
(
struct
metainfo
*
)
op
->
o_bd
->
be_private
;
struct
metaconn
*
lc
;
struct
metaconn
*
lc
;
int
i
,
candidate
=
-
1
;
int
i
,
candidate
=
-
1
;
Attribute
*
a
;
int
isupdate
;
LDAPMod
**
attrs
;
Attribute
*
a
;
struct
berval
mdn
=
BER_BVNULL
,
mapped
;
LDAPMod
**
attrs
;
dncookie
dc
;
struct
berval
mdn
=
BER_BVNULL
,
mapped
;
dncookie
dc
;
Debug
(
LDAP_DEBUG_ARGS
,
"==> meta_back_add: %s
\n
"
,
Debug
(
LDAP_DEBUG_ARGS
,
"==> meta_back_add: %s
\n
"
,
op
->
o_req_dn
.
bv_val
,
0
,
0
);
op
->
o_req_dn
.
bv_val
,
0
,
0
);
...
@@ -81,10 +82,11 @@ meta_back_add( Operation *op, SlapReply *rs )
...
@@ -81,10 +82,11 @@ meta_back_add( Operation *op, SlapReply *rs )
/* Create array of LDAPMods for ldap_add() */
/* Create array of LDAPMods for ldap_add() */
attrs
=
ch_malloc
(
sizeof
(
LDAPMod
*
)
*
i
);
attrs
=
ch_malloc
(
sizeof
(
LDAPMod
*
)
*
i
);
isupdate
=
be_shadow_update
(
op
);
for
(
i
=
0
,
a
=
op
->
ora_e
->
e_attrs
;
a
;
a
=
a
->
a_next
)
{
for
(
i
=
0
,
a
=
op
->
ora_e
->
e_attrs
;
a
;
a
=
a
->
a_next
)
{
int
j
;
int
j
;
if
(
a
->
a_desc
->
ad_type
->
sat_no_user_mod
)
{
if
(
!
isupdate
&&
a
->
a_desc
->
ad_type
->
sat_no_user_mod
)
{
continue
;
continue
;
}
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-meta/modify.c
+
13
−
11
View file @
69fbd2e6
...
@@ -34,16 +34,17 @@
...
@@ -34,16 +34,17 @@
int
int
meta_back_modify
(
Operation
*
op
,
SlapReply
*
rs
)
meta_back_modify
(
Operation
*
op
,
SlapReply
*
rs
)
{
{
struct
metainfo
*
li
=
(
struct
metainfo
*
)
op
->
o_bd
->
be_private
;
struct
metainfo
*
li
=
(
struct
metainfo
*
)
op
->
o_bd
->
be_private
;
struct
metaconn
*
lc
;
struct
metaconn
*
lc
;
int
rc
=
0
;
int
rc
=
0
;
LDAPMod
**
modv
=
NULL
;
LDAPMod
**
modv
=
NULL
;
LDAPMod
*
mods
=
NULL
;
LDAPMod
*
mods
=
NULL
;
Modifications
*
ml
;
Modifications
*
ml
;
int
candidate
=
-
1
,
i
;
int
candidate
=
-
1
,
i
;
struct
berval
mdn
=
BER_BVNULL
;
int
isupdate
;
struct
berval
mapped
;
struct
berval
mdn
=
BER_BVNULL
;
dncookie
dc
;
struct
berval
mapped
;
dncookie
dc
;
lc
=
meta_back_getconn
(
op
,
rs
,
META_OP_REQUIRE_SINGLE
,
lc
=
meta_back_getconn
(
op
,
rs
,
META_OP_REQUIRE_SINGLE
,
&
op
->
o_req_ndn
,
&
candidate
);
&
op
->
o_req_ndn
,
&
candidate
);
...
@@ -94,10 +95,11 @@ meta_back_modify( Operation *op, SlapReply *rs )
...
@@ -94,10 +95,11 @@ meta_back_modify( Operation *op, SlapReply *rs )
}
}
dc
.
ctx
=
"modifyAttrDN"
;
dc
.
ctx
=
"modifyAttrDN"
;
isupdate
=
be_shadow_update
(
op
);
for
(
i
=
0
,
ml
=
op
->
orm_modlist
;
ml
;
ml
=
ml
->
sml_next
)
{
for
(
i
=
0
,
ml
=
op
->
orm_modlist
;
ml
;
ml
=
ml
->
sml_next
)
{
int
j
;
int
j
;
if
(
ml
->
sml_desc
->
ad_type
->
sat_no_user_mod
)
{
if
(
!
isupdate
&&
ml
->
sml_desc
->
ad_type
->
sat_no_user_mod
)
{
continue
;
continue
;
}
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/overlays/rwm.c
+
9
−
3
View file @
69fbd2e6
...
@@ -96,6 +96,7 @@ rwm_op_add( Operation *op, SlapReply *rs )
...
@@ -96,6 +96,7 @@ rwm_op_add( Operation *op, SlapReply *rs )
i
;
i
;
Attribute
**
ap
=
NULL
;
Attribute
**
ap
=
NULL
;
char
*
olddn
=
op
->
o_req_dn
.
bv_val
;
char
*
olddn
=
op
->
o_req_dn
.
bv_val
;
int
isupdate
;
#ifdef ENABLE_REWRITE
#ifdef ENABLE_REWRITE
rc
=
rwm_op_dn_massage
(
op
,
rs
,
"addDN"
);
rc
=
rwm_op_dn_massage
(
op
,
rs
,
"addDN"
);
...
@@ -118,11 +119,12 @@ rwm_op_add( Operation *op, SlapReply *rs )
...
@@ -118,11 +119,12 @@ rwm_op_add( Operation *op, SlapReply *rs )
}
}
/* Count number of attributes in entry */
/* Count number of attributes in entry */
isupdate
=
be_shadow_update
(
op
);
for
(
i
=
0
,
ap
=
&
op
->
oq_add
.
rs_e
->
e_attrs
;
*
ap
;
)
{
for
(
i
=
0
,
ap
=
&
op
->
oq_add
.
rs_e
->
e_attrs
;
*
ap
;
)
{
struct
berval
mapped
;
struct
berval
mapped
;
Attribute
*
a
;
Attribute
*
a
;
if
(
(
*
ap
)
->
a_desc
->
ad_type
->
sat_no_user_mod
)
{
if
(
!
isupdate
&&
(
*
ap
)
->
a_desc
->
ad_type
->
sat_no_user_mod
)
{
goto
next_attr
;
goto
next_attr
;
}
}
...
@@ -340,6 +342,7 @@ rwm_op_modify( Operation *op, SlapReply *rs )
...
@@ -340,6 +342,7 @@ rwm_op_modify( Operation *op, SlapReply *rs )
struct
ldaprwmap
*
rwmap
=
struct
ldaprwmap
*
rwmap
=
(
struct
ldaprwmap
*
)
on
->
on_bi
.
bi_private
;
(
struct
ldaprwmap
*
)
on
->
on_bi
.
bi_private
;
int
isupdate
;
Modifications
**
mlp
;
Modifications
**
mlp
;
int
rc
;
int
rc
;
...
@@ -355,11 +358,12 @@ rwm_op_modify( Operation *op, SlapReply *rs )
...
@@ -355,11 +358,12 @@ rwm_op_modify( Operation *op, SlapReply *rs )
return
-
1
;
return
-
1
;
}
}
isupdate
=
be_shadow_update
(
op
);
for
(
mlp
=
&
op
->
oq_modify
.
rs_modlist
;
*
mlp
;
)
{
for
(
mlp
=
&
op
->
oq_modify
.
rs_modlist
;
*
mlp
;
)
{
int
is_oc
=
0
;
int
is_oc
=
0
;
Modifications
*
ml
;
Modifications
*
ml
;
if
(
(
*
mlp
)
->
sml_desc
->
ad_type
->
sat_no_user_mod
)
{
if
(
!
isupdate
&&
(
*
mlp
)
->
sml_desc
->
ad_type
->
sat_no_user_mod
)
{
goto
next_mod
;
goto
next_mod
;
}
}
...
@@ -745,6 +749,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
...
@@ -745,6 +749,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
dncookie
dc
;
dncookie
dc
;
int
rc
;
int
rc
;
Attribute
**
ap
;
Attribute
**
ap
;
int
isupdate
;
/*
/*
* Rewrite the dn attrs, if needed
* Rewrite the dn attrs, if needed
...
@@ -770,6 +775,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
...
@@ -770,6 +775,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
* an error (because multiple instances of attrs in
* an error (because multiple instances of attrs in
* response are not valid), or merge the values (what
* response are not valid), or merge the values (what
* about duplicate values?) */
* about duplicate values?) */
isupdate
=
be_shadow_update
(
op
);
for
(
ap
=
a_first
;
*
ap
;
)
{
for
(
ap
=
a_first
;
*
ap
;
)
{
struct
ldapmapping
*
m
;
struct
ldapmapping
*
m
;
int
drop_missing
;
int
drop_missing
;
...
@@ -787,7 +793,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
...
@@ -787,7 +793,7 @@ rwm_attrs( Operation *op, SlapReply *rs, Attribute** a_first )
goto
cleanup_attr
;
goto
cleanup_attr
;
}
}
if
(
(
*
ap
)
->
a_desc
->
ad_type
->
sat_no_user_mod
if
(
!
isupdate
&&
(
*
ap
)
->
a_desc
->
ad_type
->
sat_no_user_mod
&&
(
*
ap
)
->
a_desc
->
ad_type
!=
slap_schema
.
si_at_undefined
)
&&
(
*
ap
)
->
a_desc
->
ad_type
!=
slap_schema
.
si_at_undefined
)
{
{
goto
next_attr
;
goto
next_attr
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment