#endif
static int
-regtest(char *fname, int lineno, char *pat) {
+regtest(const char *fname, int lineno, char *pat) {
int e;
regex_t re;
void
parse_acl(
Backend *be,
- char *fname,
+ const char *fname,
int lineno,
int argc,
char **argv
Attribute *
attr_find(
Attribute *a,
- char *type
+ const char *type
)
{
for ( ; a != NULL; a = a->a_next ) {
int
attr_delete(
Attribute **attrs,
- char *type
+ const char *type
)
{
Attribute **a;
void
attr_syntax_config(
- char *fname,
+ const char *fname,
int lineno,
int argc,
char **argv
void
attr_index_config(
struct ldbminfo *li,
- char *fname,
+ const char *fname,
int lineno,
int argc,
char **argv,
cache_find_entry_dn2id(
Backend *be,
Cache *cache,
- char *dn
+ const char *dn
)
{
Entry e, *ep;
ID id;
int count = 0;
- e.e_dn = dn;
+ e.e_dn = (char *) dn;
e.e_ndn = ch_strdup( dn );
(void) dn_normalize_case( e.e_ndn );
int
ldbm_back_db_config(
Backend *be,
- char *fname,
+ const char *fname,
int lineno,
int argc,
char **argv
int
dn2id_add(
Backend *be,
- char *dn,
+ const char *dn,
ID id
)
{
ID
dn2id(
Backend *be,
- char *dn
+ const char *dn
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
ID_BLOCK *
dn2idl(
Backend *be,
- char *dn,
+ const char *dn,
int prefix
)
{
int
dn2id_delete(
Backend *be,
- char *dn
+ const char *dn
)
{
DBCache *db;
Entry *
dn2entry_rw(
Backend *be,
- char *dn,
+ const char *dn,
Entry **matched,
int rw
)
extern int ldbm_back_db_destroy LDAP_P(( BackendDB *bd ));
extern int ldbm_back_db_config LDAP_P(( BackendDB *bd,
- char *fname, int lineno, int argc, char **argv ));
+ const char *fname, int lineno, int argc, char **argv ));
extern int ldbm_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
Connection *conn, Operation *op, ber_int_t msgid ));
extern int ldbm_back_group LDAP_P(( BackendDB *bd,
- Entry *target, char* gr_ndn, char* op_ndn,
- char* objectclassValue, char* groupattrName));
+ Entry *target, const char* gr_ndn, const char* op_ndn,
+ const char* objectclassValue, const char* groupattrName));
/* hooks for slap tools */
ldbm_back_group(
Backend *be,
Entry *target,
- char *gr_ndn,
- char *op_ndn,
- char *objectclassValue,
- char *groupattrName
+ const char *gr_ndn,
+ const char *op_ndn,
+ const char *objectclassValue,
+ const char *groupattrName
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
goto return_results;
}
- bv.bv_val = objectclassValue;
+ bv.bv_val = (char *) objectclassValue;
bv.bv_len = strlen( bv.bv_val );
if (value_find(attr->a_vals, &bv, attr->a_syntax, 1) != 0) {
"<= ldbm_back_group: found objectClass %s and %s\n",
objectclassValue, groupattrName, 0 );
- bv.bv_val = op_ndn;
+ bv.bv_val = (char *) op_ndn;
bv.bv_len = strlen( op_ndn );
if( value_find( attr->a_vals, &bv, attr->a_syntax, 1) != 0 )
)
{
Datum data;
- ID_BLOCK *idl;
+ ID_BLOCK idl;
/* Debug( LDAP_DEBUG_TRACE, "=> idl_fetch_one\n", 0, 0, 0 ); */
return NULL;
}
- idl = idl_dup( (ID_BLOCK *) data.dptr);
+ memcpy( &idl, data.dptr, data.dsize );
ldbm_datum_free( db->dbc_db, data );
- return( idl );
+ return idl_dup( &idl );
}
void attr_masks LDAP_P(( struct ldbminfo *li, char *type, int *indexmask,
int *syntaxmask ));
-void attr_index_config LDAP_P(( struct ldbminfo *li, char *fname, int lineno,
- int argc, char **argv, int init ));
+void attr_index_config LDAP_P(( struct ldbminfo *li,
+ const char *fname, int lineno,
+ int argc, char **argv, int init ));
void attr_index_destroy LDAP_P(( Avlnode *tree ));
/*
#define cache_return_entry_r(c, e) cache_return_entry_rw((c), (e), 0)
#define cache_return_entry_w(c, e) cache_return_entry_rw((c), (e), 1)
-ID cache_find_entry_dn2id LDAP_P(( Backend *be, Cache *cache, char *dn ));
+ID cache_find_entry_dn2id LDAP_P(( Backend *be, Cache *cache, const char *dn ));
Entry * cache_find_entry_id LDAP_P(( Cache *cache, ID id, int rw ));
int cache_delete_entry LDAP_P(( Cache *cache, Entry *e ));
void cache_release_all LDAP_P(( Cache *cache ));
* dn2id.c
*/
-int dn2id_add LDAP_P(( Backend *be, char *dn, ID id ));
-ID dn2id LDAP_P(( Backend *be, char *dn ));
-ID_BLOCK *dn2idl LDAP_P(( Backend *be, char *dn, int prefix ));
-int dn2id_delete LDAP_P(( Backend *be, char *dn ));
+int dn2id_add LDAP_P(( Backend *be, const char *dn, ID id ));
+ID dn2id LDAP_P(( Backend *be, const char *dn ));
+ID_BLOCK *dn2idl LDAP_P(( Backend *be, const char *dn, int prefix ));
+int dn2id_delete LDAP_P(( Backend *be, const char *dn ));
-Entry * dn2entry_rw LDAP_P(( Backend *be, char *dn, Entry **matched, int rw ));
+Entry * dn2entry_rw LDAP_P(( Backend *be, const char *dn, Entry **matched, int rw ));
#define dn2entry_r(be, dn, m) dn2entry_rw((be), (dn), (m), 0)
#define dn2entry_w(be, dn, m) dn2entry_rw((be), (dn), (m), 1)
return 0;
}
-BackendInfo* backend_info(char *type)
+BackendInfo* backend_info(const char *type)
{
int i;
BackendDB *
backend_db_init(
- char *type
+ const char *type
)
{
Backend *be;
}
Backend *
-select_backend( char * dn )
+select_backend( const char * dn )
{
int i, j, len, dnlen;
int
be_issuffix(
Backend *be,
- char *suffix
+ const char *suffix
)
{
int i;
}
int
-be_isroot( Backend *be, char *ndn )
+be_isroot( Backend *be, const char *ndn )
{
int rc;
}
int
-be_isroot_pw( Backend *be, char *ndn, struct berval *cred )
+be_isroot_pw( Backend *be, const char *ndn, struct berval *cred )
{
int result;
backend_group(
Backend *be,
Entry *target,
- char *gr_ndn,
- char *op_ndn,
- char *objectclassValue,
- char *groupattrName
+ const char *gr_ndn,
+ const char *op_ndn,
+ const char *objectclassValue,
+ const char *groupattrName
)
{
if (be->be_group)
ber_int_t version;
ber_tag_t method;
char *mech;
- char *dn, *ndn;
+ char *dn;
+ char *ndn;
ber_tag_t tag;
int rc = LDAP_SUCCESS;
struct berval cred;
void
charray_add(
char ***a,
- char *s
+ const char *s
)
{
int n;
void
charray_merge(
char ***a,
- char **s
+ const char **s
)
{
int i, n, nn;
int
charray_inlist(
- char **a,
- char *s
+ const char **a,
+ const char *s
)
{
int i;
}
char **
-charray_dup( char **a )
+charray_dup( const char **a )
{
int i;
char **new;
char *
-charray2str( char **a )
+charray2str( const char **a )
{
char *s;
int i;
char **
-str2charray( char *str, char *brkstr )
+str2charray( const char *str_in, const char *brkstr )
{
+ char *str;
char **res;
char *s;
char *lasts;
int i;
/* protect the input string from strtok */
- str = ch_strdup( str );
+ str = ch_strdup( str_in );
i = 1;
for ( s = str; *s; s++ ) {
static char *strtok_quote(char *line, char *sep);
int
-read_config( char *fname )
+read_config( const char *fname )
{
FILE *fp;
char *line, *savefname, *saveline;
char *
dn_parent(
Backend *be,
- char *dn
+ const char *dn
)
{
- char *s;
+ const char *s;
int inquote;
if( dn == NULL ) {
*/
char **dn_subtree(
Backend *be,
- char *dn )
+ const char *dn )
{
char *child, *parent;
char **subtree = NULL;
- child = dn;
+ child = ch_strdup( dn );
do {
charray_add( &subtree, child );
parent = dn_parent( be, child );
- if( child != dn ) {
- free( child );
- }
+ free( child );
child = parent;
} while ( child != NULL );
*/
void
-build_new_dn( char ** new_dn, char *e_dn, char * p_dn, char * newrdn )
+build_new_dn( char ** new_dn,
+ const char *e_dn,
+ const char * p_dn,
+ const char * newrdn )
{
if ( p_dn == NULL ) {
#include "slap.h"
FILE *
-lock_fopen( char *fname, char *type, FILE **lfp )
+lock_fopen( const char *fname, const char *type, FILE **lfp )
{
FILE *fp;
char buf[MAXPATHLEN];
* aclparse.c
*/
-void parse_acl LDAP_P(( Backend *be, char *fname, int lineno, int argc, char **argv ));
+void parse_acl LDAP_P(( Backend *be,
+ const char *fname,
+ int lineno,
+ int argc, char **argv ));
char * access2str LDAP_P(( int access ));
int str2access LDAP_P(( char *str ));
int attr_merge_fast LDAP_P(( Entry *e, char *type, struct berval **vals, int nvals,
int naddvals, int *maxvals, Attribute ***a ));
int attr_merge LDAP_P(( Entry *e, char *type, struct berval **vals ));
-Attribute * attr_find LDAP_P(( Attribute *a, char *type ));
-int attr_delete LDAP_P(( Attribute **attrs, char *type ));
+Attribute * attr_find LDAP_P(( Attribute *a, const char *type ));
+int attr_delete LDAP_P(( Attribute **attrs, const char *type ));
int attr_syntax LDAP_P(( char *type ));
-void attr_syntax_config LDAP_P(( char *fname, int lineno, int argc, char **argv ));
+void attr_syntax_config LDAP_P(( const char *fname, int lineno, int argc, char **argv ));
AttributeType * at_find LDAP_P(( const char *name ));
int at_find_in_list LDAP_P(( AttributeType *sat, AttributeType **list ));
int at_append_to_list LDAP_P(( AttributeType *sat, AttributeType ***listp ));
int backend_shutdown LDAP_P((Backend *be));
int backend_destroy LDAP_P((void));
-BackendInfo * backend_info LDAP_P(( char *type ));
-BackendDB * backend_db_init LDAP_P(( char *type ));
+BackendInfo * backend_info LDAP_P(( const char *type ));
+BackendDB * backend_db_init LDAP_P(( const char *type ));
-BackendDB * select_backend LDAP_P(( char * dn ));
+BackendDB * select_backend LDAP_P(( const char * dn ));
-int be_issuffix LDAP_P(( Backend *be, char *suffix ));
-int be_isroot LDAP_P(( Backend *be, char *ndn ));
-int be_isroot_pw LDAP_P(( Backend *be, char *ndn, struct berval *cred ));
+int be_issuffix LDAP_P(( Backend *be, const char *suffix ));
+int be_isroot LDAP_P(( Backend *be, const char *ndn ));
+int be_isroot_pw LDAP_P(( Backend *be, const char *ndn, struct berval *cred ));
char* be_root_dn LDAP_P(( Backend *be ));
int be_entry_release_rw LDAP_P(( Backend *be, Entry *e, int rw ));
#define be_entry_release_r( be, e ) be_entry_release_rw( be, e, 0 )
extern int backend_group LDAP_P((Backend *be,
Entry *target,
- char *gr_ndn, char *op_ndn,
- char *objectclassValue, char *groupattrName));
+ const char *gr_ndn,
+ const char *op_ndn,
+ const char *objectclassValue,
+ const char *groupattrName));
#ifdef SLAPD_SCHEMA_DN
/* temporary extern for temporary routine*/
* charray.c
*/
-void charray_add LDAP_P(( char ***a, char *s ));
-void charray_merge LDAP_P(( char ***a, char **s ));
+void charray_add LDAP_P(( char ***a, const char *s ));
+void charray_merge LDAP_P(( char ***a, const char **s ));
void charray_free LDAP_P(( char **array ));
-int charray_inlist LDAP_P(( char **a, char *s ));
-char ** charray_dup LDAP_P(( char **a ));
-char ** str2charray LDAP_P(( char *str, char *brkstr ));
-char * charray2str LDAP_P(( char **a ));
+int charray_inlist LDAP_P(( const char **a, const char *s ));
+char ** charray_dup LDAP_P(( const char **a ));
+char ** str2charray LDAP_P(( const char *str, const char *brkstr ));
+char * charray2str LDAP_P(( const char **a ));
/*
* controls.c
* config.c
*/
-int read_config LDAP_P(( char *fname ));
+int read_config LDAP_P(( const char *fname ));
/*
* connection.c
char * dn_normalize LDAP_P(( char *dn ));
char * dn_normalize_case LDAP_P(( char *dn ));
-char * dn_parent LDAP_P(( Backend *be, char *dn ));
-char ** dn_subtree LDAP_P(( Backend *be, char *dn ));
+char * dn_parent LDAP_P(( Backend *be, const char *dn ));
+char ** dn_subtree LDAP_P(( Backend *be, const char *dn ));
char * dn_rdn LDAP_P(( Backend *be, char *dn ));
int dn_issuffix LDAP_P(( char *dn, char *suffix ));
#ifdef DNS_DN
int rdn_validate LDAP_P(( const char* str ));
char * rdn_attr_value LDAP_P(( char * rdn ));
char * rdn_attr_type LDAP_P(( char * rdn ));
-void build_new_dn LDAP_P(( char ** new_dn, char *e_dn, char * p_dn,
- char * newrdn ));
+
+void build_new_dn LDAP_P(( char ** new_dn,
+ const char *e_dn,
+ const char * p_dn,
+ const char * newrdn ));
/*
* entry.c
*/
* lock.c
*/
-FILE * lock_fopen LDAP_P(( char *fname, char *type, FILE **lfp ));
+FILE * lock_fopen LDAP_P(( const char *fname, const char *type, FILE **lfp ));
int lock_fclose LDAP_P(( FILE *fp, FILE *lfp ));
/*
void send_ldap_result LDAP_P((
Connection *conn, Operation *op,
- int err, char *matched, char *text,
+ int err, const char *matched, const char *text,
struct berval **refs,
LDAPControl **ctrls ));
void send_ldap_disconnect LDAP_P((
Connection *conn, Operation *op,
- int err, char *text ));
+ int err, const char *text ));
void send_search_result LDAP_P((
Connection *conn, Operation *op,
- int err, char *matched, char *text,
+ int err, const char *matched, const char *text,
struct berval **refs,
LDAPControl **ctrls,
int nentries ));
*/
int oc_schema_check LDAP_P(( Entry *e ));
-int oc_check_operational_attr LDAP_P(( char *type ));
-int oc_check_usermod_attr LDAP_P(( char *type ));
-int oc_check_no_usermod_attr LDAP_P(( char *type ));
+int oc_check_operational_attr LDAP_P(( const char *type ));
+int oc_check_usermod_attr LDAP_P(( const char *type ));
+int oc_check_no_usermod_attr LDAP_P(( const char *type ));
ObjectClass *oc_find LDAP_P((const char *ocname));
int oc_add LDAP_P((LDAP_OBJECT_CLASS *oc, const char **err));
Syntax *syn_find LDAP_P((const char *synname));
void schema_info LDAP_P((Connection *conn, Operation *op, char **attrs, int attrsonly));
int schema_init LDAP_P((void));
-int is_entry_objectclass LDAP_P(( Entry *, char* objectclass ));
+int is_entry_objectclass LDAP_P(( Entry *, const char* objectclass ));
#define is_entry_alias(e) is_entry_objectclass((e), "ALIAS")
#define is_entry_referral(e) is_entry_objectclass((e), "REFERRAL")
* schemaparse.c
*/
-void parse_oc_old LDAP_P(( Backend *be, char *fname, int lineno, int argc, char **argv ));
-void parse_oc LDAP_P(( char *fname, int lineno, char *line, char **argv ));
-void parse_at LDAP_P(( char *fname, int lineno, char *line, char **argv ));
-void parse_oidm LDAP_P(( char *fname, int lineno, int argc, char **argv ));
+void parse_oc_old LDAP_P(( Backend *be, const char *fname, int lineno, int argc, char **argv ));
+void parse_oc LDAP_P(( const char *fname, int lineno, char *line, char **argv ));
+void parse_at LDAP_P(( const char *fname, int lineno, char *line, char **argv ));
+void parse_oidm LDAP_P(( const char *fname, int lineno, int argc, char **argv ));
char *scherr2str LDAP_P((int code));
-int dscompare LDAP_P(( char *s1, char *s2del, char delim ));
+int dscompare LDAP_P(( const char *s1, const char *s2del, char delim ));
/*
* str2filter.c
*/
* user.c
*/
#if defined(HAVE_PWD_H) && defined(HAVE_GRP_H)
-void slap_init_user LDAP_P(( char *username, char *groupname ));
+void slap_init_user LDAP_P(( const char *username, const char *groupname ));
#endif
/*
Connection *conn,
Operation *op,
ber_int_t err,
- char *text
+ const char *text
)
{
ber_tag_t tag;
Connection *conn,
Operation *op,
ber_int_t err,
- char *matched,
- char *text,
+ const char *matched,
+ const char *text,
struct berval **ref,
LDAPControl **ctrls
)
Connection *conn,
Operation *op,
ber_int_t err,
- char *matched,
- char *text,
+ const char *matched,
+ const char *text,
struct berval **refs,
LDAPControl **ctrls,
int nentries
* check to see if attribute is 'operational' or not.
*/
int
-oc_check_operational_attr( char *type )
+oc_check_operational_attr( const char *type )
{
return charray_inlist( oc_operational_attrs, type )
|| charray_inlist( oc_usermod_attrs, type )
* check to see if attribute can be user modified or not.
*/
int
-oc_check_usermod_attr( char *type )
+oc_check_usermod_attr( const char *type )
{
return charray_inlist( oc_usermod_attrs, type );
}
* check to see if attribute is 'no user modification' or not.
*/
int
-oc_check_no_usermod_attr( char *type )
+oc_check_no_usermod_attr( const char *type )
{
return charray_inlist( oc_no_usermod_attrs, type );
}
Syntax *synp;
for (synp = syn_list; synp; synp = synp->ssyn_next)
- if ((*len = dscompare( synp->ssyn_syn.syn_desc, (char *)syndesc, '{')))
+ if ((*len = dscompare( synp->ssyn_syn.syn_desc, syndesc, '{')))
return synp;
return( NULL );
}
int is_entry_objectclass(
Entry* e,
- char* oc)
+ const char* oc)
{
Attribute *attr;
struct berval bv;
return 0;
}
- bv.bv_val = oc;
+ bv.bv_val = (char *) oc;
bv.bv_len = strlen( bv.bv_val );
if( value_find(attr->a_vals, &bv, attr->a_syntax, 1) != 0) {
void
parse_oc_old(
Backend *be,
- char *fname,
+ const char *fname,
int lineno,
int argc,
char **argv
* matched, otherwise return length matched.
*/
int
-dscompare(char *s1, char *s2, char delim)
+dscompare(const char *s1, const char *s2, char delim)
{
- char *orig = s1;
+ const char *orig = s1;
while (*s1++ == *s2++)
if (!s1[-1]) break;
--s1;
void
parse_oidm(
- char *fname,
+ const char *fname,
int lineno,
int argc,
char **argv
void
parse_oc(
- char *fname,
+ const char *fname,
int lineno,
char *line,
char **argv
void
parse_at(
- char *fname,
+ const char *fname,
int lineno,
char *line,
char **argv
*/
int (*bi_init) LDAP_P((BackendInfo *bi));
int (*bi_config) LDAP_P((BackendInfo *bi,
- char *fname, int lineno, int argc, char **argv ));
+ const char *fname, int lineno, int argc, char **argv ));
int (*bi_open) LDAP_P((BackendInfo *bi));
int (*bi_close) LDAP_P((BackendInfo *bi));
int (*bi_destroy) LDAP_P((BackendInfo *bi));
*/
int (*bi_db_init) LDAP_P((Backend *bd));
int (*bi_db_config) LDAP_P((Backend *bd,
- char *fname, int lineno, int argc, char **argv ));
+ const char *fname, int lineno, int argc, char **argv ));
int (*bi_db_open) LDAP_P((Backend *bd));
int (*bi_db_close) LDAP_P((Backend *bd));
int (*bi_db_destroy) LDAP_P((Backend *db));
int (*bi_entry_release_rw) LDAP_P((BackendDB *bd, Entry *e, int rw));
int (*bi_acl_group) LDAP_P((Backend *bd,
- Entry *e, char *bdn, char *edn,
- char *objectclassValue, char *groupattrName ));
+ Entry *e, const char *bdn, const char *edn,
+ const char *objectclassValue, const char *groupattrName ));
int (*bi_connection_init) LDAP_P((BackendDB *bd,
struct slap_conn *c));
Connection *conn,
Operation *op,
ber_int_t err,
- char *text
+ const char *text
)
{
assert(0);
Connection *conn,
Operation *op,
int err,
- char *matched,
- char *text,
+ const char *matched,
+ const char *text,
struct berval **refs,
LDAPControl **ctrls
)
Connection *conn,
Operation *op,
int err,
- char *matched,
- char *text,
+ const char *matched,
+ const char *text,
struct berval **refs,
LDAPControl **ctrls,
int nentries