Commit 60802201 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Const'ification

SASL mech removed from backend bind callback (as SASL is managed by frontend)
Changes to some backends are untested (as I don't have all dependent
  software install)
parent f84c43a4
......@@ -97,7 +97,7 @@ parse_acl(
Access *b;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
int rc;
char *text;
const char *text;
static AttributeDescription *member = NULL;
static AttributeDescription *aci = NULL;
#endif
......
......@@ -77,7 +77,7 @@ static int ad_keystring(
int slap_str2ad(
const char *str,
AttributeDescription **ad,
char **text )
const char **text )
{
struct berval bv;
bv.bv_val = (char *) str;
......@@ -89,7 +89,7 @@ int slap_str2ad(
int slap_bv2ad(
struct berval *bv,
AttributeDescription **ad,
char **text )
const char **text )
{
int rtn = LDAP_UNDEFINED_TYPE;
int i;
......@@ -226,7 +226,7 @@ int ad_inlist(
int i;
for( i=0; attrs[i] != NULL; i++ ) {
AttributeDescription *ad = NULL;
char *text;
const char *text;
int rc;
rc = slap_str2ad( attrs[i], &ad, &text );
......
......@@ -30,7 +30,7 @@
static int slap_mods2entry(
Modifications *mods,
Entry **e,
char **text );
const char **text );
#else
static int add_created_attrs(Operation *op, Entry *e);
#endif
......@@ -49,7 +49,7 @@ do_add( Connection *conn, Operation *op )
LDAPModList **modtail = &modlist;
Modifications *mods = NULL;
#endif
char *text;
const char *text;
int rc = LDAP_SUCCESS;
Debug( LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 );
......@@ -296,7 +296,7 @@ done:
static int slap_mods2entry(
Modifications *mods,
Entry **e,
char **text )
const char **text )
{
Attribute **tail = &(*e)->e_attrs;
assert( *tail == NULL );
......
......@@ -203,7 +203,7 @@ attr_index_cmp(
static int
attr_index_name_cmp(
char *type,
const char *type,
struct aindexrec *air
)
{
......
......@@ -34,7 +34,7 @@ get_ava(
BerElement *ber,
AttributeAssertion **ava,
unsigned usage,
char **text
const char **text
)
{
int rc;
......@@ -96,7 +96,7 @@ int
get_ava(
BerElement *ber,
Ava *ava,
char **text
const char **text
)
{
if ( ber_scanf( ber, "{ao}", &ava->ava_type, &ava->ava_value )
......
......@@ -21,7 +21,6 @@ bdb2i_back_bind_internal(
Operation *op,
char *dn,
int method,
char *mech,
struct berval *cred,
char** edn
)
......
......@@ -22,35 +22,41 @@ extern int bdb2_back_db_config LDAP_P(( BackendDB *bd,
extern int bdb2_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, int method, char* mech,
const char *dn, const char *ndn, int method,
struct berval *cred, char** edn ));
extern int bdb2_back_unbind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op ));
extern int bdb2_back_search LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, char *base,
char *nbase, int scope, int deref, int sizelimit, int timelimit,
Filter *filter, char *filterstr, char **attrs, int attrsonly ));
Connection *conn, Operation *op,
const char *base, const char *nbase,
int scope, int deref, int sizelimit, int timelimit,
Filter *filter, const char *filterstr,
char **attrs, int attrsonly ));
extern int bdb2_back_compare LDAP_P((BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, Ava *ava ));
const char *dn, const char *ndn,
Ava *ava ));
extern int bdb2_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, Modifications *ml ));
const char *dn, const char *ndn,
Modifications *ml ));
extern int bdb2_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, char*newrdn, int deleteoldrdn,
char *newSuperior ));
const char *dn, const char *ndn,
const char *newrdn, int deleteoldrdn,
const char *newSuperior ));
extern int bdb2_back_add LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, Entry *e ));
extern int bdb2_back_delete LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, char *dn, char *ndn ));
Connection *conn, Operation *op,
const char *dn, const char *ndn ));
extern int bdb2_back_abandon LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, int msgid ));
......
......@@ -21,18 +21,16 @@ dnssrv_back_bind(
Backend *be,
Connection *conn,
Operation *op,
char *dn,
char *ndn,
const char *dn,
const char *ndn,
int method,
char *mech,
struct berval *cred,
char **edn
)
{
Debug( LDAP_DEBUG_TRACE, "DNSSRV: bind %s (%d/%s)\n",
Debug( LDAP_DEBUG_TRACE, "DNSSRV: bind %s (%d)\n",
dn == NULL ? "" : dn,
method,
mech == NULL ? "none" : mech );
method, NULL );
if( method == LDAP_AUTH_SIMPLE && cred != NULL && cred->bv_len ) {
Statslog( LDAP_DEBUG_STATS,
......
......@@ -20,8 +20,8 @@ dnssrv_back_compare(
Backend *be,
Connection *conn,
Operation *op,
char *dn,
char *ndn,
const char *dn,
const char *ndn,
#ifdef SLAPD_SCHEMA_NOT_COMPAT
AttributeAssertion *ava
#else
......
......@@ -21,8 +21,8 @@ dnssrv_back_delete(
Backend *be,
Connection *conn,
Operation *op,
char *dn,
char *ndn
const char *dn,
const char *ndn
)
{
return dnssrv_back_request( be, conn, op, dn, ndn );
......
......@@ -25,38 +25,43 @@ extern int dnssrv_back_db_config LDAP_P(( BackendDB *bd,
extern int dnssrv_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, int method, char* mech,
const char *dn, const char *ndn, int method,
struct berval *cred, char** edn ));
extern int dnssrv_back_search LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, char *base,
char *nbase, int scope, int deref, int sizelimit, int timelimit,
Filter *filter, char *filterstr, char **attrs, int attrsonly ));
Connection *conn, Operation *op,
const char *base, const char *nbase,
int scope, int deref, int sizelimit, int timelimit,
Filter *filter, const char *filterstr,
char **attrs, int attrsonly ));
#ifdef SLAPD_SCHEMA_NOT_COMPAT
extern int dnssrv_back_compare LDAP_P((BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, AttributeAssertion *ava ));
const char *dn, const char *ndn, AttributeAssertion *ava ));
#else
extern int dnssrv_back_compare LDAP_P((BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, Ava *ava ));
const char *dn, const char *ndn, Ava *ava ));
#endif
extern int dnssrv_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, Modifications *ml ));
const char *dn, const char *ndn,
Modifications *ml ));
extern int dnssrv_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, char*newrdn, int deleteoldrdn,
char *newSuperior ));
const char *dn, const char *ndn,
const char *newrdn, int deleteoldrdn,
const char *newSuperior ));
extern int dnssrv_back_add LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, Entry *e ));
extern int dnssrv_back_delete LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, char *dn, char *ndn ));
Connection *conn, Operation *op,
const char *dn, const char *ndn ));
LDAP_END_DECL
......
......@@ -21,8 +21,8 @@ dnssrv_back_modify(
Backend *be,
Connection *conn,
Operation *op,
char *dn,
char *ndn,
const char *dn,
const char *ndn,
Modifications *ml
)
{
......
......@@ -20,11 +20,11 @@ dnssrv_back_modrdn(
Backend *be,
Connection *conn,
Operation *op,
char *dn,
char *ndn,
char *newrdn,
const char *dn,
const char *ndn,
const char *newrdn,
int deleteoldrdn,
char *newSuperior
const char *newSuperior
)
{
return dnssrv_back_request( be, conn, op, dn, ndn );
......
......@@ -22,14 +22,14 @@ dnssrv_back_search(
Backend *be,
Connection *conn,
Operation *op,
char *dn,
char *ndn,
const char *dn,
const char *ndn,
int scope,
int deref,
int size,
int time,
Filter *filter,
char *filterstr,
const char *filterstr,
char **attrs,
int attrsonly
)
......
......@@ -40,7 +40,6 @@ ldap_back_bind(
char *dn,
char *ndn,
int method,
char *mech,
struct berval *cred,
char **edn
)
......
......@@ -17,35 +17,39 @@ extern int ldap_back_db_config LDAP_P(( BackendDB *bd,
extern int ldap_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, int method, char* mech,
const char *dn, const char *ndn, int method,
struct berval *cred, char** edn ));
extern int ldap_back_conn_destroy LDAP_P(( BackendDB *bd,
Connection *conn ));
extern int ldap_back_search LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, char *base, char *nbase,
Connection *conn, Operation *op,
const char *base, const char *nbase,
int scope, int deref, int sizelimit, int timelimit,
Filter *filter, char *filterstr, char **attrs, int attrsonly ));
Filter *filter, const char *filterstr,
char **attrs, int attrsonly ));
extern int ldap_back_compare LDAP_P((BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, Ava *ava ));
const char *dn, const char *ndn, Ava *ava ));
extern int ldap_back_modify LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, Modifications *ml ));
const char *dn, const char *ndn, Modifications *ml ));
extern int ldap_back_modrdn LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
char *dn, char *ndn, char*newrdn, int deleteoldrdn,
char *newSuperior ));
const char *dn, const char *ndn,
const char *newrdn, int deleteoldrdn,
const char *newSuperior ));
extern int ldap_back_add LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, Entry *e ));
extern int ldap_back_delete LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, char *dn, char *ndn ));
Connection *conn, Operation *op,
const char *dn, const char *ndn ));
extern int ldap_back_abandon LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op, int msgid ));
......
......@@ -29,7 +29,7 @@ ldbm_back_add(
Entry *p = NULL;
int rootlock = 0;
int rc;
char *text;
const char *text;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
static AttributeDescription *children = NULL;
#else
......
......@@ -17,25 +17,26 @@
static char* get_alias_dn(
Entry *e,
int *err,
char **errmsg );
const char **errmsg );
static char* new_superior(
char *dn,
char *oldSup,
char *newSup );
const char *dn,
const char *oldSup,
const char *newSup );
static int dnlist_subordinate(
char** dnlist,
char *dn );
const char *dn );
Entry *deref_internal_r(
Backend* be,
Entry* alias,
char* dn,
const char* dn_in,
int* err,
Entry** matched,
char** text )
const char** text )
{
char *dn;
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
Entry *entry;
Entry *sup;
......@@ -49,7 +50,7 @@ Entry *deref_internal_r(
*text = NULL;
if( alias == NULL ) {
dn = ch_strdup( dn );
dn = ch_strdup( dn_in );
entry = dn2entry_r( be, dn, &sup );
} else {
......@@ -213,7 +214,7 @@ Entry *deref_internal_r(
static char* get_alias_dn(
Entry *e,
int *err,
char **errmsg )
const char **errmsg )
{
Attribute *a;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
......@@ -255,9 +256,9 @@ static char* get_alias_dn(
}
char* new_superior(
char *dn,
char *oldSup,
char *newSup )
const char *dn,
const char *oldSup,
const char *newSup )
{
char *newDN;
size_t dnlen, olen, nlen;
......@@ -278,7 +279,7 @@ char* new_superior(
static int dnlist_subordinate(
char** dnlist,
char *dn )
const char *dn )
{
int i;
assert( dnlist );
......
......@@ -68,7 +68,7 @@ ainfo_dup(
void
attr_mask(
struct ldbminfo *li,
char *type,
const char *type,
int *indexmask )
{
AttrInfo *a;
......
......@@ -23,10 +23,9 @@ ldbm_back_bind(
Backend *be,
Connection *conn,
Operation *op,
char *dn,
char *ndn,
const char *dn,
const char *ndn,
int method,
char *mech,
struct berval *cred,
char** edn
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment