Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
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
openldap
OpenLDAP
Commits
8ac304ee
Commit
8ac304ee
authored
19 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Add client-side ManageDIT control support
(to be used to 'manage' DIT entries).
parent
377db530
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
clients/tools/common.c
+31
-2
31 additions, 2 deletions
clients/tools/common.c
include/ldap.h
+1
-0
1 addition, 0 deletions
include/ldap.h
tests/scripts/test037-manage
+10
-1
10 additions, 1 deletion
tests/scripts/test037-manage
with
42 additions
and
3 deletions
clients/tools/common.c
+
31
−
2
View file @
8ac304ee
...
...
@@ -63,6 +63,7 @@ int use_tls = 0;
int
assertctl
;
char
*
assertion
=
NULL
;
char
*
authzid
=
NULL
;
int
manageDIT
=
0
;
int
manageDSAit
=
0
;
int
noop
=
0
;
int
ppolicy
=
0
;
...
...
@@ -133,6 +134,7 @@ N_(" [!]chaining[=<resolveBehavior>[/<continuationBehavior>]]\n")
N_
(
" one of
\"
chainingPreferred
\"
,
\"
chainingRequired
\"
,
\n
"
)
N_
(
"
\"
referralsPreferred
\"
,
\"
referralsRequired
\"\n
"
)
#endif
/* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
N_
(
" [!]manageDIT
\n
"
)
N_
(
" [!]manageDSAit
\n
"
)
N_
(
" [!]noop
\n
"
)
#ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST
...
...
@@ -256,6 +258,20 @@ tool_args( int argc, char **argv )
assert
(
authzid
==
NULL
);
authzid
=
cvalue
;
}
else
if
(
strcasecmp
(
control
,
"manageDIT"
)
==
0
)
{
if
(
manageDIT
)
{
fprintf
(
stderr
,
"manageDIT control previously specified
\n
"
);
exit
(
EXIT_FAILURE
);
}
if
(
cvalue
!=
NULL
)
{
fprintf
(
stderr
,
"manageDIT: no control value expected
\n
"
);
usage
();
}
manageDIT
=
1
+
crit
;
}
else
if
(
strcasecmp
(
control
,
"manageDSAit"
)
==
0
)
{
if
(
manageDSAit
)
{
fprintf
(
stderr
,
...
...
@@ -720,7 +736,12 @@ tool_args( int argc, char **argv )
}
}
if
(
protocol
==
LDAP_VERSION2
)
{
if
(
authzid
||
manageDSAit
||
noop
||
ppolicy
)
{
if
(
assertctl
||
authzid
||
manageDIT
||
manageDSAit
||
#ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
chaining
||
#endif
noop
||
ppolicy
||
preread
||
postread
)
{
fprintf
(
stderr
,
"%s: -e/-M incompatible with LDAPv2
\n
"
,
prog
);
exit
(
EXIT_FAILURE
);
}
...
...
@@ -968,7 +989,7 @@ void
tool_server_controls
(
LDAP
*
ld
,
LDAPControl
*
extra_c
,
int
count
)
{
int
i
=
0
,
j
,
crit
=
0
,
err
;
LDAPControl
c
[
9
],
**
ctrls
;
LDAPControl
c
[
10
],
**
ctrls
;
ctrls
=
(
LDAPControl
**
)
malloc
(
sizeof
(
c
)
+
(
count
+
1
)
*
sizeof
(
LDAPControl
*
));
if
(
ctrls
==
NULL
)
{
...
...
@@ -1014,6 +1035,14 @@ tool_server_controls( LDAP *ld, LDAPControl *extra_c, int count )
i
++
;
}
if
(
manageDIT
)
{
c
[
i
].
ldctl_oid
=
LDAP_CONTROL_MANAGEDIT
;
BER_BVZERO
(
&
c
[
i
].
ldctl_value
);
c
[
i
].
ldctl_iscritical
=
manageDIT
>
1
;
ctrls
[
i
]
=
&
c
[
i
];
i
++
;
}
if
(
manageDSAit
)
{
c
[
i
].
ldctl_oid
=
LDAP_CONTROL_MANAGEDSAIT
;
BER_BVZERO
(
&
c
[
i
].
ldctl_value
);
...
...
This diff is collapsed.
Click to expand it.
include/ldap.h
+
1
−
0
View file @
8ac304ee
...
...
@@ -220,6 +220,7 @@ typedef struct ldapcontrol {
#define LDAP_CONTROL_NOOP "1.3.6.1.4.1.4203.666.5.2"
#define LDAP_CONTROL_PRE_READ "1.3.6.1.4.1.4203.666.5.10.1"
#define LDAP_CONTROL_POST_READ "1.3.6.1.4.1.4203.666.5.10.2"
#define LDAP_CONTROL_MANAGEDIT "1.3.6.1.4.1.4203.666.5.11"
/* LDAP Duplicated Entry Control Extension *//* not implemented in slapd(8) */
#define LDAP_CONTROL_DUPENT_REQUEST "2.16.840.1.113719.1.27.101.1"
...
...
This diff is collapsed.
Click to expand it.
tests/scripts/test037-manage
+
10
−
1
View file @
8ac304ee
...
...
@@ -58,7 +58,8 @@ if test $RC != 0 ; then
fi
echo
"Testing modify, add, and delete..."
$LDAPMODIFY
-v
-MM
-D
"
$MANAGERDN
"
-h
$LOCALHOST
-p
$PORT1
-w
$PASSWD
>
\
$LDAPMODIFY
-v
-D
"
$MANAGERDN
"
-h
$LOCALHOST
-p
$PORT1
-w
$PASSWD
\
-e
\!
ManageDIT
>
\
$TESTOUT
2>&1
<<
EOMODS
version: 1
...
...
@@ -69,6 +70,9 @@ dn: cn=James A Jones 1,ou=Alumni Association,ou=People,dc=example,dc=com
changetype: modify
replace: objectClass
objectClass: testPerson
-
replace: objectClass
objectClass: structuralObjectClass
dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc=com
# update structural object class of entry via objectClass modify
...
...
@@ -78,6 +82,11 @@ objectClass: OpenLDAPperson
-
add: objectClass
objectClass: testPerson
-
delete: structuralObjectClass
-
add: objectClass
objectClass: testPerson
dn: cn=ITD Staff,ou=Groups,dc=example,dc=com
# change entryUUID
...
...
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