Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Jaak Ristioja
OpenLDAP
Commits
86bd1384
Commit
86bd1384
authored
25 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Additional -DSLAPD_SCHEMA_NOT_COMPAT changes
Not hidden "NULLDN" to "<anonymous>" in modify stats
parent
655c0bda
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
servers/slapd/add.c
+2
-1
2 additions, 1 deletion
servers/slapd/add.c
servers/slapd/modify.c
+70
-21
70 additions, 21 deletions
servers/slapd/modify.c
servers/slapd/slap.h
+7
-7
7 additions, 7 deletions
servers/slapd/slap.h
with
79 additions
and
29 deletions
servers/slapd/add.c
+
2
−
1
View file @
86bd1384
...
...
@@ -256,7 +256,8 @@ add_created_attrs( Operation *op, Entry *e )
if
(
op
->
o_dn
==
NULL
||
op
->
o_dn
[
0
]
==
'\0'
)
{
bv
.
bv_val
=
"<anonymous>"
;
bv
.
bv_len
=
strlen
(
bv
.
bv_val
);
bv
.
bv_len
=
sizeof
(
"<anonymous>"
)
-
1
;
;
}
else
{
bv
.
bv_val
=
op
->
o_dn
;
bv
.
bv_len
=
strlen
(
bv
.
bv_val
);
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/modify.c
+
70
−
21
View file @
86bd1384
...
...
@@ -27,6 +27,14 @@
#include
"slap.h"
static
void
modlist_free
(
LDAPModList
*
ml
);
static
void
mods_free
(
Modifications
*
mods
);
#ifdef SLAPD_SCHEMA_NOT_COMPAT
/* static */
int
modlist2mods
(
LDAPModList
*
ml
,
Modifications
**
mods
,
char
**
text
);
#endif
static
int
add_modified_attrs
(
Operation
*
op
,
Modifications
**
modlist
);
...
...
@@ -42,10 +50,10 @@ do_modify(
ber_len_t
len
;
LDAPModList
*
modlist
=
NULL
;
LDAPModList
**
modtail
=
&
modlist
;
Modifications
*
mods
=
NULL
;
#ifdef LDAP_DEBUG
Modifications
*
tmp
;
LDAPModList
*
tmp
;
#endif
Modifications
*
mods
=
NULL
;
Backend
*
be
;
int
rc
;
...
...
@@ -158,24 +166,13 @@ do_modify(
goto
cleanup
;
}
#ifdef SLAPD_SCHEMA_NOT_COMPAT
/* not yet implemented */
#else
mods
=
modlist
;
#endif
#ifdef LDAP_DEBUG
Debug
(
LDAP_DEBUG_ARGS
,
"modifications:
\n
"
,
0
,
0
,
0
);
for
(
tmp
=
mods
;
tmp
!=
NULL
;
tmp
=
tmp
->
sml_next
)
{
#ifdef SLAPD_SCHEMA_NOT_COMPAT
char
*
type
=
tmp
->
sml_desc
.
ad_cname
->
bv_val
;
#else
char
*
type
=
tmp
->
sml_type
;
#endif
for
(
tmp
=
modlist
;
tmp
!=
NULL
;
tmp
=
tmp
->
ml_next
)
{
Debug
(
LDAP_DEBUG_ARGS
,
"
\t
%s: %s
\n
"
,
tmp
->
s
ml_op
==
LDAP_MOD_ADD
?
"add"
:
(
tmp
->
s
ml_op
==
LDAP_MOD_DELETE
?
"delete"
:
"replace"
),
type
,
0
);
tmp
->
ml_op
==
LDAP_MOD_ADD
?
"add"
:
(
tmp
->
ml_op
==
LDAP_MOD_DELETE
?
"delete"
:
"replace"
),
tmp
->
ml_
type
,
0
);
}
#endif
...
...
@@ -231,6 +228,20 @@ do_modify(
strcmp
(
be
->
be_update_ndn
,
op
->
o_ndn
)
==
0
)
#endif
{
#ifdef SLAPD_SCHEMA_NOT_COMPAT
char
*
text
;
rc
=
modlist2mods
(
modlist
,
&
mods
,
&
text
);
if
(
rc
!=
LDAP_SUCCESS
)
{
send_ldap_result
(
conn
,
op
,
rc
,
NULL
,
text
,
NULL
,
NULL
);
goto
cleanup
;
}
#else
mods
=
modlist
;
modlist
=
NULL
;
#endif
if
(
(
be
->
be_lastmod
==
ON
||
(
be
->
be_lastmod
==
UNDEFINED
&&
global_lastmod
==
ON
))
&&
be
->
be_update_ndn
==
NULL
)
{
...
...
@@ -272,12 +283,17 @@ cleanup:
free
(
ndn
);
if
(
modlist
!=
NULL
)
modlist_free
(
modlist
);
if
(
mods
!=
NULL
)
mods_free
(
mods
);
return
rc
;
}
static
int
add_modified_attrs
(
Operation
*
op
,
Modifications
**
modlist
)
{
#ifdef SLAPD_SCHEMA_NOT_COMPAT
/* not yet implemented */
#else
char
buf
[
22
];
struct
berval
bv
;
struct
berval
*
bvals
[
2
];
...
...
@@ -288,9 +304,6 @@ add_modified_attrs( Operation *op, Modifications **modlist )
bvals
[
0
]
=
&
bv
;
bvals
[
1
]
=
NULL
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
/* not yet implemented */
#else
/* remove any attempts by the user to modify these attrs */
for
(
m
=
*
modlist
;
m
!=
NULL
;
m
=
m
->
ml_next
)
{
if
(
oc_check_op_no_usermod_attr
(
m
->
ml_type
)
)
{
...
...
@@ -300,7 +313,7 @@ add_modified_attrs( Operation *op, Modifications **modlist )
if
(
op
->
o_dn
==
NULL
||
op
->
o_dn
[
0
]
==
'\0'
)
{
bv
.
bv_val
=
"<anonymous>"
;
bv
.
bv_len
=
s
trlen
(
bv
.
bv_val
)
;
bv
.
bv_len
=
s
izeof
(
"<anonymous>"
)
-
1
;
}
else
{
bv
.
bv_val
=
op
->
o_dn
;
bv
.
bv_len
=
strlen
(
bv
.
bv_val
);
...
...
@@ -333,6 +346,42 @@ add_modified_attrs( Operation *op, Modifications **modlist )
return
LDAP_SUCCESS
;
}
static
void
mod_free
(
Modification
*
mod
,
int
freeit
)
{
#ifdef SLAPD_SCHEMA_NOT_COMPAT
ad_free
(
&
mod
->
sm_desc
,
0
);
#else
if
(
mod
->
sm_desc
)
{
free
(
mod
->
sm_desc
);
}
#endif
if
(
mod
->
sm_bvalues
!=
NULL
)
ber_bvecfree
(
mod
->
sm_bvalues
);
if
(
freeit
)
free
(
mod
);
}
static
void
mods_free
(
Modifications
*
ml
)
{
Modifications
*
next
;
for
(
;
ml
!=
NULL
;
ml
=
next
)
{
next
=
ml
->
sml_next
;
mod_free
(
&
ml
->
sml_mod
,
0
);
free
(
ml
);
}
}
static
void
modlist_free
(
LDAPModList
*
ml
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/slap.h
+
7
−
7
View file @
86bd1384
...
...
@@ -92,7 +92,7 @@ LDAP_BEGIN_DECL
/* schema needed by slapd */
#define SLAPD_OID_DN_SYNTAX "1.3.6.1.4.1.1466.115.121.1.12"
#define SLAPD_OID_ACI_SYNTAX "1.3.6.1.4.1.4203.2.1"
/* experimental */
#define SLAPD_OID_ACI_SYNTAX "1.3.6.1.4.1.4203.
666.
2.1"
/* experimental */
LIBSLAPD_F
(
int
)
slap_debug
;
...
...
@@ -478,19 +478,19 @@ typedef struct slap_mod {
}
Modification
;
#else
#define Modification LDAPMod
#define sm_op mod_op
#define sm_desc mod_type
#define sm_type mod_type
#define sm_bvalues mod_bvalues
#endif
typedef
struct
slap_mod_list
{
Modification
sml_mod
;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
#define sml_op sml_mod.sm_op
#define sml_desc sml_mod.sm_desc
#define sml_bvalues sml_mod.sm_bvalues
#else
#define sml_op sml_mod.mod_op
#define sml_type sml_mod.mod_type
#define sml_values sml_mod.mod_values
#define sml_bvalues sml_mod.mod_bvalues
#ifndef SLAPD_SCHEMA_NOT_COMPAT
#define sml_type sml_mod.sm_type
#endif
struct
slap_mod_list
*
sml_next
;
}
Modifications
;
...
...
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