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
James Lowden
OpenLDAP
Commits
4813e6fc
Commit
4813e6fc
authored
14 years ago
by
Quanah Gibson-Mount
Browse files
Options
Downloads
Patches
Plain Diff
Use ldap_parse_whoami
parent
9fd7e512
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clients/tools/ldapwhoami.c
+8
-9
8 additions, 9 deletions
clients/tools/ldapwhoami.c
with
8 additions
and
9 deletions
clients/tools/ldapwhoami.c
+
8
−
9
View file @
4813e6fc
...
@@ -111,8 +111,7 @@ main( int argc, char *argv[] )
...
@@ -111,8 +111,7 @@ main( int argc, char *argv[] )
int
rc
;
int
rc
;
LDAP
*
ld
=
NULL
;
LDAP
*
ld
=
NULL
;
char
*
matcheddn
=
NULL
,
*
text
=
NULL
,
**
refs
=
NULL
;
char
*
matcheddn
=
NULL
,
*
text
=
NULL
,
**
refs
=
NULL
;
char
*
retoid
=
NULL
;
struct
berval
*
authzid
=
NULL
;
struct
berval
*
retdata
=
NULL
;
int
id
,
code
=
0
;
int
id
,
code
=
0
;
LDAPMessage
*
res
;
LDAPMessage
*
res
;
LDAPControl
**
ctrls
=
NULL
;
LDAPControl
**
ctrls
=
NULL
;
...
@@ -182,19 +181,20 @@ main( int argc, char *argv[] )
...
@@ -182,19 +181,20 @@ main( int argc, char *argv[] )
goto
skip
;
goto
skip
;
}
}
rc
=
ldap_parse_extended_result
(
ld
,
res
,
&
retoid
,
&
retdata
,
1
);
rc
=
ldap_parse_whoami
(
ld
,
res
,
&
authzid
);
ldap_msgfree
(
res
);
if
(
rc
!=
LDAP_SUCCESS
)
{
if
(
rc
!=
LDAP_SUCCESS
)
{
tool_perror
(
"ldap_parse_
extended_result
"
,
rc
,
NULL
,
NULL
,
NULL
,
NULL
);
tool_perror
(
"ldap_parse_
whoami
"
,
rc
,
NULL
,
NULL
,
NULL
,
NULL
);
rc
=
EXIT_FAILURE
;
rc
=
EXIT_FAILURE
;
goto
skip
;
goto
skip
;
}
}
if
(
retdata
!=
NULL
)
{
if
(
authzid
!=
NULL
)
{
if
(
retdata
->
bv_len
==
0
)
{
if
(
authzid
->
bv_len
==
0
)
{
printf
(
_
(
"anonymous
\n
"
)
);
printf
(
_
(
"anonymous
\n
"
)
);
}
else
{
}
else
{
printf
(
"%s
\n
"
,
retdata
->
bv_val
);
printf
(
"%s
\n
"
,
authzid
->
bv_val
);
}
}
}
}
...
@@ -228,8 +228,7 @@ skip:
...
@@ -228,8 +228,7 @@ skip:
ber_memfree
(
text
);
ber_memfree
(
text
);
ber_memfree
(
matcheddn
);
ber_memfree
(
matcheddn
);
ber_memvfree
(
(
void
**
)
refs
);
ber_memvfree
(
(
void
**
)
refs
);
ber_memfree
(
retoid
);
ber_bvfree
(
authzid
);
ber_bvfree
(
retdata
);
/* disconnect from server */
/* disconnect from server */
tool_unbind
(
ld
);
tool_unbind
(
ld
);
...
...
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