make it easy to tie an existing database to the
.B slapd
front-end.
+.SH WARNING
+.B "This backend's calling conventions have changed since OpenLDAP 2.0."
+The operations receive a new "opid:" (operation ID) line, to be used
+instead of "msgid:".
+The "msgid:" line will be removed in a future version.
+Also, abandon now gets a new "abandonid:" line.
.SH CONFIGURATION
These
.B slapd.conf
.B abandon <pathname> <argument>...
.nf
ABANDON
-msgid: <message id>
+opid: <operation ID>
+msgid: <message ID of operation to abandon>
<repeat { "suffix:" <database suffix DN> }>
+abandonid: <operation ID of operation to abandon>
.fi
.TP
.B add <pathname> <argument>...
.nf
ADD
-msgid: <message id>
+opid: <operation ID>
+msgid: <message ID>
<repeat { "suffix:" <database suffix DN> }>
<entry in LDIF format>
.fi
.B bind <pathname> <argument>...
.nf
BIND
-msgid: <message id>
+opid: <operation ID>
+msgid: <message ID>
<repeat { "suffix:" <database suffix DN> }>
dn: <DN>
method: <method number>
.B compare <pathname> <argument>...
.nf
COMPARE
-msgid: <message id>
+opid: <operation ID>
+msgid: <message ID>
<repeat { "suffix:" <database suffix DN> }>
dn: <DN>
<attribute>: <value>
.B delete <pathname> <argument>...
.nf
DELETE
-msgid: <message id>
+opid: <operation ID>
+msgid: <message ID>
<repeat { "suffix:" <database suffix DN> }>
dn: <DN>
.fi
.B modify <pathname> <argument>...
.nf
MODIFY
-msgid: <message id>
+opid: <operation ID>
+msgid: <message ID>
<repeat { "suffix:" <database suffix DN> }>
dn: <DN>
<repeat {
.B modrdn <pathname> <argument>...
.nf
MODRDN
-msgid: <message id>
+opid: <operation ID>
+msgid: <message ID>
<repeat { "suffix:" <database suffix DN> }>
dn: <DN>
newrdn: <new RDN>
.B search <pathname> <argument>...
.nf
SEARCH
-msgid: <message id>
+opid: <operation ID>
+msgid: <message ID>
<repeat { "suffix:" <database suffix DN> }>
base: <base DN>
scope: <0-2, see ldap.h>
.B unbind <pathname> <argument>...
.nf
UNBIND
-msgid: <message id>
+opid: <operation ID>
+msgid: <message ID>
<repeat { "suffix:" <database suffix DN> }>
dn: <bound DN>
.fi
.LP
+An
+.I operation ID
+is a "connection ID/message ID" string identifying an operation.
+.LP
Note that you need only supply configuration lines for those commands you
want the backend to handle.
Operations for which a command is not supplied will be refused with an
Any tcl database section of the configuration file
.BR slapd.conf (5)
must then specify what Tcl script to use.
+.SH WARNING
+.B "This backend's calling conventions have changed since OpenLDAP 2.0."
+Previously, the 2nd argument to the procs was a message ID.
+Now they are an "operation ID" string.
+Also, proc abandon now gets a new
+.B abandonid
+argument.
.SH CONFIGURATION
These
.B slapd.conf
If no tclrealm is specified, it is put into the "default" realm.
.SH Variables passed to the procs
.TP
-.B abandon { action msgid suffix }
+.B abandon { action opid suffix abandonid }
.nf
-action - Always equal to ABANDON.
-msgid - The msgid of this ldap operation.
-suffix - List of suffix(es) associated with the
- call. Each one is an entry in a tcl
- formatted list (surrounded by {}'s).
+action - Always equal to ABANDON.
+opid - The opid of this ldap operation.
+suffix - List of suffix(es) associated with the
+ call. Each one is an entry in a tcl
+ formatted list (surrounded by {}'s).
+abandonid - The opid of the operation to abandon.
.fi
.TP
-.B add "{ action msgid suffix entry }"
+.B add "{ action opid suffix entry }"
.nf
action - Always equal to ADD.
-msgid - The msgid of this ldap operation.
+opid - The opid of this ldap operation.
suffix - List of suffix(es), as above.
entry - Full entry to add. Each "type: val" is
an element in a tcl formatted list.
.fi
.TP
-.B bind "{ action msgid suffix dn method cred_len cred }"
+.B bind "{ action opid suffix dn method cred_len cred }"
.nf
action - Always equal to BIND.
-msgid - The msgid of this ldap operation.
+opid - The opid of this ldap operation.
suffix - List of suffix(es), as above.
dn - DN being bound to.
method - One of the ldap authentication methods.
bind (??)
.fi
.TP
-.B compare "{ action msgid suffix dn ava_type ava_value }"
+.B compare "{ action opid suffix dn ava_type ava_value }"
.nf
action - Always equal to COMPARE.
-msgid - The msgid of this ldap operation.
+opid - The opid of this ldap operation.
suffix - List of suffix(es), as above.
dn - DN for compare.
ava_type - Type for comparison.
ava_value - Value to compare.
.fi
.TP
-.B delete "{ action msgid suffix dn }"
+.B delete "{ action opid suffix dn }"
.nf
action - Always equal to DELETE.
-msgid - The msgid of this ldap operation.
+opid - The opid of this ldap operation.
suffix - List of suffix(es), as above.
dn - DN to delete.
.fi
.TP
-.B modify "{ action msgid suffix dn mods }"
+.B modify "{ action opid suffix dn mods }"
.nf
action - Always equal to MODIFY.
-msgid - The msgid of this ldap operation.
+opid - The opid of this ldap operation.
suffix - List of suffix(es), as above.
dn - DN to modify.
mods - Tcl list of modifications.
(ADD, DELETE, REPLACE).
.fi
.TP
-.B modrdn "{ action msgid suffix dn newrdn deleteoldrdn }"
+.B modrdn "{ action opid suffix dn newrdn deleteoldrdn }"
.nf
action - Always equal to MODRDN.
-msgid - The msgid of this ldap operation.
+opid - The opid of this ldap operation.
suffix - List of suffix(es), as above.
dn - DN whose RDN is being renamed.
newrdn - New RDN.
.fi
.TP
.B
-search { action msgid suffix base scope deref \
+search { action opid suffix base scope deref \
sizelimit timelimit filterstr attrsonly attrlist }
.nf
action - Always equal to SEARCH.
-msgid - The msgid of this ldap operation.
+opid - The opid of this ldap operation.
suffix - List of suffix(es), as above.
base - Base for this search.
scope - Scope of search, ( 0 | 1 | 2 ).
attrlist - Tcl list if to retrieve.
.fi
.TP
-.B unbind "{ action msgid suffix dn }"
+.B unbind "{ action opid suffix dn }"
.nf
action - Always equal to UNBIND.
-msgid - The msgid of this ldap operation.
+opid - The opid of this ldap operation.
suffix - List of suffix(es), as above.
dn - DN to unbind.
.fi
.LP
+An
+.I opid
+(operation ID) is a "connection ID/message ID" string identifying an
+operation.
+.LP
.SH Return Method and Syntax
There are only 2 return types.
All procs must return a result to show status of the operation.
/* write out the request to the abandon process */
fprintf( wfp, "ABANDON\n" );
+ fprintf( wfp, "opid: %ld/%ld\n", op->o_connid, (long) op->o_msgid );
fprintf( wfp, "msgid: %d\n", msgid );
print_suffixes( wfp, be );
+ fprintf( wfp, "abandonid: %ld/%d\n", op->o_connid, msgid );
fclose( wfp );
/* no result from abandon */
/* write out the request to the add process */
fprintf( wfp, "ADD\n" );
+ fprintf( wfp, "opid: %ld/%ld\n", op->o_connid, (long) op->o_msgid );
fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
print_suffixes( wfp, be );
ldap_pvt_thread_mutex_lock( &entry2str_mutex );
/* write out the request to the bind process */
fprintf( wfp, "BIND\n" );
+ fprintf( wfp, "opid: %ld/%ld\n", op->o_connid, (long) op->o_msgid );
fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
print_suffixes( wfp, be );
fprintf( wfp, "dn: %s\n", dn->bv_val );
/* write out the request to the compare process */
fprintf( wfp, "COMPARE\n" );
+ fprintf( wfp, "opid: %ld/%ld\n", op->o_connid, (long) op->o_msgid );
fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
print_suffixes( wfp, be );
fprintf( wfp, "dn: %s\n", dn->bv_val );
/* write out the request to the delete process */
fprintf( wfp, "DELETE\n" );
+ fprintf( wfp, "opid: %ld/%ld\n", op->o_connid, (long) op->o_msgid );
fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
print_suffixes( wfp, be );
fprintf( wfp, "dn: %s\n", dn->bv_val );
/* write out the request to the modify process */
fprintf( wfp, "MODIFY\n" );
+ fprintf( wfp, "opid: %ld/%ld\n", op->o_connid, (long) op->o_msgid );
fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
print_suffixes( wfp, be );
fprintf( wfp, "dn: %s\n", dn->bv_val );
/* write out the request to the modrdn process */
fprintf( wfp, "MODRDN\n" );
+ fprintf( wfp, "opid: %ld/%ld\n", op->o_connid, (long) op->o_msgid );
fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
print_suffixes( wfp, be );
fprintf( wfp, "dn: %s\n", dn->bv_val );
/* write out the request to the search process */
fprintf( wfp, "SEARCH\n" );
+ fprintf( wfp, "opid: %ld/%ld\n", op->o_connid, (long) op->o_msgid );
fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
print_suffixes( wfp, be );
fprintf( wfp, "base: %s\n", base->bv_val );
/* write out the request to the unbind process */
fprintf( wfp, "UNBIND\n" );
+ fprintf( wfp, "opid: %ld/%ld\n", op->o_connid, (long) op->o_msgid );
fprintf( wfp, "msgid: %ld\n", (long) op->o_msgid );
print_suffixes( wfp, be );
fprintf( wfp, "dn: %s\n", (conn->c_dn.bv_len ? conn->c_dn.bv_val : "") );
}
command = (char *) ch_malloc (ti->ti_abandon.bv_len + suf_tcl.bv_len
- + 20);
- sprintf (command, "%s ABANDON {%ld} {%s}",
- ti->ti_abandon.bv_val, (long) op->o_msgid, suf_tcl.bv_val);
+ + 80);
+ sprintf (command, "%s ABANDON {%ld/%ld} {%s} {%ld/%d}",
+ ti->ti_abandon.bv_val, op->o_connid, (long) op->o_msgid,
+ suf_tcl.bv_val, op->o_connid, msgid);
Tcl_Free (suf_tcl.bv_val);
ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex);
entrystr = tcl_clean_entry(e);
command = (char *) ch_malloc (ti->ti_add.bv_len + suf_tcl.bv_len +
- strlen(entrystr) + 32);
- sprintf (command, "%s ADD {%ld} {%s} {%s}",
- ti->ti_add.bv_val, (long) op->o_msgid,
+ strlen(entrystr) + 52);
+ sprintf (command, "%s ADD {%ld/%ld} {%s} {%s}",
+ ti->ti_add.bv_val, op->o_connid, (long) op->o_msgid,
suf_tcl.bv_val, entrystr);
Tcl_Free (suf_tcl.bv_val);
free (entrystr);
}
command = (char *) ch_malloc (ti->ti_bind.bv_len + suf_tcl.bv_len +
- dn->bv_len + cred->bv_len + 64);
- sprintf (command, "%s BIND {%ld} {%s} {%s} {%d} {%lu} {%s}",
- ti->ti_bind.bv_val, (long) op->o_msgid, suf_tcl.bv_val,
+ dn->bv_len + cred->bv_len + 84);
+ sprintf (command, "%s BIND {%ld/%ld} {%s} {%s} {%d} {%lu} {%s}",
+ ti->ti_bind.bv_val, op->o_connid, (long) op->o_msgid,
+ suf_tcl.bv_val,
dn->bv_val, method, cred->bv_len, cred->bv_val);
Tcl_Free (suf_tcl.bv_val);
command = (char *) ch_malloc (ti->ti_compare.bv_len +
suf_tcl.bv_len + dn->bv_len + ava->aa_desc->ad_cname.bv_len +
- ava->aa_value.bv_len + 64);
- sprintf (command, "%s COMPARE {%ld} {%s} {%s} {%s: %s}",
- ti->ti_compare.bv_val, (long) op->o_msgid, suf_tcl.bv_val,
- dn->bv_val,
+ ava->aa_value.bv_len + 84);
+ sprintf (command, "%s COMPARE {%ld/%ld} {%s} {%s} {%s: %s}",
+ ti->ti_compare.bv_val, op->o_connid, (long) op->o_msgid,
+ suf_tcl.bv_val, dn->bv_val,
ava->aa_desc->ad_cname.bv_val, ava->aa_value.bv_val);
Tcl_Free (suf_tcl.bv_val);
}
command = (char *) ch_malloc (ti->ti_delete.bv_len + suf_tcl.bv_len
- + dn->bv_len + 64);
- sprintf (command, "%s DELETE {%ld} {%s} {%s}",
- ti->ti_delete.bv_val, (long) op->o_msgid, suf_tcl.bv_val,
- dn->bv_val);
+ + dn->bv_len + 84);
+ sprintf (command, "%s DELETE {%ld/%ld} {%s} {%s}",
+ ti->ti_delete.bv_val, op->o_connid, (long) op->o_msgid,
+ suf_tcl.bv_val, dn->bv_val);
Tcl_Free (suf_tcl.bv_val);
ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex);
}
command = (char *) ch_malloc (ti->ti_modify.bv_len + suf_tcl.bv_len
- + dn->bv_len + strlen (tcl_mods) + 64);
+ + dn->bv_len + strlen (tcl_mods) + 84);
/* This space is simply for aesthetics--\ */
- sprintf (command, "%s MODIFY {%ld} {%s} {%s} { %s}",
- ti->ti_modify.bv_val, (long) op->o_msgid, suf_tcl.bv_val,
- dn->bv_val, tcl_mods);
+ sprintf (command, "%s MODIFY {%ld/%ld} {%s} {%s} { %s}",
+ ti->ti_modify.bv_val, op->o_connid, (long) op->o_msgid,
+ suf_tcl.bv_val, dn->bv_val, tcl_mods);
Tcl_Free (suf_tcl.bv_val);
free (tcl_mods);
command = (char *) ch_malloc (ti->ti_modrdn.bv_len + suf_tcl.bv_len
+ dn->bv_len + newrdn->bv_len
- + (newSuperior ? newSuperior->bv_len : 0) + 64);
+ + (newSuperior ? newSuperior->bv_len : 0) + 84);
if ( newSuperior ) {
- sprintf (command, "%s MODRDN {%ld} {%s} {%s} {%s} %d {%s}",
- ti->ti_modrdn.bv_val, (long) op->o_msgid,
+ sprintf (command, "%s MODRDN {%ld/%ld} {%s} {%s} {%s} %d {%s}",
+ ti->ti_modrdn.bv_val,
+ op->o_connid, (long) op->o_msgid,
suf_tcl.bv_val, dn->bv_val,
newrdn->bv_val, deleteoldrdn ? 1 : 0,
newSuperior->bv_val );
}
command = (char *) ch_malloc (ti->ti_search.bv_len + suf_tcl.bv_len
- + base->bv_len + 40 + filterstr->bv_len +
+ + base->bv_len + 60 + filterstr->bv_len +
(attrs_tcl == NULL ? 5 : strlen (attrs_tcl)) + 72);
sprintf (command,
- "%s SEARCH {%ld} {%s} {%s} {%d} {%d} {%d} {%d} {%s} {%d} {%s}",
- ti->ti_search.bv_val, (long) op->o_msgid, suf_tcl.bv_val,
- base->bv_val, scope, deref,
+ "%s SEARCH {%ld/%ld} {%s} {%s} {%d} {%d} {%d} {%d} {%s} {%d} {%s}",
+ ti->ti_search.bv_val, op->o_connid, (long) op->o_msgid,
+ suf_tcl.bv_val, base->bv_val, scope, deref,
sizelimit, timelimit, filterstr->bv_val, attrsonly ? 1 : 0,
attrs_tcl == NULL ? "{all}" : attrs_tcl);
Tcl_Free (attrs_tcl);
}
command = (char *) ch_malloc (ti->ti_unbind.bv_len + suf_tcl.bv_len
- + conn->c_dn.bv_len + 64);
- sprintf (command, "%s UNBIND {%ld} {%s} {%s}",
- ti->ti_unbind.bv_val, (long) op->o_msgid, suf_tcl.bv_val,
- conn->c_dn.bv_val ? conn->c_dn.bv_val : "");
+ + conn->c_dn.bv_len + 84);
+ sprintf (command, "%s UNBIND {%ld/%ld} {%s} {%s}",
+ ti->ti_unbind.bv_val, op->o_connid, (long) op->o_msgid,
+ suf_tcl.bv_val, conn->c_dn.bv_val ? conn->c_dn.bv_val : "");
Tcl_Free (suf_tcl.bv_val);
ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex);