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
c0e63e83
Commit
c0e63e83
authored
15 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Lookup user DN in pam_authz if it was not provided
parent
38b3fdaf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/slapd-modules/nssov/pam.c
+29
-16
29 additions, 16 deletions
contrib/slapd-modules/nssov/pam.c
with
29 additions
and
16 deletions
contrib/slapd-modules/nssov/pam.c
+
29
−
16
View file @
c0e63e83
...
...
@@ -100,24 +100,17 @@ static int pam_bindcb(
return
LDAP_SUCCESS
;
}
int
pam_
do_bind
(
nssov_info
*
ni
,
TFILE
*
fp
,
Operation
*
op
,
static
int
pam_
uid2dn
(
nssov_info
*
ni
,
Operation
*
op
,
struct
paminfo
*
pi
)
{
int
rc
;
slap_callback
cb
=
{
0
};
SlapReply
rs
=
{
REP_RESULT
};
struct
berval
sdn
;
pi
->
msg
.
bv_val
=
pi
->
pwd
.
bv_val
;
pi
->
msg
.
bv_len
=
0
;
pi
->
authz
=
NSLCD_PAM_SUCCESS
;
BER_BVZERO
(
&
pi
->
dn
);
if
(
!
isvalidusername
(
&
pi
->
uid
))
{
Debug
(
LDAP_DEBUG_ANY
,
"nssov_pam_
do_bind
(%s): invalid user name
\n
"
,
Debug
(
LDAP_DEBUG_ANY
,
"nssov_pam_
uid2dn
(%s): invalid user name
\n
"
,
pi
->
uid
.
bv_val
,
0
,
0
);
rc
=
NSLCD_PAM_USER_UNKNOWN
;
goto
finish
;
return
NSLCD_PAM_USER_UNKNOWN
;
}
if
(
ni
->
ni_pam_opts
&
NI_PAM_SASL2DN
)
{
...
...
@@ -141,11 +134,26 @@ int pam_do_bind(nssov_info *ni,TFILE *fp,Operation *op,
dnNormalize
(
0
,
NULL
,
NULL
,
&
sdn
,
&
pi
->
dn
,
op
->
o_tmpmemctx
);
}
}
BER_BVZERO
(
&
sdn
);
if
(
BER_BVISEMPTY
(
&
pi
->
dn
))
{
rc
=
NSLCD_PAM_USER_UNKNOWN
;
goto
finish
;
return
NSLCD_PAM_USER_UNKNOWN
;
}
return
0
;
}
int
pam_do_bind
(
nssov_info
*
ni
,
TFILE
*
fp
,
Operation
*
op
,
struct
paminfo
*
pi
)
{
int
rc
;
slap_callback
cb
=
{
0
};
SlapReply
rs
=
{
REP_RESULT
};
pi
->
msg
.
bv_val
=
pi
->
pwd
.
bv_val
;
pi
->
msg
.
bv_len
=
0
;
pi
->
authz
=
NSLCD_PAM_SUCCESS
;
BER_BVZERO
(
&
pi
->
dn
);
rc
=
pam_uid2dn
(
ni
,
op
,
pi
);
if
(
rc
)
goto
finish
;
if
(
BER_BVISEMPTY
(
&
pi
->
pwd
))
{
rc
=
NSLCD_PAM_IGNORE
;
...
...
@@ -283,10 +291,15 @@ int pam_authz(nssov_info *ni,TFILE *fp,Operation *op)
Debug
(
LDAP_DEBUG_TRACE
,
"nssov_pam_authz(%s)
\n
"
,
dn
.
bv_val
,
0
,
0
);
/*
W
e d
o
n't do auth
orization if they weren't authenticated by us
*/
/*
If w
e d
id
n't do auth
c, we don't have a DN yet
*/
if
(
BER_BVISEMPTY
(
&
dn
))
{
rc
=
NSLCD_PAM_USER_UNKNOWN
;
goto
finish
;
struct
paminfo
pi
;
pi
.
uid
=
uid
;
pi
.
svc
=
svc
;
rc
=
pam_uid2dn
(
ni
,
op
,
&
pi
);
if
(
rc
)
goto
finish
;
dn
=
pi
.
dn
;
}
/* See if they have access to the host and service */
...
...
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