Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
c0075d57
Commit
c0075d57
authored
May 13, 2004
by
Howard Chu
Browse files
better fix for prev commit
parent
ee0af2b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/overlays/ppolicy.c
View file @
c0075d57
...
...
@@ -1784,32 +1784,11 @@ ppolicy_db_init(
{
slap_overinst
*
on
=
(
slap_overinst
*
)
be
->
bd_info
;
/* Has schema been initialized yet? */
if
(
!
ad_pwdMinAge
)
{
LDAPAttributeType
*
at
;
/* Has User Schema been initialized yet? */
if
(
!
pwd_UsSchema
[
0
].
ad
)
{
const
char
*
err
;
int
i
,
code
;
for
(
i
=
0
;
pwd_OpSchema
[
i
].
def
;
i
++
)
{
at
=
ldap_str2attributetype
(
pwd_OpSchema
[
i
].
def
,
&
code
,
&
err
,
LDAP_SCHEMA_ALLOW_ALL
);
if
(
!
at
)
{
fprintf
(
stderr
,
"AttributeType Load failed %s %s
\n
"
,
ldap_scherr2str
(
code
),
err
);
return
code
;
}
code
=
at_add
(
at
,
&
err
);
if
(
!
code
)
{
slap_str2ad
(
at
->
at_names
[
0
],
pwd_OpSchema
[
i
].
ad
,
&
err
);
}
ldap_memfree
(
at
);
if
(
code
)
{
fprintf
(
stderr
,
"AttributeType Load failed %s %s
\n
"
,
scherr2str
(
code
),
err
);
return
code
;
}
}
for
(
i
=
0
;
pwd_UsSchema
[
i
].
def
;
i
++
)
{
code
=
slap_str2ad
(
pwd_UsSchema
[
i
].
def
,
pwd_UsSchema
[
i
].
ad
,
&
err
);
if
(
code
)
{
...
...
@@ -1891,7 +1870,29 @@ static slap_overinst ppolicy;
int
ppolicy_init
()
{
int
code
;
LDAPAttributeType
*
at
;
const
char
*
err
;
int
i
,
code
;
for
(
i
=
0
;
pwd_OpSchema
[
i
].
def
;
i
++
)
{
at
=
ldap_str2attributetype
(
pwd_OpSchema
[
i
].
def
,
&
code
,
&
err
,
LDAP_SCHEMA_ALLOW_ALL
);
if
(
!
at
)
{
fprintf
(
stderr
,
"AttributeType Load failed %s %s
\n
"
,
ldap_scherr2str
(
code
),
err
);
return
code
;
}
code
=
at_add
(
at
,
&
err
);
if
(
!
code
)
{
slap_str2ad
(
at
->
at_names
[
0
],
pwd_OpSchema
[
i
].
ad
,
&
err
);
}
ldap_memfree
(
at
);
if
(
code
)
{
fprintf
(
stderr
,
"AttributeType Load failed %s %s
\n
"
,
scherr2str
(
code
),
err
);
return
code
;
}
}
code
=
register_supported_control
(
LDAP_CONTROL_PASSWORDPOLICYREQUEST
,
SLAP_CTRL_ADD
|
SLAP_CTRL_BIND
|
SLAP_CTRL_MODIFY
,
extops
,
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment