From 60802201e3a39b0a46bfa7156c608026f7d361ba Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 22 May 2000 03:46:57 +0000 Subject: [PATCH] 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) --- servers/slapd/aclparse.c | 2 +- servers/slapd/ad.c | 6 +- servers/slapd/add.c | 6 +- servers/slapd/at.c | 2 +- servers/slapd/ava.c | 4 +- servers/slapd/back-bdb2/bind.c | 1 - servers/slapd/back-bdb2/external.h | 24 +++++--- servers/slapd/back-dnssrv/bind.c | 10 ++- servers/slapd/back-dnssrv/compare.c | 4 +- servers/slapd/back-dnssrv/delete.c | 4 +- servers/slapd/back-dnssrv/external.h | 25 +++++--- servers/slapd/back-dnssrv/modify.c | 4 +- servers/slapd/back-dnssrv/modrdn.c | 8 +-- servers/slapd/back-dnssrv/search.c | 6 +- servers/slapd/back-ldap/bind.c | 1 - servers/slapd/back-ldap/external.h | 20 +++--- servers/slapd/back-ldbm/add.c | 2 +- servers/slapd/back-ldbm/alias.c | 27 ++++---- servers/slapd/back-ldbm/attr.c | 2 +- servers/slapd/back-ldbm/bind.c | 5 +- servers/slapd/back-ldbm/compare.c | 4 +- servers/slapd/back-ldbm/dbcache.c | 4 +- servers/slapd/back-ldbm/delete.c | 4 +- servers/slapd/back-ldbm/extended.c | 7 ++- servers/slapd/back-ldbm/external.h | 48 +++++++++------ servers/slapd/back-ldbm/modify.c | 8 +-- servers/slapd/back-ldbm/modrdn.c | 15 ++--- servers/slapd/back-ldbm/passwd.c | 8 +-- servers/slapd/back-ldbm/proto-back-ldbm.h | 20 +++--- servers/slapd/back-ldbm/search.c | 19 +++--- servers/slapd/back-passwd/external.h | 8 ++- servers/slapd/back-passwd/search.c | 6 +- servers/slapd/back-perl/bind.c | 5 +- servers/slapd/back-perl/compare.c | 6 +- servers/slapd/back-perl/delete.c | 4 +- servers/slapd/back-perl/external.h | 24 +++++--- servers/slapd/back-perl/modify.c | 4 +- servers/slapd/back-perl/modrdn.c | 8 +-- servers/slapd/back-perl/search.c | 6 +- servers/slapd/back-shell/bind.c | 5 +- servers/slapd/back-shell/compare.c | 4 +- servers/slapd/back-shell/delete.c | 4 +- servers/slapd/back-shell/external.h | 24 +++++--- servers/slapd/back-shell/modify.c | 4 +- servers/slapd/back-shell/modrdn.c | 8 +-- servers/slapd/back-shell/search.c | 6 +- servers/slapd/back-sql/bind.c | 4 +- servers/slapd/back-sql/external.h | 24 +++++--- servers/slapd/back-tcl/external.h | 24 +++++--- servers/slapd/backend.c | 2 +- servers/slapd/bind.c | 4 +- servers/slapd/charray.c | 28 --------- servers/slapd/compare.c | 2 +- servers/slapd/configinfo.c | 2 +- servers/slapd/connection.c | 2 - servers/slapd/daemon.c | 2 +- servers/slapd/delete.c | 3 +- servers/slapd/dn.c | 26 ++++---- servers/slapd/entry.c | 2 +- servers/slapd/extended.c | 2 +- servers/slapd/filter.c | 20 +++--- servers/slapd/init.c | 4 +- servers/slapd/modify.c | 8 +-- servers/slapd/modrdn.c | 2 +- servers/slapd/monitor.c | 2 +- servers/slapd/oc.c | 2 +- servers/slapd/passwd.c | 6 +- servers/slapd/proto-slap.h | 75 ++++++++++++----------- servers/slapd/result.c | 2 +- servers/slapd/root_dse.c | 2 +- servers/slapd/sasl.c | 12 ++-- servers/slapd/schema.c | 4 +- servers/slapd/schema_check.c | 5 +- servers/slapd/schema_init.c | 2 +- servers/slapd/search.c | 2 +- servers/slapd/slap.h | 31 ++++++---- servers/slapd/starttls.c | 4 +- servers/slapd/str2filter.c | 2 +- servers/slapd/tools/mimic.c | 8 +-- servers/slapd/tools/slapadd.c | 2 +- servers/slapd/tools/slapindex.c | 2 +- servers/slapd/value.c | 6 +- 82 files changed, 393 insertions(+), 363 deletions(-) diff --git a/servers/slapd/aclparse.c b/servers/slapd/aclparse.c index ced1c95c69..42b5b4d941 100644 --- a/servers/slapd/aclparse.c +++ b/servers/slapd/aclparse.c @@ -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 diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 9b9d636c89..7f63dc0a99 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -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 ); diff --git a/servers/slapd/add.c b/servers/slapd/add.c index f819f4d42a..70d190ba34 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -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 ); diff --git a/servers/slapd/at.c b/servers/slapd/at.c index e877c79f93..b8ddcc9201 100644 --- a/servers/slapd/at.c +++ b/servers/slapd/at.c @@ -203,7 +203,7 @@ attr_index_cmp( static int attr_index_name_cmp( - char *type, + const char *type, struct aindexrec *air ) { diff --git a/servers/slapd/ava.c b/servers/slapd/ava.c index 6e87c07af5..ad151d5a0d 100644 --- a/servers/slapd/ava.c +++ b/servers/slapd/ava.c @@ -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 ) diff --git a/servers/slapd/back-bdb2/bind.c b/servers/slapd/back-bdb2/bind.c index fd7a4aacb4..21e912bfa3 100644 --- a/servers/slapd/back-bdb2/bind.c +++ b/servers/slapd/back-bdb2/bind.c @@ -21,7 +21,6 @@ bdb2i_back_bind_internal( Operation *op, char *dn, int method, - char *mech, struct berval *cred, char** edn ) diff --git a/servers/slapd/back-bdb2/external.h b/servers/slapd/back-bdb2/external.h index 230302d2bd..0b45d618eb 100644 --- a/servers/slapd/back-bdb2/external.h +++ b/servers/slapd/back-bdb2/external.h @@ -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 )); diff --git a/servers/slapd/back-dnssrv/bind.c b/servers/slapd/back-dnssrv/bind.c index e69094b6c7..4739746a2e 100644 --- a/servers/slapd/back-dnssrv/bind.c +++ b/servers/slapd/back-dnssrv/bind.c @@ -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, diff --git a/servers/slapd/back-dnssrv/compare.c b/servers/slapd/back-dnssrv/compare.c index d5733a0790..2ec14988ad 100644 --- a/servers/slapd/back-dnssrv/compare.c +++ b/servers/slapd/back-dnssrv/compare.c @@ -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 diff --git a/servers/slapd/back-dnssrv/delete.c b/servers/slapd/back-dnssrv/delete.c index 4c7b3a070b..4ab5049e78 100644 --- a/servers/slapd/back-dnssrv/delete.c +++ b/servers/slapd/back-dnssrv/delete.c @@ -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 ); diff --git a/servers/slapd/back-dnssrv/external.h b/servers/slapd/back-dnssrv/external.h index a915eb5c03..a0caeed9ab 100644 --- a/servers/slapd/back-dnssrv/external.h +++ b/servers/slapd/back-dnssrv/external.h @@ -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 diff --git a/servers/slapd/back-dnssrv/modify.c b/servers/slapd/back-dnssrv/modify.c index 46d4b27216..4da2f55093 100644 --- a/servers/slapd/back-dnssrv/modify.c +++ b/servers/slapd/back-dnssrv/modify.c @@ -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 ) { diff --git a/servers/slapd/back-dnssrv/modrdn.c b/servers/slapd/back-dnssrv/modrdn.c index daf6764197..c461cdf4fb 100644 --- a/servers/slapd/back-dnssrv/modrdn.c +++ b/servers/slapd/back-dnssrv/modrdn.c @@ -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 ); diff --git a/servers/slapd/back-dnssrv/search.c b/servers/slapd/back-dnssrv/search.c index d45fc349ad..93f26d3a38 100644 --- a/servers/slapd/back-dnssrv/search.c +++ b/servers/slapd/back-dnssrv/search.c @@ -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 ) diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 9495bf4031..84d8927e9e 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -40,7 +40,6 @@ ldap_back_bind( char *dn, char *ndn, int method, - char *mech, struct berval *cred, char **edn ) diff --git a/servers/slapd/back-ldap/external.h b/servers/slapd/back-ldap/external.h index 2cdf751f5c..d5fc09a076 100644 --- a/servers/slapd/back-ldap/external.h +++ b/servers/slapd/back-ldap/external.h @@ -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 )); diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index cdb76533ee..1579b4607c 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -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 diff --git a/servers/slapd/back-ldbm/alias.c b/servers/slapd/back-ldbm/alias.c index f4c52d7ac9..ad2b0f5da3 100644 --- a/servers/slapd/back-ldbm/alias.c +++ b/servers/slapd/back-ldbm/alias.c @@ -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 ); diff --git a/servers/slapd/back-ldbm/attr.c b/servers/slapd/back-ldbm/attr.c index 7e90bee13d..220fd9b461 100644 --- a/servers/slapd/back-ldbm/attr.c +++ b/servers/slapd/back-ldbm/attr.c @@ -68,7 +68,7 @@ ainfo_dup( void attr_mask( struct ldbminfo *li, - char *type, + const char *type, int *indexmask ) { AttrInfo *a; diff --git a/servers/slapd/back-ldbm/bind.c b/servers/slapd/back-ldbm/bind.c index 4af194bed6..739a358f12 100644 --- a/servers/slapd/back-ldbm/bind.c +++ b/servers/slapd/back-ldbm/bind.c @@ -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 ) diff --git a/servers/slapd/back-ldbm/compare.c b/servers/slapd/back-ldbm/compare.c index b5be35ff60..e3de9d4797 100644 --- a/servers/slapd/back-ldbm/compare.c +++ b/servers/slapd/back-ldbm/compare.c @@ -21,8 +21,8 @@ ldbm_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 diff --git a/servers/slapd/back-ldbm/dbcache.c b/servers/slapd/back-ldbm/dbcache.c index c631ac3ee7..401b78fc22 100644 --- a/servers/slapd/back-ldbm/dbcache.c +++ b/servers/slapd/back-ldbm/dbcache.c @@ -21,8 +21,8 @@ DBCache * ldbm_cache_open( Backend *be, - char *name, - char *suffix, + const char *name, + const char *suffix, int flags ) { diff --git a/servers/slapd/back-ldbm/delete.c b/servers/slapd/back-ldbm/delete.c index c3c1cf669a..3c9f220f84 100644 --- a/servers/slapd/back-ldbm/delete.c +++ b/servers/slapd/back-ldbm/delete.c @@ -21,8 +21,8 @@ ldbm_back_delete( Backend *be, Connection *conn, Operation *op, - char *dn, - char *ndn + const char *dn, + const char *ndn ) { struct ldbminfo *li = (struct ldbminfo *) be->be_private; diff --git a/servers/slapd/back-ldbm/extended.c b/servers/slapd/back-ldbm/extended.c index ae4d3296f7..5e4762e49d 100644 --- a/servers/slapd/back-ldbm/extended.c +++ b/servers/slapd/back-ldbm/extended.c @@ -29,12 +29,12 @@ ldbm_back_extended( Backend *be, Connection *conn, Operation *op, - char *reqoid, + const char *reqoid, struct berval *reqdata, char **rspoid, struct berval **rspdata, LDAPControl *** rspctrls, - char** text, + const char** text, struct berval *** refs ) { @@ -45,7 +45,8 @@ ldbm_back_extended( return (exop_table[i].extended)( be, conn, op, reqoid, reqdata, - rspoid, rspdata, rspctrls, text, refs ); + rspoid, rspdata, rspctrls, + text, refs ); } } diff --git a/servers/slapd/back-ldbm/external.h b/servers/slapd/back-ldbm/external.h index 420acfe1e6..65c9fd790f 100644 --- a/servers/slapd/back-ldbm/external.h +++ b/servers/slapd/back-ldbm/external.h @@ -20,68 +20,78 @@ extern int ldbm_back_db_close LDAP_P(( BackendDB *bd )); extern int ldbm_back_db_destroy LDAP_P(( BackendDB *bd )); extern int ldbm_back_db_config LDAP_P(( BackendDB *bd, - const char *fname, int lineno, int argc, char **argv )); + const char *fname, int lineno, + int argc, char **argv )); extern int ldbm_back_extended LDAP_P(( BackendDB *bd, Connection *conn, Operation *op, - char *reqoid, + const char *reqoid, struct berval *reqdata, char **rspoid, struct berval **rspdata, LDAPControl *** rspctrls, - char **text, + const char **text, struct berval *** refs )); extern int ldbm_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 ldbm_back_unbind LDAP_P(( BackendDB *bd, Connection *conn, Operation *op )); extern int ldbm_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 ldbm_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 ldbm_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 ldbm_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 ldbm_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 ldbm_back_add LDAP_P(( BackendDB *bd, Connection *conn, Operation *op, Entry *e )); extern int ldbm_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 ldbm_back_abandon LDAP_P(( BackendDB *bd, Connection *conn, Operation *op, ber_int_t msgid )); #ifdef SLAPD_SCHEMA_NOT_COMPAT extern int ldbm_back_group LDAP_P(( BackendDB *bd, - Entry *target, const char* gr_ndn, const char* op_ndn, + Entry *target, + const char* gr_ndn, const char* op_ndn, const char* objectclassValue, AttributeDescription* group_at)); #else extern int ldbm_back_group LDAP_P(( BackendDB *bd, - Entry *target, const char* gr_ndn, const char* op_ndn, - const char* objectclassValue, const char* group_at)); + Entry *target, + const char* gr_ndn, const char* op_ndn, + const char* objectclassValue, + const char* group_at)); #endif @@ -100,8 +110,10 @@ extern int ldbm_tool_index_change LDAP_P(( BackendDB *be, AttributeDescription* desc, struct berval **bv, ID id, int op )); #else -extern int ldbm_tool_index_attr LDAP_P(( BackendDB *be, char* type )); -extern int ldbm_tool_index_change LDAP_P(( BackendDB *be, char* type, +extern int ldbm_tool_index_attr LDAP_P(( BackendDB *be, + char* type )); +extern int ldbm_tool_index_change LDAP_P(( BackendDB *be, + char* type, struct berval **bv, ID id, int op )); #endif extern int ldbm_tool_sync LDAP_P(( BackendDB *be )); diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 8e6c6d12a5..6c2ac4cd2f 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -31,13 +31,13 @@ int ldbm_modify_internal( Backend *be, Connection *conn, Operation *op, - char *dn, + const char *dn, Modifications *modlist, Entry *e ) { int rc, err; - char *text; + const char *text; Modification *mod; Modifications *ml; Attribute *save_attrs; @@ -205,8 +205,8 @@ ldbm_back_modify( Backend *be, Connection *conn, Operation *op, - char *dn, - char *ndn, + const char *dn, + const char *ndn, Modifications *modlist ) { diff --git a/servers/slapd/back-ldbm/modrdn.c b/servers/slapd/back-ldbm/modrdn.c index c31780f583..978bf20dff 100644 --- a/servers/slapd/back-ldbm/modrdn.c +++ b/servers/slapd/back-ldbm/modrdn.c @@ -37,11 +37,11 @@ ldbm_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 ) { #ifdef SLAPD_SCHEMA_NOT_COMPAT @@ -190,11 +190,12 @@ ldbm_back_modrdn( new_parent_dn = p_dn; /* New Parent unless newSuperior given */ - if ( (np_dn = newSuperior) != NULL) { + if ( newSuperior != NULL ) { Debug( LDAP_DEBUG_TRACE, - "ldbm_back_modrdn: new parent requested...\n", - 0, 0, 0 ); + "ldbm_back_modrdn: new parent \"%s\" requested...\n", + newSuperior, 0, 0 ); + np_dn = ch_strdup( newSuperior ); np_ndn = ch_strdup( np_dn ); (void) dn_normalize( np_ndn ); diff --git a/servers/slapd/back-ldbm/passwd.c b/servers/slapd/back-ldbm/passwd.c index f39fc948d5..35279e7542 100644 --- a/servers/slapd/back-ldbm/passwd.c +++ b/servers/slapd/back-ldbm/passwd.c @@ -21,12 +21,12 @@ ldbm_back_exop_passwd( Backend *be, Connection *conn, Operation *op, - char *reqoid, + const char *reqoid, struct berval *reqdata, - char **rspoid, + char **rspoid, struct berval **rspdata, - LDAPControl *** rspctrls, - char** text, + LDAPControl *** rspctrls, + const char **text, struct berval *** refs ) { diff --git a/servers/slapd/back-ldbm/proto-back-ldbm.h b/servers/slapd/back-ldbm/proto-back-ldbm.h index 7b9009a66e..475f45d36e 100644 --- a/servers/slapd/back-ldbm/proto-back-ldbm.h +++ b/servers/slapd/back-ldbm/proto-back-ldbm.h @@ -19,10 +19,10 @@ LDAP_BEGIN_DECL Entry *deref_internal_r LDAP_P(( Backend *be, Entry *e, - char *dn, + const char *dn, int *err, Entry **matched, - char **text )); + const char **text )); #define deref_entry_r( be, e, err, matched, text ) \ deref_internal_r( be, e, NULL, err, matched, text ) @@ -33,7 +33,7 @@ Entry *deref_internal_r LDAP_P(( * attr.c */ -void attr_mask LDAP_P(( struct ldbminfo *li, char *type, int *indexmask )); +void attr_mask LDAP_P(( struct ldbminfo *li, const char *type, int *indexmask )); void attr_index_config LDAP_P(( struct ldbminfo *li, const char *fname, int lineno, int argc, char **argv, int init )); @@ -59,7 +59,7 @@ void cache_release_all LDAP_P(( Cache *cache )); */ DBCache * ldbm_cache_open LDAP_P(( Backend *be, - char *name, char *suffix, int flags )); + const char *name, const char *suffix, int flags )); void ldbm_cache_close LDAP_P(( Backend *be, DBCache *db )); void ldbm_cache_really_close LDAP_P(( Backend *be, DBCache *db )); void ldbm_cache_flush_all LDAP_P(( Backend *be )); @@ -136,22 +136,20 @@ ID_BLOCK * index_read LDAP_P(( Backend *be, char *type, int indextype, char *val )); /* Possible operations supported (op) by index_change_values() */ int index_change_values LDAP_P(( Backend *be, - char *type, - struct berval **vals, - ID id, - unsigned int op )); + char *type, struct berval **vals, + ID id, unsigned int op )); /* * passwd.c */ extern int ldbm_back_exop_passwd LDAP_P(( BackendDB *bd, Connection *conn, Operation *op, - char *reqoid, + const char *reqoid, struct berval *reqdata, char **rspoid, struct berval **rspdata, LDAPControl ***rspctrls, - char **text, + const char **text, struct berval *** refs )); @@ -170,7 +168,7 @@ extern int ldbm_back_exop_passwd LDAP_P(( BackendDB *bd, /* returns LDAP error code indicating error OR SLAPD_ABANDON */ int ldbm_modify_internal LDAP_P((Backend *be, Connection *conn, Operation *op, - char *dn, Modifications *mods, Entry *e )); + const char *dn, Modifications *mods, Entry *e )); #ifdef HAVE_CYRUS_SASL /* diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index bf21362e3a..ced37b8265 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -29,21 +29,21 @@ ldbm_back_search( Backend *be, Connection *conn, Operation *op, - char *base, - char *nbase, + const char *base, + const char *nbase, int scope, int deref, int slimit, int tlimit, Filter *filter, - char *filterstr, + const char *filterstr, char **attrs, int attrsonly ) { struct ldbminfo *li = (struct ldbminfo *) be->be_private; int rc, err; - char *text; + const char *text; time_t stoptime; ID_BLOCK *candidates; ID id, cursor; @@ -190,7 +190,7 @@ ldbm_back_search( if ( deref & LDAP_DEREF_SEARCHING && is_entry_alias( e ) ) { Entry *matched; int err; - char *text; + const char *text; e = deref_entry_r( be, e, &err, &matched, &text ); @@ -314,13 +314,8 @@ ldbm_back_search( } #endif - result = send_search_entry(be, - conn, - op, - e, - attrs, - attrsonly, - NULL); + result = send_search_entry(be, conn, op, + e, attrs, attrsonly, NULL); #ifdef BROKEN_NUM_SUBORDINATES if (idl) diff --git a/servers/slapd/back-passwd/external.h b/servers/slapd/back-passwd/external.h index 78cd5af150..1561c8d4a6 100644 --- a/servers/slapd/back-passwd/external.h +++ b/servers/slapd/back-passwd/external.h @@ -7,9 +7,11 @@ LDAP_BEGIN_DECL extern int passwd_back_initialize LDAP_P(( BackendInfo *bi )); extern int passwd_back_search LDAP_P(( BackendDB *be, - Connection *c, Operation *o, char *base, - char *nbase, int scope, int deref, int slimit, int tlimit, - Filter *f, char *filterstr, char **attrs, int attrsonly)); + Connection *c, Operation *o, + const char *base, const char *nbase, + int scope, int deref, int slimit, int tlimit, + Filter *f, const char *filterstr, + char **attrs, int attrsonly)); extern int passwd_back_db_config LDAP_P((BackendDB *bd, const char *fname, int lineno, int argc, char **argv )); diff --git a/servers/slapd/back-passwd/search.c b/servers/slapd/back-passwd/search.c index 3cb0c9c4c6..154b629155 100644 --- a/servers/slapd/back-passwd/search.c +++ b/servers/slapd/back-passwd/search.c @@ -26,14 +26,14 @@ passwd_back_search( Backend *be, Connection *conn, Operation *op, - char *base, - char *nbase, + const char *base, + const char *nbase, int scope, int deref, int slimit, int tlimit, Filter *filter, - char *filterstr, + const char *filterstr, char **attrs, int attrsonly ) diff --git a/servers/slapd/back-perl/bind.c b/servers/slapd/back-perl/bind.c index 23bc127815..1a7200d264 100644 --- a/servers/slapd/back-perl/bind.c +++ b/servers/slapd/back-perl/bind.c @@ -33,10 +33,9 @@ perl_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 ) diff --git a/servers/slapd/back-perl/compare.c b/servers/slapd/back-perl/compare.c index a48d30c721..82d445ba0d 100644 --- a/servers/slapd/back-perl/compare.c +++ b/servers/slapd/back-perl/compare.c @@ -31,8 +31,8 @@ perl_back_compare( Backend *be, Connection *conn, Operation *op, - char *dn, - char *ndn, + const char *dn, + const char *ndn, Ava *ava ) { @@ -42,7 +42,7 @@ perl_back_compare( PerlBackend *perl_back = (PerlBackend *)be->be_private; send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM, - NULL, "not yet implemented", NULL, NULL ); + NULL, "not supported", NULL, NULL ); #ifdef notdef ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex ); diff --git a/servers/slapd/back-perl/delete.c b/servers/slapd/back-perl/delete.c index b0e90b922f..25870de2ae 100644 --- a/servers/slapd/back-perl/delete.c +++ b/servers/slapd/back-perl/delete.c @@ -25,8 +25,8 @@ perl_back_delete( Backend *be, Connection *conn, Operation *op, - char *dn, - char *ndn + const char *dn, + const char *ndn ) { int len; diff --git a/servers/slapd/back-perl/external.h b/servers/slapd/back-perl/external.h index e8dfc5cd6b..ad8dd5dbb4 100644 --- a/servers/slapd/back-perl/external.h +++ b/servers/slapd/back-perl/external.h @@ -17,35 +17,41 @@ extern int perl_back_db_config LDAP_P(( BackendDB *bd, extern int perl_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 perl_back_unbind LDAP_P(( BackendDB *bd, Connection *conn, Operation *op )); extern int perl_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 perl_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 perl_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 perl_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 perl_back_add LDAP_P(( BackendDB *bd, Connection *conn, Operation *op, Entry *e )); extern int perl_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 diff --git a/servers/slapd/back-perl/modify.c b/servers/slapd/back-perl/modify.c index 3b52095c21..dda511b407 100644 --- a/servers/slapd/back-perl/modify.c +++ b/servers/slapd/back-perl/modify.c @@ -26,8 +26,8 @@ perl_back_modify( Backend *be, Connection *conn, Operation *op, - char *dn, - char *ndn, + const char *dn, + const char *ndn, LDAPModList *modlist ) { diff --git a/servers/slapd/back-perl/modrdn.c b/servers/slapd/back-perl/modrdn.c index 18c303702b..c2f6ff19e7 100644 --- a/servers/slapd/back-perl/modrdn.c +++ b/servers/slapd/back-perl/modrdn.c @@ -39,11 +39,11 @@ perl_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 ) { int len; diff --git a/servers/slapd/back-perl/search.c b/servers/slapd/back-perl/search.c index dc1e804464..f40a367750 100644 --- a/servers/slapd/back-perl/search.c +++ b/servers/slapd/back-perl/search.c @@ -31,14 +31,14 @@ perl_back_search( Backend *be, Connection *conn, Operation *op, - char *base, - char *nbase, + const char *base, + const char *nbase, int scope, int deref, int sizelimit, int timelimit, Filter *filter, - char *filterstr, + const char *filterstr, char **attrs, int attrsonly ) diff --git a/servers/slapd/back-shell/bind.c b/servers/slapd/back-shell/bind.c index 586e20f2ea..aa5ef04ef9 100644 --- a/servers/slapd/back-shell/bind.c +++ b/servers/slapd/back-shell/bind.c @@ -20,10 +20,9 @@ shell_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 ) diff --git a/servers/slapd/back-shell/compare.c b/servers/slapd/back-shell/compare.c index 9494536150..bd46bd1b0f 100644 --- a/servers/slapd/back-shell/compare.c +++ b/servers/slapd/back-shell/compare.c @@ -20,8 +20,8 @@ shell_back_compare( Backend *be, Connection *conn, Operation *op, - char *dn, - char *ndn, + const char *dn, + const char *ndn, Ava *ava ) { diff --git a/servers/slapd/back-shell/delete.c b/servers/slapd/back-shell/delete.c index 0e31cd9539..feb737fe35 100644 --- a/servers/slapd/back-shell/delete.c +++ b/servers/slapd/back-shell/delete.c @@ -20,8 +20,8 @@ shell_back_delete( Backend *be, Connection *conn, Operation *op, - char *dn, - char *ndn + const char *dn, + const char *ndn ) { struct shellinfo *si = (struct shellinfo *) be->be_private; diff --git a/servers/slapd/back-shell/external.h b/servers/slapd/back-shell/external.h index 4d05645955..a148d0368e 100644 --- a/servers/slapd/back-shell/external.h +++ b/servers/slapd/back-shell/external.h @@ -21,35 +21,41 @@ extern int shell_back_db_config LDAP_P(( BackendDB *bd, extern int shell_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 shell_back_unbind LDAP_P(( BackendDB *bd, Connection *conn, Operation *op )); extern int shell_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 shell_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 shell_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 shell_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 shell_back_add LDAP_P(( BackendDB *bd, Connection *conn, Operation *op, Entry *e )); extern int shell_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 shell_back_abandon LDAP_P(( BackendDB *bd, Connection *conn, Operation *op, int msgid )); diff --git a/servers/slapd/back-shell/modify.c b/servers/slapd/back-shell/modify.c index bb7b175645..7da9c21251 100644 --- a/servers/slapd/back-shell/modify.c +++ b/servers/slapd/back-shell/modify.c @@ -20,8 +20,8 @@ shell_back_modify( Backend *be, Connection *conn, Operation *op, - char *dn, - char *ndn, + const char *dn, + const char *ndn, LDAPModList *ml ) { diff --git a/servers/slapd/back-shell/modrdn.c b/servers/slapd/back-shell/modrdn.c index efff5c166d..ec831f1ce0 100644 --- a/servers/slapd/back-shell/modrdn.c +++ b/servers/slapd/back-shell/modrdn.c @@ -33,11 +33,11 @@ shell_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 ) { struct shellinfo *si = (struct shellinfo *) be->be_private; diff --git a/servers/slapd/back-shell/search.c b/servers/slapd/back-shell/search.c index 43a5af559a..15560870c8 100644 --- a/servers/slapd/back-shell/search.c +++ b/servers/slapd/back-shell/search.c @@ -20,14 +20,14 @@ shell_back_search( Backend *be, Connection *conn, Operation *op, - char *base, - char *nbase, + const char *base, + const char *nbase, int scope, int deref, int size, int time, Filter *filter, - char *filterstr, + const char *filterstr, char **attrs, int attrsonly ) diff --git a/servers/slapd/back-sql/bind.c b/servers/slapd/back-sql/bind.c index f7c091592d..b383d5f1b8 100644 --- a/servers/slapd/back-sql/bind.c +++ b/servers/slapd/back-sql/bind.c @@ -18,7 +18,7 @@ #include "sql-wrap.h" int backsql_bind(Backend *be,Connection *conn,Operation *op, - char *dn,char *ndn,int method,char *mech,struct berval *cred,char** edn) + char *dn,char *ndn,int method,struct berval *cred,char** edn) { Debug(LDAP_DEBUG_TRACE,"==>backsql_bind()\n",0,0,0); //for now, just return OK, allowing to test modify operations @@ -36,4 +36,4 @@ int backsql_unbind(Backend *be,Connection *conn,Operation *op) return 0; } -#endif /* SLAPD_SQL */ \ No newline at end of file +#endif /* SLAPD_SQL */ diff --git a/servers/slapd/back-sql/external.h b/servers/slapd/back-sql/external.h index 9a49533b65..2cec859a9d 100644 --- a/servers/slapd/back-sql/external.h +++ b/servers/slapd/back-sql/external.h @@ -17,35 +17,41 @@ extern int backsql_db_config LDAP_P(( BackendDB *bd, extern int backsql_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 backsql_unbind LDAP_P(( BackendDB *bd, Connection *conn, Operation *op )); extern int backsql_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 backsql_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 backsql_modify LDAP_P(( BackendDB *bd, Connection *conn, Operation *op, - char *dn, char *ndn, LDAPModList *ml )); + const char *dn, const char *ndn, + LDAPModList *ml )); extern int backsql_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 backsql_add LDAP_P(( BackendDB *bd, Connection *conn, Operation *op, Entry *e )); extern int backsql_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 backsql_abandon LDAP_P(( BackendDB *bd, Connection *conn, Operation *op, int msgid )); diff --git a/servers/slapd/back-tcl/external.h b/servers/slapd/back-tcl/external.h index d7202f3d4e..3d3a7473dd 100644 --- a/servers/slapd/back-tcl/external.h +++ b/servers/slapd/back-tcl/external.h @@ -20,35 +20,41 @@ extern int tcl_back_db_config LDAP_P ((BackendDB * bd, extern int tcl_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 tcl_back_unbind LDAP_P ((BackendDB * bd, Connection * conn, Operation * op)); extern int tcl_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 tcl_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 tcl_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 tcl_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 tcl_back_add LDAP_P ((BackendDB * bd, Connection * conn, Operation * op, Entry * e)); extern int tcl_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 tcl_back_abandon LDAP_P ((BackendDB * bd, Connection * conn, Operation * op, int msgid)); diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 60873f7a11..6a3a9869d9 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -609,7 +609,7 @@ backend_check_controls( Backend *be, Connection *conn, Operation *op, - char **text ) + const char **text ) { LDAPControl **ctrls; ctrls = op->o_ctrls; diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index f54461363d..91fe758961 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -41,7 +41,7 @@ do_bind( char *ndn; ber_tag_t tag; int rc = LDAP_SUCCESS; - char *text; + const char *text; struct berval cred; Backend *be; @@ -340,7 +340,7 @@ do_bind( ndn = suffix_alias( be, ndn ); ret = (*be->be_bind)( be, conn, op, dn, ndn, - method, mech, &cred, &edn ); + method, &cred, &edn ); if ( ret == 0 ) { ldap_pvt_thread_mutex_lock( &conn->c_mutex ); diff --git a/servers/slapd/charray.c b/servers/slapd/charray.c index 75fc18c5dc..b67ec5a4db 100644 --- a/servers/slapd/charray.c +++ b/servers/slapd/charray.c @@ -115,34 +115,6 @@ charray_dup( char **a ) } -char * -charray2str( char **a ) -{ - char *s; - int i; - size_t cur, len = 0; - - if( a == NULL ) return NULL; - - for( i=0 ; a[i] != NULL ; i++ ) { - len += strlen( a[i] ); - } - - if( len == 0 ) return NULL; - - s = ch_malloc( len + 1 ); - - cur = 0; - for( i=0 ; a[i] != NULL ; i++ ) { - len = strlen( a[i] ); - strncpy( &s[cur], a[i], len ); - cur += len; - } - s[len] = '\0'; - return s; -} - - char ** str2charray( const char *str_in, const char *brkstr ) { diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index fa99594526..c25958b01b 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -41,7 +41,7 @@ do_compare( #endif Backend *be; int rc = LDAP_SUCCESS; - char *text = NULL; + const char *text = NULL; desc.bv_val = NULL; value.bv_val = NULL; diff --git a/servers/slapd/configinfo.c b/servers/slapd/configinfo.c index ad2ba5d4c0..51874a539f 100644 --- a/servers/slapd/configinfo.c +++ b/servers/slapd/configinfo.c @@ -32,7 +32,7 @@ int config_info( - Entry **entry, char **text ) + Entry **entry, const char **text ) { Entry *e; char buf[BUFSIZ]; diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 301d68118d..a2231eb5ed 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -600,8 +600,6 @@ void connection_closing( Connection *c ) /* don't listen on this port anymore */ slapd_clr_read( ber_pvt_sb_get_desc( c->c_sb ), 1 ); - /* shutdown I/O -- not yet implemented */ - /* abandon active operations */ connection_abandon( c ); diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 77fd3e4bd1..c07afb99bb 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -436,7 +436,7 @@ static Listener * open_listener( const char* url ) static int sockinit(void); static int sockdestroy(void); -int slapd_daemon_init( char *urls ) +int slapd_daemon_init( const char *urls ) { int i, rc; char **u; diff --git a/servers/slapd/delete.c b/servers/slapd/delete.c index 080b99f566..ad6988ef9e 100644 --- a/servers/slapd/delete.c +++ b/servers/slapd/delete.c @@ -31,7 +31,8 @@ do_delete( Operation *op ) { - char *dn, *ndn = NULL, *text; + char *dn, *ndn = NULL; + const char *text; Backend *be; int rc; diff --git a/servers/slapd/dn.c b/servers/slapd/dn.c index 970b73d011..39dc192bbd 100644 --- a/servers/slapd/dn.c +++ b/servers/slapd/dn.c @@ -253,28 +253,28 @@ dn_parent( char * dn_rdn( Backend *be, - char *dn ) + const char *dn_in ) { - char *s; + char *dn, *s; int inquote; - if( dn == NULL ) { + if( dn_in == NULL ) { return NULL; } - while(*dn && ASCII_SPACE(*dn)) { + while(*dn_in && ASCII_SPACE(*dn_in)) { dn++; } - if( *dn == '\0' ) { + if( *dn_in == '\0' ) { return( NULL ); } - if ( be != NULL && be_issuffix( be, dn ) ) { + if ( be != NULL && be_issuffix( be, dn_in ) ) { return( NULL ); } - dn = ch_strdup( dn ); + dn = ch_strdup( dn_in ); inquote = 0; @@ -336,8 +336,8 @@ char **dn_subtree( int dn_issuffix( - char *dn, - char *suffix + const char *dn, + const char *suffix ) { int dnlen, suffixlen; @@ -378,7 +378,7 @@ dn_issuffix( */ static char * -get_next_substring( char * s, char d ) +get_next_substring( const char * s, char d ) { char *str, *r; @@ -421,7 +421,7 @@ get_next_substring( char * s, char d ) * memory. The returned string will be null-terminated. */ -char * rdn_attr_type( char * s ) +char * rdn_attr_type( const char * s ) { return get_next_substring( s, '=' ); @@ -439,10 +439,10 @@ char * rdn_attr_type( char * s ) */ char * -rdn_attr_value( char * rdn ) +rdn_attr_value( const char * rdn ) { - char *str; + const char *str; if ( (str = strchr( rdn, '=' )) != NULL ) { diff --git a/servers/slapd/entry.c b/servers/slapd/entry.c index 4b3f68a5d1..73dacaf485 100644 --- a/servers/slapd/entry.c +++ b/servers/slapd/entry.c @@ -41,7 +41,7 @@ str2entry( char *s ) struct berval *vals[2]; #ifdef SLAPD_SCHEMA_NOT_COMPAT AttributeDescription *ad; - char *text; + const char *text; #else int nvals = 0; int maxvals = 0; diff --git a/servers/slapd/extended.c b/servers/slapd/extended.c index 9c18aac257..23923fc826 100644 --- a/servers/slapd/extended.c +++ b/servers/slapd/extended.c @@ -91,7 +91,7 @@ do_extended( ber_tag_t tag; ber_len_t len; extop_list_t *ext; - char *text; + const char *text; struct berval **refs; char *rspoid; struct berval *rspdata; diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index dc8e0201ad..4a4f592cf4 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -19,13 +19,14 @@ static int get_filter_list( BerElement *ber, Filter **f, char **fstr, - char **text ); + const char **text ); + static int get_substring_filter( Connection *conn, BerElement *ber, Filter *f, char **fstr, - char **text ); + const char **text ); int get_filter( @@ -33,7 +34,7 @@ get_filter( BerElement *ber, Filter **filt, char **fstr, - char **text ) + const char **text ) { ber_tag_t tag; ber_len_t len; @@ -327,7 +328,9 @@ get_filter( } static int -get_filter_list( Connection *conn, BerElement *ber, Filter **f, char **fstr, char **text ) +get_filter_list( Connection *conn, BerElement *ber, + Filter **f, char **fstr, + const char **text ) { Filter **new; int err; @@ -368,7 +371,7 @@ get_substring_filter( BerElement *ber, Filter *f, char **fstr, - char **text + const char **text ) { ber_tag_t tag; @@ -377,9 +380,10 @@ get_substring_filter( struct berval *value; char *last; struct berval type; -#ifndef SLAPD_SCHEMA_NOT_COMPAT - int syntax; +#ifdef SLAPD_SCHEMA_NOT_COMPAT struct berval *nvalue; +#else + int syntax; #endif *text = "error decoding filter"; @@ -430,7 +434,9 @@ get_substring_filter( for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT; tag = ber_next_element( ber, &len, last ) ) { +#ifdef SLAPD_SCHEMA_NOT_COMPAT unsigned usage; +#endif rc = ber_scanf( ber, "O", &value ); if ( rc == LBER_ERROR ) { diff --git a/servers/slapd/init.c b/servers/slapd/init.c index 397bb34378..c8322cb9ea 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -64,13 +64,13 @@ ldap_pvt_thread_mutex_t num_sent_mutex; ldap_pvt_thread_mutex_t entry2str_mutex; ldap_pvt_thread_mutex_t replog_mutex; -static char* slap_name = NULL; +static const char* slap_name = NULL; int slapMode = SLAP_UNDEFINED_MODE; static ldap_pvt_thread_mutex_t currenttime_mutex; int -slap_init( int mode, char *name ) +slap_init( int mode, const char *name ) { int rc; diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index 092e81e0b3..b9edfc6b1f 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -49,7 +49,7 @@ do_modify( Modifications *mods = NULL; Backend *be; int rc; - char *text; + const char *text; Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 ); @@ -218,7 +218,7 @@ do_modify( { int update = be->be_update_ndn != NULL; #ifdef SLAPD_SCHEMA_NOT_COMPAT - char *text; + const char *text; rc = slap_modlist2mods( modlist, update, &mods, &text ); if( rc != LDAP_SUCCESS ) { @@ -291,7 +291,7 @@ int slap_modlist2mods( LDAPModList *ml, int update, Modifications **mods, - char **text ) + const char **text ) { int rc; Modifications **modtail = mods; @@ -385,7 +385,7 @@ int slap_modlist2mods( int slap_mods_opattrs( Operation *op, Modifications **modtail, - char **text ) + const char **text ) { struct berval name, timestamp; time_t now = slap_get_time(); diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index 384a6a0447..11434c9635 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -53,7 +53,7 @@ do_modrdn( Backend *newSuperior_be = NULL; ber_len_t length; int rc; - char *text; + const char *text; Debug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 ); diff --git a/servers/slapd/monitor.c b/servers/slapd/monitor.c index f37dc6cdac..a7b042c8c1 100644 --- a/servers/slapd/monitor.c +++ b/servers/slapd/monitor.c @@ -30,7 +30,7 @@ int monitor_info( Entry **entry, - char **text ) + const char **text ) { Entry *e; char buf[BUFSIZ]; diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index ca30e23387..0b6feef114 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -137,7 +137,6 @@ static char *oc_op_no_usermod_attrs[] = { NULL }; -#endif /* @@ -189,6 +188,7 @@ oc_check_op_no_usermod_attr( const char *type ) return at->sat_no_user_mod; #endif } +#endif struct oindexrec { diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index 8d7bb84dec..8246f55965 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -21,12 +21,12 @@ int passwd_extop( SLAP_EXTOP_CALLBACK_FN ext_callback, Connection *conn, Operation *op, - char *reqoid, + const char *reqoid, struct berval *reqdata, char **rspoid, struct berval **rspdata, LDAPControl ***rspctrls, - char **text, + const char **text, struct berval ***refs ) { int rc; @@ -70,7 +70,7 @@ int slap_passwd_parse( struct berval *reqdata, struct berval **id, struct berval **oldpass, struct berval **newpass, - char **text ) + const char **text ) { int rc = LDAP_SUCCESS; ber_tag_t tag; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index f7d97c928f..9b9241745c 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -16,12 +16,12 @@ LIBSLAPD_F( struct slap_internal_schema ) slap_schema; LIBSLAPD_F (int) slap_str2ad LDAP_P(( const char *, AttributeDescription **ad, - char **text )); + const char **text )); LIBSLAPD_F (int) slap_bv2ad LDAP_P(( struct berval *bv, AttributeDescription **ad, - char **text )); + const char **text )); LIBSLAPD_F (AttributeDescription *) ad_dup LDAP_P(( AttributeDescription *desc )); @@ -144,7 +144,7 @@ LIBSLAPD_F (int) get_ava LDAP_P(( BerElement *ber, AttributeAssertion **ava, unsigned usage, - char **text )); + const char **text )); LIBSLAPD_F (void) ava_free LDAP_P(( AttributeAssertion *ava, int freeit )); @@ -152,7 +152,7 @@ LIBSLAPD_F (void) ava_free LDAP_P(( LIBSLAPD_F (int) get_ava LDAP_P(( BerElement *ber, Ava *ava, - char **text )); + const char **text )); LIBSLAPD_F (void) ava_free LDAP_P(( Ava *ava, int freeit )); #endif @@ -186,7 +186,7 @@ LIBSLAPD_F( int ) backend_check_controls LDAP_P(( Backend *be, Connection *conn, Operation *op, - char **text )); + const char **text )); LIBSLAPD_F (int) backend_connection_init LDAP_P((Connection *conn)); LIBSLAPD_F (int) backend_connection_destroy LDAP_P((Connection *conn)); @@ -247,7 +247,6 @@ LIBSLAPD_F (void) charray_free LDAP_P(( char **array )); LIBSLAPD_F (int) charray_inlist LDAP_P(( char **a, const char *s )); LIBSLAPD_F (char **) charray_dup LDAP_P(( char **a )); LIBSLAPD_F (char **) str2charray LDAP_P(( const char *str, const char *brkstr )); -LIBSLAPD_F (char *) charray2str LDAP_P(( char **a )); /* * controls.c @@ -302,11 +301,11 @@ LIBSLAPD_F (char *) dn_validate LDAP_P(( char *dn )); LIBSLAPD_F (char *) dn_normalize LDAP_P(( char *dn )); LIBSLAPD_F (char *) dn_parent LDAP_P(( Backend *be, const char *dn )); LIBSLAPD_F (char **) dn_subtree LDAP_P(( Backend *be, const char *dn )); -LIBSLAPD_F (char *) dn_rdn LDAP_P(( Backend *be, char *dn )); -LIBSLAPD_F (int) dn_issuffix LDAP_P(( char *dn, char *suffix )); +LIBSLAPD_F (char *) dn_rdn LDAP_P(( Backend *be, const char *dn )); +LIBSLAPD_F (int) dn_issuffix LDAP_P(( const char *dn, const char *suffix )); LIBSLAPD_F (int) rdn_validate LDAP_P(( const char* str )); -LIBSLAPD_F (char *) rdn_attr_value LDAP_P(( char * rdn )); -LIBSLAPD_F (char *) rdn_attr_type LDAP_P(( char * rdn )); +LIBSLAPD_F (char *) rdn_attr_value LDAP_P(( const char * rdn )); +LIBSLAPD_F (char *) rdn_attr_type LDAP_P(( const char * rdn )); LIBSLAPD_F (void) build_new_dn LDAP_P(( char ** new_dn, const char *e_dn, @@ -343,12 +342,12 @@ typedef int (*SLAP_EXTOP_CALLBACK_FN) LDAP_P(( typedef int (*SLAP_EXTOP_MAIN_FN) LDAP_P(( SLAP_EXTOP_CALLBACK_FN, Connection *conn, Operation *op, - char * reqoid, + const char * reqoid, struct berval * reqdata, char ** rspoid, struct berval ** rspdata, LDAPControl *** rspctrls, - char ** text, + const char ** text, struct berval *** refs )); typedef int (*SLAP_EXTOP_GETOID_FN) LDAP_P(( @@ -376,7 +375,7 @@ LIBSLAPD_F (int) get_filter LDAP_P(( BerElement *ber, Filter **filt, char **fstr, - char **text )); + const char **text )); LIBSLAPD_F (void) filter_free LDAP_P(( Filter *f )); LIBSLAPD_F (void) filter_print LDAP_P(( Filter *f )); @@ -385,7 +384,8 @@ LIBSLAPD_F (void) filter_print LDAP_P(( Filter *f )); * filterentry.c */ -LIBSLAPD_F (int) test_filter LDAP_P(( Backend *be, Connection *conn, Operation *op, Entry *e, Filter *f )); +LIBSLAPD_F (int) test_filter LDAP_P(( + Backend *be, Connection *conn, Operation *op, Entry *e, Filter *f )); /* * lock.c @@ -408,12 +408,12 @@ LIBSLAPD_F( int ) slap_modlist2mods( LDAPModList *ml, int update, Modifications **mods, - char **text ); + const char **text ); LIBSLAPD_F( int ) slap_mods_opattrs( Operation *op, Modifications **modlist, - char **text ); + const char **text ); #endif /* @@ -446,7 +446,7 @@ LIBSLAPD_F (void) *module_resolve LDAP_P(( LIBSLAPD_F (char *) supportedControls[]; LIBSLAPD_F (int) monitor_info LDAP_P(( - Entry **entry, char **text )); + Entry **entry, const char **text )); /* * operation.c @@ -506,12 +506,12 @@ LIBSLAPD_F (void) send_ldap_extended LDAP_P(( Connection *conn, Operation *op, ber_int_t err, const char *matched, const char *text, struct berval **refs, - char *rspoid, struct berval *rspdata, + const char *rspoid, struct berval *rspdata, LDAPControl **ctrls )); LIBSLAPD_F (void) send_ldap_partial LDAP_P(( Connection *conn, Operation *op, - char *rspoid, struct berval *rspdata, + const char *rspoid, struct berval *rspdata, LDAPControl **ctrls )); LIBSLAPD_F (void) send_search_result LDAP_P(( @@ -544,9 +544,10 @@ LIBSLAPD_F (int) sasl_init(void); LIBSLAPD_F (int) sasl_destroy(void); LIBSLAPD_F (int) sasl_errldap LDAP_P(( int )); LIBSLAPD_F (int) sasl_bind LDAP_P(( - Connection *, Operation *, - char *, char *, char *, struct berval *, char **)); - + Connection *conn, Operation *op, + const char *dn, const char *ndn, + const char *mech, struct berval *cred, + char **edn )); /* oc.c */ LIBSLAPD_F (int) oc_schema_info( Entry *e ); @@ -561,9 +562,11 @@ LIBSLAPD_F (int) syn_schema_info( Entry *e ); * schema.c */ +#ifndef SLAPD_SCHEMA_NOT_COMPAT LIBSLAPD_F (int) oc_check_op_attr LDAP_P(( const char *type )); LIBSLAPD_F (int) oc_check_op_usermod_attr LDAP_P(( const char *type )); LIBSLAPD_F (int) oc_check_op_no_usermod_attr LDAP_P(( const char *type )); +#endif LIBSLAPD_F (ObjectClass *) oc_find LDAP_P((const char *ocname)); LIBSLAPD_F (int) oc_add LDAP_P((LDAP_OBJECT_CLASS *oc, const char **err)); @@ -603,7 +606,7 @@ LIBSLAPD_F (int) register_matching_rule LDAP_P(( slap_mr_indexer_func *indexer, slap_mr_filter_func *filter )); -LIBSLAPD_F (int) schema_info LDAP_P(( Entry **entry, char **text )); +LIBSLAPD_F (int) schema_info LDAP_P(( Entry **entry, const char **text )); #ifdef SLAPD_SCHEMA_NOT_COMPAT LIBSLAPD_F (int) is_entry_objectclass LDAP_P(( @@ -623,7 +626,7 @@ LIBSLAPD_F (int) is_entry_objectclass LDAP_P(( */ LIBSLAPD_F (int) entry_schema_check LDAP_P(( Entry *e, Attribute *attrs, - char** text )); + const char** text )); /* @@ -652,12 +655,12 @@ LIBSLAPD_F (int) dscompare LDAP_P(( const char *s1, const char *s2del, char deli LIBSLAPD_F (int) starttls_extop LDAP_P(( SLAP_EXTOP_CALLBACK_FN, Connection *conn, Operation *op, - char * reqoid, + const char * reqoid, struct berval * reqdata, char ** rspoid, struct berval ** rspdata, LDAPControl ***rspctrls, - char ** text, + const char ** text, struct berval *** refs )); @@ -681,19 +684,19 @@ LIBSLAPD_F (int) value_normalize LDAP_P(( unsigned usage, struct berval *in, struct berval **out, - char ** text )); + const char ** text )); LIBSLAPD_F (int) value_match LDAP_P(( AttributeDescription *ad, MatchingRule *mr, struct berval *v1, struct berval *v2, - char ** text )); + const char ** text )); LIBSLAPD_F (int) value_find LDAP_P(( AttributeDescription *ad, MatchingRule *mr, struct berval **values, struct berval *value, - char ** text )); + const char ** text )); #else LIBSLAPD_F (int) value_add_fast LDAP_P(( struct berval ***vals, struct berval **addvals, int nvals, int naddvals, int *maxvals )); LIBSLAPD_F (void) value_normalize LDAP_P(( char *s, int syntax )); @@ -715,12 +718,12 @@ LIBSLAPD_F (void) slap_init_user LDAP_P(( char *username, char *groupname )); LIBSLAPD_F (int) passwd_extop LDAP_P(( SLAP_EXTOP_CALLBACK_FN, Connection *conn, Operation *op, - char * reqoid, + const char * reqoid, struct berval * reqdata, char ** rspoid, struct berval ** rspdata, LDAPControl *** rspctrls, - char ** text, + const char ** text, struct berval *** refs )); LIBSLAPD_F (int) slap_passwd_check( @@ -740,7 +743,7 @@ LIBSLAPD_F (int) slap_passwd_parse( struct berval **id, struct berval **oldpass, struct berval **newpass, - char **text ); + const char **text ); /* * kerberos.c @@ -801,14 +804,14 @@ LIBSLAPD_F (ldap_pvt_thread_mutex_t) gmtime_mutex; LIBSLAPD_F (AccessControl *) global_acl; -LIBSLAPD_F (int) slap_init LDAP_P((int mode, char* name)); +LIBSLAPD_F (int) slap_init LDAP_P((int mode, const char* name)); LIBSLAPD_F (int) slap_startup LDAP_P(( Backend *be )); LIBSLAPD_F (int) slap_shutdown LDAP_P(( Backend *be )); LIBSLAPD_F (int) slap_destroy LDAP_P((void)); struct sockaddr_in; -LIBSLAPD_F (int) slapd_daemon_init( char *urls ); +LIBSLAPD_F (int) slapd_daemon_init( const char *urls ); LIBSLAPD_F (int) slapd_daemon_destroy(void); LIBSLAPD_F (int) slapd_daemon(void); @@ -823,10 +826,10 @@ LIBSLAPD_F (RETSIGTYPE) slap_sig_shutdown LDAP_P((int sig)); LIBSLAPD_F (RETSIGTYPE) slap_sig_wake LDAP_P((int sig)); LIBSLAPD_F (int) config_info LDAP_P(( - Entry **e, char **text )); + Entry **e, const char **text )); LIBSLAPD_F (int) root_dse_info LDAP_P(( - Entry **e, char **text )); + Entry **e, const char **text )); LIBSLAPD_F (int) do_abandon LDAP_P((Connection *conn, Operation *op)); LIBSLAPD_F (int) do_add LDAP_P((Connection *conn, Operation *op)); diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 816e031dfe..91a9945b3d 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -505,7 +505,7 @@ send_ldap_extended( const char *matched, const char *text, struct berval **refs, - char *rspoid, + const char *rspoid, struct berval *rspdata, LDAPControl **ctrls ) diff --git a/servers/slapd/root_dse.c b/servers/slapd/root_dse.c index 97ca691ff2..16c10f133c 100644 --- a/servers/slapd/root_dse.c +++ b/servers/slapd/root_dse.c @@ -18,7 +18,7 @@ #include "slap.h" int -root_dse_info( Entry **entry, char **text ) +root_dse_info( Entry **entry, const char **text ) { char buf[BUFSIZ]; Entry *e; diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index e94e3c6304..b2e40a05b8 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -186,9 +186,9 @@ int sasl_destroy( void ) int sasl_bind( Connection *conn, Operation *op, - char *dn, - char *ndn, - char *mech, + const char *dn, + const char *ndn, + const char *mech, struct berval *cred, char **edn ) { @@ -313,9 +313,9 @@ int sasl_bind( int sasl_bind( Connection *conn, Operation *op, - char *dn, - char *ndn, - char *mech, + const char *dn, + const char *ndn, + const char *mech, struct berval *cred, char **edn ) { diff --git a/servers/slapd/schema.c b/servers/slapd/schema.c index ec6334da55..04c6b2a92d 100644 --- a/servers/slapd/schema.c +++ b/servers/slapd/schema.c @@ -20,7 +20,7 @@ #if defined( SLAPD_SCHEMA_DN ) int -schema_info( Entry **entry, char **text ) +schema_info( Entry **entry, const char **text ) { #ifdef SLAPD_SCHEMA_NOT_COMPAT AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass; @@ -60,8 +60,8 @@ schema_info( Entry **entry, char **text ) attr_merge( e, ad_objectClass, vals ); { - int rc; #ifdef SLAPD_SCHEMA_NOT_COMPAT + int rc; AttributeDescription *desc = NULL; #else char *desc; diff --git a/servers/slapd/schema_check.c b/servers/slapd/schema_check.c index 729873da17..da8559e535 100644 --- a/servers/slapd/schema_check.c +++ b/servers/slapd/schema_check.c @@ -34,7 +34,7 @@ static char * oc_check_required(Entry *e, struct berval *ocname); int entry_schema_check( - Entry *e, Attribute *oldattrs, char** text ) + Entry *e, Attribute *oldattrs, const char** text ) { Attribute *a, *aoc; ObjectClass *oc; @@ -220,6 +220,9 @@ oc_check_allowed( #endif #ifdef SLAPD_SCHEMA_NOT_COMPAT + /* + * All operational attributions are allowed by schema rules. + */ if( is_at_operational(at) ) { return LDAP_SUCCESS; } diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 1e680a471f..d8d6496984 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -752,7 +752,7 @@ schema_prep( void ) for( i=0; ad_map[i].ssam_name; i++ ) { int rc; - char *text; + const char *text; AttributeDescription ** adp = (AttributeDescription **) &(((char *) &slap_schema)[ad_map[i].ssam_offset]); diff --git a/servers/slapd/search.c b/servers/slapd/search.c index 67956eebfe..1ba7b3cad2 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -40,7 +40,7 @@ do_search( char **attrs = NULL; Backend *be; int rc; - char *text; + const char *text; Debug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 ); diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 80e8a1542f..8b9772c8b3 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -840,12 +840,12 @@ typedef int (*SLAP_EXTENDED_FN) LDAP_P(( Backend *be, struct slap_conn *conn, struct slap_op *op, - char *reqoid, + const char *reqoid, struct berval * reqdata, char **rspoid, struct berval ** rspdata, LDAPControl *** rspctrls, - char ** text, + const char ** text, struct berval *** refs )); struct slap_backend_info { @@ -909,38 +909,42 @@ struct slap_backend_info { /* LDAP Operations Handling Routines */ int (*bi_op_bind) LDAP_P(( BackendDB *bd, struct slap_conn *c, struct slap_op *o, - char *dn, char *ndn, int method, char* mechanism, + const char *dn, const char *ndn, int method, struct berval *cred, char** edn )); int (*bi_op_unbind) LDAP_P((BackendDB *bd, struct slap_conn *c, struct slap_op *o )); int (*bi_op_search) LDAP_P((BackendDB *bd, struct slap_conn *c, struct slap_op *o, - char *base, char *nbase, int scope, int deref, + const char *base, const char *nbase, + int scope, int deref, int slimit, int tlimit, - Filter *f, char *filterstr, char **attrs, - int attrsonly)); + Filter *f, const char *filterstr, + char **attrs, int attrsonly)); #ifdef SLAPD_SCHEMA_NOT_COMPAT int (*bi_op_compare)LDAP_P((BackendDB *bd, struct slap_conn *c, struct slap_op *o, - char *dn, char *ndn, AttributeAssertion *ava)); + const char *dn, const char *ndn, + AttributeAssertion *ava)); #else int (*bi_op_compare)LDAP_P((BackendDB *bd, struct slap_conn *c, struct slap_op *o, - char *dn, char *ndn, Ava *ava)); + const char *dn, const char *ndn, + Ava *ava)); #endif int (*bi_op_modify) LDAP_P((BackendDB *bd, struct slap_conn *c, struct slap_op *o, - char *dn, char *ndn, Modifications *m)); + const char *dn, const char *ndn, Modifications *m)); int (*bi_op_modrdn) LDAP_P((BackendDB *bd, struct slap_conn *c, struct slap_op *o, - char *dn, char *ndn, char *newrdn, int deleteoldrdn, - char *newSuperior)); + const char *dn, const char *ndn, + const char *newrdn, int deleteoldrdn, + const char *newSuperior)); int (*bi_op_add) LDAP_P((BackendDB *bd, struct slap_conn *c, struct slap_op *o, Entry *e)); int (*bi_op_delete) LDAP_P((BackendDB *bd, struct slap_conn *c, struct slap_op *o, - char *dn, char *ndn)); + const char *dn, const char *ndn)); int (*bi_op_abandon) LDAP_P((BackendDB *bd, struct slap_conn *c, struct slap_op *o, ber_int_t msgid)); @@ -985,7 +989,8 @@ struct slap_backend_info { int (*bi_tool_index_attr) LDAP_P(( BackendDB *be, char* type )); int (*bi_tool_index_change) LDAP_P(( BackendDB *be, - char* type, struct berval **bv, ID id, int op )); + char* type, + struct berval **bv, ID id, int op )); #endif int (*bi_tool_sync) LDAP_P(( BackendDB *be )); diff --git a/servers/slapd/starttls.c b/servers/slapd/starttls.c index ad16783c77..b607c68ef7 100644 --- a/servers/slapd/starttls.c +++ b/servers/slapd/starttls.c @@ -23,12 +23,12 @@ starttls_extop ( SLAP_EXTOP_CALLBACK_FN cb, Connection *conn, Operation *op, - char * reqoid, + const char * reqoid, struct berval * reqdata, char ** rspoid, struct berval ** rspdata, LDAPControl ***rspctrls, - char ** text, + const char ** text, struct berval *** refs ) { void *ctx; diff --git a/servers/slapd/str2filter.c b/servers/slapd/str2filter.c index 4b371f46d0..c49d3c3827 100644 --- a/servers/slapd/str2filter.c +++ b/servers/slapd/str2filter.c @@ -147,7 +147,7 @@ str2simple( const char *str ) char *value, savechar; #ifdef SLAPD_SCHEMA_NOT_COMPAT int rc; - char *text; + const char *text; #endif Debug( LDAP_DEBUG_FILTER, "str2simple \"%s\"\n", str, 0, 0 ); diff --git a/servers/slapd/tools/mimic.c b/servers/slapd/tools/mimic.c index 0dce3b91f6..a2d8f742a5 100644 --- a/servers/slapd/tools/mimic.c +++ b/servers/slapd/tools/mimic.c @@ -47,7 +47,7 @@ send_ldap_extended( const char *matched, const char *text, struct berval **refs, - char *rspoid, + const char *rspoid, struct berval *rspdata, LDAPControl **ctrls ) @@ -148,9 +148,9 @@ int sasl_destroy(void) { int sasl_bind( Connection *conn, Operation *op, - char *dn, - char *ndn, - char *mech, + const char *dn, + const char *ndn, + const char *mech, struct berval *cred, char **edn) { diff --git a/servers/slapd/tools/slapadd.c b/servers/slapd/tools/slapadd.c index b59b9bd348..a73802f5fd 100644 --- a/servers/slapd/tools/slapadd.c +++ b/servers/slapd/tools/slapadd.c @@ -69,7 +69,7 @@ main( int argc, char **argv ) if( !noschemacheck ) { /* check schema */ - char *text; + const char *text; if ( entry_schema_check( e, NULL, &text ) != LDAP_SUCCESS ) { fprintf( stderr, "%s: dn=\"%s\" (line=%d): %s\n", progname, e->e_dn, lineno, text ); diff --git a/servers/slapd/tools/slapindex.c b/servers/slapd/tools/slapindex.c index 81bea1bc77..f946496e5d 100644 --- a/servers/slapd/tools/slapindex.c +++ b/servers/slapd/tools/slapindex.c @@ -22,7 +22,7 @@ main( int argc, char **argv ) char *type; #ifdef SLAPD_SCHEMA_NOT_COMPAT AttributeDescription *desc; - char *text; + const char *text; #else char *desc; #endif diff --git a/servers/slapd/value.c b/servers/slapd/value.c index db7213ebd9..21538c23e1 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -94,7 +94,7 @@ value_normalize( unsigned usage, struct berval *in, struct berval **out, - char **text ) + const char **text ) { int rc; MatchingRule *mr; @@ -176,7 +176,7 @@ value_match( MatchingRule *mr, struct berval *v1, /* (unnormalized) stored value */ struct berval *v2, /* (normalized) asserted value */ - char ** text ) + const char ** text ) { /* not yet implemented */ return 0; @@ -237,7 +237,7 @@ int value_find( MatchingRule *mr, struct berval **vals, struct berval *val, - char ** text ) + const char ** text ) #else int value_find( -- 2.39.5