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
Christopher Ng
OpenLDAP
Commits
0057b66f
Commit
0057b66f
authored
20 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
improve previous commit; implement missing objectClass mapping feature
parent
64668f72
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
servers/slapd/back-meta/add.c
+2
-2
2 additions, 2 deletions
servers/slapd/back-meta/add.c
servers/slapd/back-meta/modify.c
+49
-22
49 additions, 22 deletions
servers/slapd/back-meta/modify.c
with
51 additions
and
24 deletions
servers/slapd/back-meta/add.c
+
2
−
2
View file @
0057b66f
...
...
@@ -108,8 +108,8 @@ meta_back_add( Operation *op, SlapReply *rs )
* to allow their use in ACLs at the back-ldap
* level.
*/
if
(
strcmp
(
a
->
a_desc
->
ad_type
->
sat_syntax
->
ssyn_oid
,
SLAPD_DN_SYNTAX
)
==
0
)
if
(
a
->
a_desc
->
ad_type
->
sat_syntax
==
slap_schema
.
si_syn_distinguishedName
)
{
(
void
)
ldap_dnattr_rewrite
(
&
dc
,
a
->
a_vals
);
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-meta/modify.c
+
49
−
22
View file @
0057b66f
...
...
@@ -97,17 +97,25 @@ meta_back_modify( Operation *op, SlapReply *rs )
dc
.
ctx
=
"modifyAttrDN"
;
isupdate
=
be_shadow_update
(
op
);
for
(
i
=
0
,
ml
=
op
->
orm_modlist
;
ml
;
ml
=
ml
->
sml_next
)
{
int
j
;
int
j
,
is_oc
=
0
;
if
(
!
isupdate
&&
ml
->
sml_desc
->
ad_type
->
sat_no_user_mod
)
{
continue
;
}
ldap_back_map
(
&
li
->
targets
[
candidate
]
->
mt_rwmap
.
rwm_at
,
&
ml
->
sml_desc
->
ad_cname
,
&
mapped
,
BACKLDAP_MAP
);
if
(
BER_BVISNULL
(
&
mapped
)
||
BER_BVISEMPTY
(
&
mapped
)
)
{
continue
;
if
(
ml
->
sml_desc
==
slap_schema
.
si_ad_objectClass
||
ml
->
sml_desc
==
slap_schema
.
si_ad_structuralObjectClass
)
{
is_oc
=
1
;
mapped
=
ml
->
sml_desc
->
ad_cname
;
}
else
{
ldap_back_map
(
&
li
->
targets
[
candidate
]
->
mt_rwmap
.
rwm_at
,
&
ml
->
sml_desc
->
ad_cname
,
&
mapped
,
BACKLDAP_MAP
);
if
(
BER_BVISNULL
(
&
mapped
)
||
BER_BVISEMPTY
(
&
mapped
)
)
{
continue
;
}
}
modv
[
i
]
=
&
mods
[
i
];
...
...
@@ -120,19 +128,39 @@ meta_back_modify( Operation *op, SlapReply *rs )
* level.
*/
if
(
ml
->
sml_values
!=
NULL
)
{
/* mod_op must be delete all values */
if
(
strcmp
(
ml
->
sml_desc
->
ad_type
->
sat_syntax
->
ssyn_oid
,
SLAPD_DN_SYNTAX
)
==
0
)
{
(
void
)
ldap_dnattr_rewrite
(
&
dc
,
ml
->
sml_values
);
}
if
(
is_oc
)
{
for
(
j
=
0
;
!
BER_BVISNULL
(
&
ml
->
sml_values
[
j
]
);
j
++
)
;
mods
[
i
].
mod_bvalues
=
(
struct
berval
**
)
ch_malloc
(
(
j
+
1
)
*
sizeof
(
struct
berval
*
)
);
for
(
j
=
0
;
!
BER_BVISNULL
(
&
ml
->
sml_values
[
j
]
);
j
++
)
{
ldap_back_map
(
&
li
->
targets
[
candidate
]
->
mt_rwmap
.
rwm_oc
,
&
ml
->
sml_values
[
j
],
&
mapped
,
BACKLDAP_MAP
);
if
(
BER_BVISNULL
(
&
mapped
)
||
BER_BVISEMPTY
(
&
mapped
)
)
{
continue
;
}
mods
[
i
].
mod_bvalues
[
j
]
=
&
mapped
;
}
mods
[
i
].
mod_bvalues
[
j
]
=
NULL
;
}
else
{
if
(
ml
->
sml_desc
->
ad_type
->
sat_syntax
==
slap_schema
.
si_syn_distinguishedName
)
{
(
void
)
ldap_dnattr_rewrite
(
&
dc
,
ml
->
sml_values
);
if
(
ml
->
sml_values
==
NULL
)
{
continue
;
}
}
if
(
ml
->
sml_values
!=
NULL
)
{
for
(
j
=
0
;
!
BER_BVISNULL
(
&
ml
->
sml_values
[
j
]
);
j
++
)
;
mods
[
i
].
mod_bvalues
=
(
struct
berval
**
)
ch_malloc
(
(
j
+
1
)
*
sizeof
(
struct
berval
*
)
);
sizeof
(
struct
berval
*
)
);
for
(
j
=
0
;
!
BER_BVISNULL
(
&
ml
->
sml_values
[
j
]
);
j
++
)
{
mods
[
i
].
mod_bvalues
[
j
]
=
&
ml
->
sml_values
[
j
];
}
...
...
@@ -147,8 +175,8 @@ meta_back_modify( Operation *op, SlapReply *rs )
}
modv
[
i
]
=
0
;
r
c
=
ldap_modify_ext_s
(
lc
->
mc_conns
[
candidate
].
msc_ld
,
mdn
.
bv_val
,
modv
,
NULL
,
NULL
)
!=
LDAP_SUCCESS
;
r
s
->
sr_err
=
ldap_modify_ext_s
(
lc
->
mc_conns
[
candidate
].
msc_ld
,
mdn
.
bv_val
,
modv
,
NULL
,
NULL
);
cleanup:
;
if
(
mdn
.
bv_val
!=
op
->
o_req_dn
.
bv_val
)
{
...
...
@@ -162,14 +190,13 @@ cleanup:;
}
free
(
mods
);
free
(
modv
);
if
(
rc
==
0
)
{
return
meta_back_op_result
(
lc
,
op
,
rs
)
==
LDAP_SUCCESS
?
0
:
1
;
}
/* else */
if
(
rc
!=
-
1
)
{
return
meta_back_op_result
(
lc
,
op
,
rs
);
}
send_ldap_result
(
op
,
rs
);
return
r
c
;
return
r
s
->
sr_err
;
}
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