Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
6f9901e9
Commit
6f9901e9
authored
Apr 05, 2003
by
Howard Chu
Browse files
Moved get_alias_dn from back-ldbm to frontend
parent
c75be97a
Changes
3
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-ldbm/alias.c
View file @
6f9901e9
...
...
@@ -14,12 +14,6 @@
#include
"proto-back-ldbm.h"
static
int
get_alias_dn
(
Entry
*
e
,
struct
berval
*
al
,
int
*
err
,
const
char
**
errmsg
);
static
void
new_superior
(
struct
berval
*
dn
,
struct
berval
*
oldSup
,
...
...
@@ -199,56 +193,6 @@ Entry *deref_internal_r(
}
static
int
get_alias_dn
(
Entry
*
e
,
struct
berval
*
ndn
,
int
*
err
,
const
char
**
errmsg
)
{
int
rc
;
Attribute
*
a
;
AttributeDescription
*
aliasedObjectName
=
slap_schema
.
si_ad_aliasedObjectName
;
a
=
attr_find
(
e
->
e_attrs
,
aliasedObjectName
);
if
(
a
==
NULL
)
{
/*
* there was an aliasedobjectname defined but no data.
*/
*
err
=
LDAP_ALIAS_PROBLEM
;
*
errmsg
=
"alias missing aliasedObjectName attribute"
;
return
-
1
;
}
/*
* aliasedObjectName should be SINGLE-VALUED with a single value.
*/
if
(
a
->
a_vals
[
0
].
bv_val
==
NULL
)
{
/*
* there was an aliasedobjectname defined but no data.
*/
*
err
=
LDAP_ALIAS_PROBLEM
;
*
errmsg
=
"alias missing aliasedObjectName value"
;
return
-
1
;
}
if
(
a
->
a_vals
[
1
].
bv_val
!=
NULL
)
{
*
err
=
LDAP_ALIAS_PROBLEM
;
*
errmsg
=
"alias has multivalued aliasedObjectName"
;
return
-
1
;
}
rc
=
dnNormalize2
(
NULL
,
&
a
->
a_vals
[
0
],
ndn
);
if
(
rc
!=
LDAP_SUCCESS
)
{
*
err
=
LDAP_ALIAS_PROBLEM
;
*
errmsg
=
"alias aliasedObjectName value is invalid"
;
return
-
1
;
}
return
0
;
}
static
void
new_superior
(
struct
berval
*
dn
,
struct
berval
*
oldSup
,
...
...
servers/slapd/proto-slap.h
View file @
6f9901e9
...
...
@@ -784,6 +784,12 @@ LDAP_SLAPD_F (BerVarray) referral_rewrite LDAP_P((
struct
berval
*
target
,
int
scope
));
LDAP_SLAPD_F
(
int
)
get_alias_dn
LDAP_P
((
Entry
*
e
,
struct
berval
*
ndn
,
int
*
err
,
const
char
**
text
));
/*
* repl.c
*/
...
...
servers/slapd/referral.c
View file @
6f9901e9
...
...
@@ -356,3 +356,48 @@ BerVarray get_entry_referrals(
return
refs
;
}
int
get_alias_dn
(
Entry
*
e
,
struct
berval
*
ndn
,
int
*
err
,
const
char
**
text
)
{
Attribute
*
a
;
AttributeDescription
*
aliasedObjectName
=
slap_schema
.
si_ad_aliasedObjectName
;
a
=
attr_find
(
e
->
e_attrs
,
aliasedObjectName
);
if
(
a
==
NULL
)
{
/*
* there was an aliasedobjectname defined but no data.
*/
*
err
=
LDAP_ALIAS_PROBLEM
;
*
text
=
"alias missing aliasedObjectName attribute"
;
return
-
1
;
}
/*
* aliasedObjectName should be SINGLE-VALUED with a single value.
*/
if
(
a
->
a_vals
[
0
].
bv_val
==
NULL
)
{
/*
* there was an aliasedobjectname defined but no data.
*/
*
err
=
LDAP_ALIAS_PROBLEM
;
*
text
=
"alias missing aliasedObjectName value"
;
return
-
1
;
}
if
(
a
->
a_nvals
[
1
].
bv_val
!=
NULL
)
{
*
err
=
LDAP_ALIAS_PROBLEM
;
*
text
=
"alias has multivalued aliasedObjectName"
;
return
-
1
;
}
*
ndn
=
a
->
a_nvals
[
0
];
return
0
;
}
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