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
0624a31c
Commit
0624a31c
authored
24 years ago
by
Randy Kunkee
Browse files
Options
Downloads
Patches
Plain Diff
Fix several bugs with dereferencing aliases and create 'compare' subcommand.
parent
3cfb6b3b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/ldaptcl/neoXldap.c
+36
-1
36 additions, 1 deletion
contrib/ldaptcl/neoXldap.c
with
36 additions
and
1 deletion
contrib/ldaptcl/neoXldap.c
+
36
−
1
View file @
0624a31c
...
...
@@ -797,7 +797,7 @@ NeoX_LdapTargetObjCmd (clientData, interp, objc, objv)
deref
=
LDAP_DEREF_NEVER
;
else
if
(
STREQU
(
derefString
,
"search"
))
deref
=
LDAP_DEREF_SEARCHING
;
else
if
(
STREQU
(
derefString
,
"find"
)
==
0
)
else
if
(
STREQU
(
derefString
,
"find"
))
deref
=
LDAP_DEREF_FINDING
;
else
if
(
STREQU
(
derefString
,
"always"
))
deref
=
LDAP_DEREF_ALWAYS
;
...
...
@@ -886,6 +886,9 @@ NeoX_LdapTargetObjCmd (clientData, interp, objc, objv)
ldap_disable_cache(ldap);
}
#endif
ldap_set_option
(
ldap
,
LDAP_OPT_DEREF
,
&
deref
);
tclResult
=
LDAP_PerformSearch
(
interp
,
ldaptcl
,
baseString
,
...
...
@@ -907,10 +910,42 @@ NeoX_LdapTargetObjCmd (clientData, interp, objc, objv)
else
ldap_enable_cache(ldap, ldaptcl->timeout, ldaptcl->maxmem);
}
deref = LDAP_DEREF_NEVER;
ldap_set_option(ldap, LDAP_OPT_DEREF, &deref);
#endif
return
tclResult
;
}
/* object compare dn attr value */
if
(
STREQU
(
subCommand
,
"compare"
))
{
char
*
dn
;
char
*
attr
;
char
*
value
;
int
result
;
int
lderrno
;
if
(
objc
!=
5
)
return
TclX_WrongArgs
(
interp
,
objv
[
0
],
"compare dn attribute value"
);
dn
=
Tcl_GetStringFromObj
(
objv
[
2
],
NULL
);
attr
=
Tcl_GetStringFromObj
(
objv
[
3
],
NULL
);
value
=
Tcl_GetStringFromObj
(
objv
[
4
],
NULL
);
result
=
ldap_compare_s
(
ldap
,
dn
,
attr
,
value
);
if
(
result
==
LDAP_COMPARE_TRUE
||
result
==
LDAP_COMPARE_FALSE
)
{
Tcl_SetIntObj
(
resultObj
,
result
==
LDAP_COMPARE_TRUE
);
return
TCL_OK
;
}
LDAP_SetErrorCode
(
ldaptcl
,
result
,
interp
);
Tcl_AppendStringsToObj
(
resultObj
,
"LDAP compare error: "
,
LDAP_ERR_STRING
(
ldap
),
(
char
*
)
NULL
);
return
TCL_ERROR
;
}
#if defined(UMICH_LDAP) || (defined(OPEN_LDAP) && !defined(LDAP_API_VERSION))
if
(
STREQU
(
subCommand
,
"cache"
))
{
char
*
cacheCommand
;
...
...
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