Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
d0e12df4
Commit
d0e12df4
authored
Jul 13, 1999
by
Kurt Zeilenga
Browse files
Add basic support for per-replica update referrals.
parent
956863ff
Changes
7
Hide whitespace changes
Inline
Side-by-side
servers/slapd/add.c
View file @
d0e12df4
...
...
@@ -155,8 +155,8 @@ do_add( Connection *conn, Operation *op )
}
else
{
entry_free
(
e
);
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_REFERRAL
,
NULL
,
NULL
,
default_referral
,
NULL
);
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_REFERRAL
,
NULL
,
NULL
,
be
->
be_update_refs
?
be
->
be_update_refs
:
default_referral
,
NULL
);
}
}
else
{
Debug
(
LDAP_DEBUG_ARGS
,
" do_add: HHH
\n
"
,
0
,
0
,
0
);
...
...
servers/slapd/back-ldbm/search.c
View file @
d0e12df4
...
...
@@ -361,7 +361,7 @@ search_candidates(
af
=
NULL
;
#endif
if
(
scope
==
LDAP_SCOPE_SUBTREE
&&
!
be_issuffix
(
be
,
e
->
e_ndn
)
)
{
if
(
scope
==
LDAP_SCOPE_SUBTREE
)
{
lf
=
(
Filter
*
)
ch_malloc
(
sizeof
(
Filter
)
);
lf
->
f_next
=
NULL
;
lf
->
f_choice
=
LDAP_FILTER_AND
;
...
...
servers/slapd/config.c
View file @
d0e12df4
...
...
@@ -466,6 +466,27 @@ read_config( char *fname )
(
void
)
dn_normalize_case
(
be
->
be_update_ndn
);
}
}
else
if
(
strcasecmp
(
cargv
[
0
],
"updateref"
)
==
0
)
{
if
(
cargc
<
2
)
{
Debug
(
LDAP_DEBUG_ANY
,
"%s: line %d: missing dn in
\"
updateref <ldapurl>
\"
line
\n
"
,
fname
,
lineno
,
0
);
return
(
1
);
}
if
(
be
==
NULL
)
{
Debug
(
LDAP_DEBUG_ANY
,
"%s: line %d: updateref line must appear inside a database definition (ignored)
\n
"
,
fname
,
lineno
,
0
);
}
else
if
(
be
->
be_update_ndn
==
NULL
)
{
Debug
(
LDAP_DEBUG_ANY
,
"%s: line %d: updateref line must after updatedn (ignored)
\n
"
,
fname
,
lineno
,
0
);
}
else
{
vals
[
0
]
->
bv_val
=
cargv
[
1
];
vals
[
0
]
->
bv_len
=
strlen
(
vals
[
0
]
->
bv_val
);
value_add
(
&
be
->
be_update_refs
,
vals
);
}
/* replication log file to which changes are appended */
}
else
if
(
strcasecmp
(
cargv
[
0
],
"replogfile"
)
==
0
)
{
if
(
cargc
<
2
)
{
...
...
servers/slapd/delete.c
View file @
d0e12df4
...
...
@@ -91,8 +91,8 @@ do_delete(
replog
(
be
,
LDAP_REQ_DELETE
,
ndn
,
NULL
,
0
);
}
}
else
{
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_REFERRAL
,
NULL
,
NULL
,
default_referral
,
NULL
);
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_REFERRAL
,
NULL
,
NULL
,
be
->
be_update_refs
?
be
->
be_update_refs
:
default_referral
,
NULL
);
}
}
else
{
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_UNWILLING_TO_PERFORM
,
...
...
servers/slapd/modify.c
View file @
d0e12df4
...
...
@@ -183,8 +183,8 @@ do_modify(
/* send a referral */
}
else
{
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_REFERRAL
,
NULL
,
NULL
,
default_referral
,
NULL
);
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_REFERRAL
,
NULL
,
NULL
,
be
->
be_update_refs
?
be
->
be_update_refs
:
default_referral
,
NULL
);
}
}
else
{
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_UNWILLING_TO_PERFORM
,
...
...
servers/slapd/modrdn.c
View file @
d0e12df4
...
...
@@ -227,8 +227,8 @@ do_modrdn(
deloldrdn
);
}
}
else
{
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_REFERRAL
,
NULL
,
NULL
,
default_referral
,
NULL
);
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_REFERRAL
,
NULL
,
NULL
,
be
->
be_update_refs
?
be
->
be_update_refs
:
default_referral
,
NULL
);
}
}
else
{
send_ldap_result
(
conn
,
op
,
rc
=
LDAP_UNWILLING_TO_PERFORM
,
...
...
servers/slapd/slap.h
View file @
d0e12df4
...
...
@@ -406,6 +406,7 @@ struct backend_db {
char
**
be_replica
;
/* replicas of this backend (in master) */
char
*
be_replogfile
;
/* replication log file (in master) */
char
*
be_update_ndn
;
/* allowed to make changes (in replicas) */
struct
berval
**
be_update_refs
;
/* where to refer modifying clients to */
int
be_lastmod
;
/* keep track of lastmodified{by,time} */
char
*
be_realm
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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