struct bdb_info *bdb = be->be_private;
Connection conn = {0};
- char opbuf[OPERATION_BUFFER_SIZE];
- Operation *op = (Operation *)opbuf;
+ OperationBuffer opbuf;
+ Operation *op = (Operation *) &opbuf;
DBC *curs;
DBT key, data;
struct berval *ndn )
{
Connection conn = { 0 };
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
Operation *op;
SlapReply rs = { 0 };
slap_callback cb = { NULL, monitor_filter2ndn_cb, NULL, NULL };
return -1;
}
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
connection_fake_init( &conn, op, &conn );
op->o_tag = LDAP_REQ_SEARCH;
SQLHDBC dbh = SQL_NULL_HDBC;
struct berbuf bb = BB_NULL;
- char opbuf[ OPERATION_BUFFER_SIZE ];
- Operation* op = (Operation *)opbuf;
+ OperationBuffer opbuf;
+ Operation* op = (Operation *) &opbuf;
Debug( LDAP_DEBUG_TRACE, "==>backsql_db_open(): "
"testing RDBMS connection\n", 0, 0, 0 );
int
backsql_connection_destroy( Backend *bd, Connection *c )
{
- char opbuf[ OPERATION_BUFFER_SIZE ];
- Operation* op = (Operation *)opbuf;
+ OperationBuffer opbuf;
+ Operation* op = (Operation *) &opbuf;
op->o_hdr = (Opheader *)&op[ 1 ];
op->o_connid = c->c_connid;
setup_cookie sc;
slap_callback cb = { NULL, config_ldif_resp, NULL, NULL };
Connection conn = {0};
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
Operation *op;
SlapReply rs = {REP_RESULT};
Filter filter = { LDAP_FILTER_PRESENT };
if ( readit ) {
void *thrctx = ldap_pvt_thread_pool_context();
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
connection_fake_init( &conn, op, thrctx );
filter.f_desc = slap_schema.si_ad_objectClass;
BackendInfo *bi;
ConfigArgs c;
Connection conn = {0};
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
Operation *op;
slap_callback cb = { NULL, slap_null_cb, NULL, NULL };
SlapReply rs = {REP_RESULT};
if ( cfb->cb_use_ldif ) {
thrctx = ldap_pvt_thread_pool_context();
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
connection_fake_init( &conn, op, thrctx );
op->o_dn = be->be_rootdn;
struct log_info *li = rtask->arg;
Connection conn = {0};
- char opbuf[OPERATION_BUFFER_SIZE];
- Operation *op = (Operation *)opbuf;
+ OperationBuffer opbuf;
+ Operation *op = (Operation *) &opbuf;
SlapReply rs = {REP_RESULT};
slap_callback cb = { NULL, log_old_lookup, NULL, NULL };
Filter f;
cache_manager *cm = on->on_bi.bi_private;
query_manager *qm = cm->qm;
Connection conn = {0};
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
Operation *op;
SlapReply rs = {REP_RESULT};
int i, return_val, pause = 1;
QueryTemplate* templ;
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
connection_fake_init( &conn, op, ctx );
op->o_bd = &cm->db;
struct re_s *rtask = arg;
syncops *so = rtask->arg;
slap_overinst *on = so->s_op->o_private;
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
Operation *op;
BackendDB be;
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
*op = *so->s_op;
op->o_hdr = (Opheader *)(op+1);
op->o_controls = (void **)(op->o_hdr+1);
syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
Connection conn;
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
char ctxcsnbuf[LDAP_LUTIL_CSNSTR_BUFSIZE];
- Operation *op = (Operation *)opbuf;
+ Operation *op = (Operation *) &opbuf;
Entry *e;
Attribute *a;
int rc;
}
if ( si->si_numops ) {
Connection conn;
- char opbuf[OPERATION_BUFFER_SIZE];
- Operation *op = (Operation *)opbuf;
+ OperationBuffer opbuf;
+ Operation *op = (Operation *) &opbuf;
SlapReply rs = {REP_RESULT};
void *thrctx;
LDAP_STAILQ_ENTRY(slap_op) o_next; /* next operation in list */
} Operation;
-#define OPERATION_BUFFER_SIZE (sizeof(Operation)+sizeof(Opheader)+SLAP_MAX_CIDS*sizeof(void *))
+#define OPERATION_BUFFER_SIZE ( sizeof(Operation) + sizeof(Opheader) + \
+ SLAP_MAX_CIDS*sizeof(void *) )
+
+typedef LBER_ALIGNED_BUFFER(operation_buffer_u,OPERATION_BUFFER_SIZE)
+ OperationBuffer;
#define send_ldap_error( op, rs, err, text ) do { \
(rs)->sr_err = err; (rs)->sr_text = text; \
const char *progname = "slapacl";
Connection conn = { 0 };
Listener listener;
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
Operation *op = NULL;
Entry e = { 0 }, *ep = &e;
char *attr = NULL;
argv = &argv[ optind ];
argc -= optind;
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
connection_fake_init( &conn, op, &conn );
conn.c_listener = &listener;
int
slapadd( int argc, char **argv )
{
- char *buf = NULL;
- int lineno;
- int lmax;
- int rc = EXIT_SUCCESS;
-
+ char *buf = NULL;
const char *text;
char textbuf[SLAP_TEXT_BUFLEN] = { '\0' };
size_t textlen = sizeof textbuf;
const char *progname = "slapadd";
- int manage = 0;
struct berval csn;
struct berval maxcsn;
- int match;
+ struct berval bvtext;
Attribute *attr;
Entry *ctxcsn_e;
ID ctxcsn_id, id;
+ OperationBuffer opbuf;
+ Operation *op;
+
+ int match;
int ret;
- struct berval bvtext;
int checkvals;
- char opbuf[OPERATION_BUFFER_SIZE];
- Operation *op;
+ int lineno;
+ int lmax;
+ int rc = EXIT_SUCCESS;
+ int manage = 0;
slap_tool_init( progname, SLAPADD, argc, argv );
- memset( opbuf, 0, sizeof(opbuf) );
- op = (Operation *)opbuf;
+ memset( &opbuf, 0, sizeof(opbuf) );
+ op = (Operation *) &opbuf;
if( !be->be_entry_open ||
!be->be_entry_close ||
int rc = EXIT_SUCCESS;
const char *progname = "slapauth";
Connection conn = {0};
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
Operation *op;
slap_tool_init( progname, SLAPAUTH, argc, argv );
argv = &argv[ optind ];
argc -= optind;
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
connection_fake_init( &conn, op, &conn );
conn.c_sasl_bind_mech = mech;
struct re_s* rtask = arg;
syncinfo_t *si = ( syncinfo_t * ) rtask->arg;
Connection conn = {0};
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
Operation *op;
int rc = LDAP_SUCCESS;
int first = 0;
return NULL;
}
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
connection_fake_init( &conn, op, ctx );
/* use global malloc for now */