Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 318201 Details for
Bug 454030
Need to address 64-bit compiler warnings
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
diffs - part 1
cvsdiffs (text/plain), 179.82 KB, created by
Rich Megginson
on 2008-10-01 14:22:57 UTC
(
hide
)
Description:
diffs - part 1
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2008-10-01 14:22:57 UTC
Size:
179.82 KB
patch
obsolete
>Index: ldapserver/include/i18n.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/include/i18n.h,v >retrieving revision 1.6 >diff -u -8 -r1.6 i18n.h >--- ldapserver/include/i18n.h 10 Nov 2006 23:44:24 -0000 1.6 >+++ ldapserver/include/i18n.h 1 Oct 2008 13:15:45 -0000 >@@ -106,21 +106,21 @@ > * 3,"The value of PI is about 3.1415926536." > * > * RESOURCE_STR is used by makstrdb.c only. It is not used by getstrdb.c or > * in library or application source code. > */ > > #ifdef RESOURCE_STR > #define BEGIN_STR(argLibraryName) \ >- RESOURCE_TABLE argLibraryName[] = { 0, #argLibraryName, >+ RESOURCE_TABLE argLibraryName[] = { {0, #argLibraryName}, > #define ResDef(argToken,argID,argString) \ >- argID, argString, >+ {argID, argString}, > #define END_STR(argLibraryName) \ >- 0, 0 }; >+ {0, 0} }; > #else > #define BEGIN_STR(argLibraryName) \ > enum { > #define ResDef(argToken,argID,argString) \ > argToken = argID, > #define END_STR(argLibraryName) \ > argLibraryName ## top }; > #endif >Index: ldapserver/include/ldaputil/certmap.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/include/ldaputil/certmap.h,v >retrieving revision 1.5 >diff -u -8 -r1.5 certmap.h >--- ldapserver/include/ldaputil/certmap.h 10 Nov 2006 23:44:25 -0000 1.5 >+++ ldapserver/include/ldaputil/certmap.h 1 Oct 2008 13:15:45 -0000 >@@ -56,27 +56,30 @@ > LDAPU_STR_FILTER_MEMBER, > LDAPU_STR_FILTER_MEMBER_RECURSE, > LDAPU_STR_ATTR_USER, > LDAPU_STR_ATTR_CERT, > LDAPU_STR_ATTR_CERT_NOSUBTYPE, > LDAPU_STR_MAX_INDEX > }; > >+#ifdef DEFINE_LDAPU_STRINGS >+/* used only in certmap.c and ldaputil.c */ > static char *ldapu_strings[] = { > "objectclass=*", /* LDAPU_STR_DEFAULT */ > "uid=%s", /* LDAPU_STR_FILTER_USER */ > "(& (cn=%s) (| (objectclass=groupofuniquenames) (objectclass=groupofnames)))", /* LDAPU_STR_FILTER_GROUP */ > "(| (uniquemember=%s) (member=%s))", /* LDAPU_STR_FILTER_MEMBER */ > "(& %s (| (objectclass=groupofuniquenames) (objectclass=groupofnames))", /* LDAPU_STR_FILTER_MEMBER_RECURSE */ > "uid", /* LDAPU_STR_ATTR_USER */ > "userCertificate;binary", /* LDAPU_STR_ATTR_CERT */ > "userCertificate" /* LDAPU_STR_ATTR_CERT_NOSUBTYPE */ > }; >- >+#endif /* DEFINE_LDAPU_STRINGS */ >+ > typedef struct { > char *str; > int size; > int len; > } LDAPUStr_t; > > #ifdef __cplusplus > extern "C" { >Index: ldapserver/ldap/servers/plugins/acl/aclparse.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/aclparse.c,v >retrieving revision 1.11 >diff -u -8 -r1.11 aclparse.c >--- ldapserver/ldap/servers/plugins/acl/aclparse.c 24 Oct 2007 18:41:15 -0000 1.11 >+++ ldapserver/ldap/servers/plugins/acl/aclparse.c 1 Oct 2008 13:15:46 -0000 >@@ -931,18 +931,18 @@ > ruleType = ACI_DNS_RULE; > ruleLen = strlen ( ACL_ATTR_DNS) ; > } > /* Here, we've found a space...if we were in in_dn_expr mode > * and we'vve found a closure for that ie.a '"' or a ')' > * eg. "'ldap:///all"' or 'ldap:///all")' then exit in_dn_expr mode. > */ > if ( in_dn_expr && (word[len-1] == '"' || >- len>1 && word[len-2] == '"' || >- len>2 && word[len-3] == '"')) { >+ (len>1 && word[len-2] == '"') || >+ (len>2 && word[len-3] == '"')) ) { > in_dn_expr = 0; > } > > /* > * ruleStart may be NULL as word could be (all) for example. > * this word will just be skipped--we're really waiting for > * userdn or groupdn or... > */ >@@ -1687,29 +1687,29 @@ > if (strcmp(str, "add") == 0) { > aci->aci_type |= ACI_TARGET_ATTR_ADD_FILTERS; > addlistptr = s; > > /* Now isolate the first filter list. */ > if ((str = strstr(s , "del=")) || ((str = strstr(s , "del ="))) ) { > str--; > *str = '\0'; >- *str++; >+ str++; > } > > > } else if (strcmp(str, "del") == 0) { > aci->aci_type |= ACI_TARGET_ATTR_DEL_FILTERS; > dellistptr = s; > > /* Now isolate the first filter list. */ > if ((str = strstr(s , "add=")) || ((str = strstr(s , "add ="))) ) { > str--; > *str = '\0'; >- *str++; >+ str++; > } > } else { > return(ACL_SYNTAX_ERR); > } > > __acl_strip_trailing_space(s); > > /* >Index: ldapserver/ldap/servers/plugins/acl/aclutil.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/aclutil.c,v >retrieving revision 1.8 >diff -u -8 -r1.8 aclutil.c >--- ldapserver/ldap/servers/plugins/acl/aclutil.c 18 Oct 2007 00:08:27 -0000 1.8 >+++ ldapserver/ldap/servers/plugins/acl/aclutil.c 1 Oct 2008 13:15:47 -0000 >@@ -1323,38 +1323,39 @@ > * Add the key adn value to the ht. > * If it already exists then remove the old one and free > * the value. > */ > void acl_ht_add_and_freeOld(acl_ht_t * acl_ht, > PLHashNumber key, > char *value){ > char *old_value = NULL; >+ uintptr_t pkey = (uintptr_t)key; > > if ( (old_value = (char *)acl_ht_lookup( acl_ht, key)) != NULL ) { > acl_ht_remove( acl_ht, key); > slapi_ch_free((void **)&old_value); > } > >- PL_HashTableAdd( acl_ht, (const void *)key, value); >+ PL_HashTableAdd( acl_ht, (const void *)pkey, value); > } > > /* > * Return a new acl_ht_t * > */ > acl_ht_t *acl_ht_new(void) { > > return(PL_NewHashTable(30, acl_ht_hash, /* key hasher */ > PL_CompareValues, /* keyCompare */ > PL_CompareStrings, 0, 0)); /* value compare */ > } > > static PLHashNumber acl_ht_hash( const void *key) { > >- return( (PLHashNumber)key ); >+ return( (PLHashNumber)((uintptr_t)key) ); > } > > /* Free all the values in the ht */ > void acl_ht_free_all_entries_and_values( acl_ht_t *acl_ht) { > > PL_HashTableEnumerateEntries( acl_ht, acl_ht_free_entry_and_value, > NULL); > } >@@ -1392,23 +1393,23 @@ > return HT_ENUMERATE_NEXT; > > } > #endif > > /* remove this entry from the ht--doesn't free the value.*/ > void acl_ht_remove( acl_ht_t *acl_ht, PLHashNumber key) { > >- PL_HashTableRemove( acl_ht, (const void *)key); >+ PL_HashTableRemove( acl_ht, (const void *)((uintptr_t)key) ); > } > > /* Retrieve a pointer to the value of the entry with key */ > void *acl_ht_lookup( acl_ht_t *acl_ht, > PLHashNumber key) { > >- return( PL_HashTableLookup( acl_ht, (const void *)key) ); >+ return( PL_HashTableLookup( acl_ht, (const void *)((uintptr_t)key)) ); > } > > > /***************************************************************************/ > /* E N D */ > /***************************************************************************/ > >Index: ldapserver/ldap/servers/plugins/chainingdb/cb_instance.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/chainingdb/cb_instance.c,v >retrieving revision 1.9 >diff -u -8 -r1.9 cb_instance.c >--- ldapserver/ldap/servers/plugins/chainingdb/cb_instance.c 27 Jun 2008 19:28:22 -0000 1.9 >+++ ldapserver/ldap/servers/plugins/chainingdb/cb_instance.c 1 Oct 2008 13:15:47 -0000 >@@ -898,176 +898,176 @@ > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return rc; > } > > static void *cb_instance_sizelimit_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->sizelimit; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_sizelimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->sizelimit=(int) value; >+ inst->sizelimit=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > if (inst->inst_be) >- be_set_sizelimit(inst->inst_be, (int) value); >+ be_set_sizelimit(inst->inst_be, (int) ((uintptr_t)value)); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_timelimit_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->timelimit; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_timelimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->timelimit=(int) value; >+ inst->timelimit=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > if (inst->inst_be) >- be_set_timelimit(inst->inst_be, (int) value); >+ be_set_timelimit(inst->inst_be, (int) ((uintptr_t)value)); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_max_test_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->max_test_time; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_max_test_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->max_test_time=(int) value; >+ inst->max_test_time=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_max_idle_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->max_idle_time; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_max_idle_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->max_idle_time=(int) value; >+ inst->max_idle_time=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > > static void *cb_instance_hoplimit_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->hoplimit; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_hoplimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->hoplimit=(int) value; >+ inst->hoplimit=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_maxbconn_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->bind_pool->conn.maxconnections; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_maxbconn_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->bind_pool->conn.maxconnections=(int) value; >+ inst->bind_pool->conn.maxconnections=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_maxconn_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->pool->conn.maxconnections; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_maxconn_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->pool->conn.maxconnections=(int) value; >+ inst->pool->conn.maxconnections=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_abandonto_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->abandon_timeout.tv_sec; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_abandonto_set(void *arg, void *value, char *errorbuf, int phase, int apply) >@@ -1079,207 +1079,207 @@ > ( phase != CB_CONFIG_PHASE_STARTUP )) { > > /* Dynamic modif not supported */ > /* Stored in ldif only */ > return LDAP_SUCCESS; > } > > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->abandon_timeout.tv_sec=(int) value; >+ inst->abandon_timeout.tv_sec=(int) ((uintptr_t)value); > inst->abandon_timeout.tv_usec=0; > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_maxbconc_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->bind_pool->conn.maxconcurrency; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_maxbconc_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->bind_pool->conn.maxconcurrency=(int) value; >+ inst->bind_pool->conn.maxconcurrency=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_maxconc_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->pool->conn.maxconcurrency; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_maxconc_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->pool->conn.maxconcurrency=(int) value; >+ inst->pool->conn.maxconcurrency=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_imperson_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data = inst->impersonate; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_imperson_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > int rc=LDAP_SUCCESS; > > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->impersonate=(int) value; >+ inst->impersonate=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } else { > /* Security check: Make sure the proxing user is */ > /* not the directory manager. */ > > char * rootdn=cb_get_rootdn(); > > PR_RWLock_Rlock(inst->rwl_config_lock); >- if (((int) value) && inst->pool && inst->pool->binddn && >+ if (((int) ((uintptr_t)value)) && inst->pool && inst->pool->binddn && > !strcmp(inst->pool->binddn,rootdn)) { /* UTF-8 aware */ > rc=LDAP_UNWILLING_TO_PERFORM; > if (errorbuf) > PR_snprintf(errorbuf,SLAPI_DSE_RETURNTEXT_SIZE, "Proxy mode incompatible with %s value (%s not allowed)", > CB_CONFIG_BINDUSER,rootdn); > } > PR_RWLock_Unlock(inst->rwl_config_lock); > slapi_ch_free((void **)&rootdn); > } > > return rc; > } > > static void *cb_instance_connlife_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data=inst->pool->conn.connlifetime; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_connlife_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->pool->conn.connlifetime=(int) value; >+ inst->pool->conn.connlifetime=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_bindto_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data=inst->bind_pool->conn.op_timeout.tv_sec; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_bindto_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->bind_pool->conn.op_timeout.tv_sec=(int) value; >+ inst->bind_pool->conn.op_timeout.tv_sec=(int) ((uintptr_t)value); > inst->bind_pool->conn.op_timeout.tv_usec=0; >- inst->bind_pool->conn.bind_timeout.tv_sec=(int) value; >+ inst->bind_pool->conn.bind_timeout.tv_sec=(int) ((uintptr_t)value); > inst->bind_pool->conn.bind_timeout.tv_usec=0; > /* Used to bind to the farm server */ >- inst->pool->conn.bind_timeout.tv_sec=(int) value; >+ inst->pool->conn.bind_timeout.tv_sec=(int) ((uintptr_t)value); > inst->pool->conn.bind_timeout.tv_usec=0; > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_opto_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data=inst->pool->conn.op_timeout.tv_sec; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_opto_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->pool->conn.op_timeout.tv_sec=(int) value; >+ inst->pool->conn.op_timeout.tv_sec=(int) ((uintptr_t)value); > inst->pool->conn.op_timeout.tv_usec=0; > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_ref_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data=inst->searchreferral; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_ref_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->searchreferral=(int) value; >+ inst->searchreferral=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_acl_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data=inst->local_acl; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_acl_set(void *arg, void *value, char *errorbuf, int phase, int apply) >@@ -1290,39 +1290,39 @@ > if (( phase != CB_CONFIG_PHASE_INITIALIZATION ) && > ( phase != CB_CONFIG_PHASE_STARTUP )) { > > /* Dynamic modif not supported */ > /* Stored in ldif only */ > return LDAP_SUCCESS; > } > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->local_acl=(int) value; >+ inst->local_acl=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > static void *cb_instance_bindretry_get(void *arg) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; >- int data; >+ uintptr_t data; > > PR_RWLock_Rlock(inst->rwl_config_lock); > data=inst->bind_retry; > PR_RWLock_Unlock(inst->rwl_config_lock); > return (void *) data; > } > > static int cb_instance_bindretry_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > cb_backend_instance * inst=(cb_backend_instance *) arg; > if (apply) { > PR_RWLock_Wlock(inst->rwl_config_lock); >- inst->bind_retry=(int) value; >+ inst->bind_retry=(int) ((uintptr_t)value); > PR_RWLock_Unlock(inst->rwl_config_lock); > } > return LDAP_SUCCESS; > } > > > > >@@ -1378,25 +1378,25 @@ > > switch(config->config_type) { > case CB_CONFIG_TYPE_INT: > if (use_default) { > int_val = cb_atoi(config->config_default_value); > } else { > int_val = cb_atoi((char *)bval->bv_val); > } >- retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); >+ retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); > break; > case CB_CONFIG_TYPE_INT_OCTAL: > if (use_default) { > int_val = (int) strtol(config->config_default_value, NULL, 8); > } else { > int_val = (int) strtol((char *)bval->bv_val, NULL, 8); > } >- retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); >+ retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); > break; > case CB_CONFIG_TYPE_LONG: > if (use_default) { > long_val = cb_atol(config->config_default_value); > } else { > long_val = cb_atol((char *)bval->bv_val); > } > retval = config->config_set_fn(arg, (void *) long_val, err_buf, phase, apply_mod); >@@ -1409,17 +1409,17 @@ > } > break; > case CB_CONFIG_TYPE_ONOFF: > if (use_default) { > int_val = !strcasecmp(config->config_default_value, "on"); > } else { > int_val = !strcasecmp((char *) bval->bv_val, "on"); > } >- retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); >+ retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); > break; > } > return retval; > } > > /* Utility function used in creating config entries. Using the > * config_info, this function gets info and formats in the correct > * way. >@@ -1430,33 +1430,33 @@ > char *tmp_string; > > if (config == NULL) { > buf[0] = '\0'; > } > > switch(config->config_type) { > case CB_CONFIG_TYPE_INT: >- sprintf(buf, "%d", (int) config->config_get_fn(arg)); >+ sprintf(buf, "%d", (int) ((uintptr_t)config->config_get_fn(arg))); > break; > case CB_CONFIG_TYPE_INT_OCTAL: >- sprintf(buf, "%o", (int) config->config_get_fn(arg)); >+ sprintf(buf, "%o", (int) ((uintptr_t)config->config_get_fn(arg))); > break; > case CB_CONFIG_TYPE_LONG: > sprintf(buf, "%ld", (long) config->config_get_fn(arg)); > break; > case CB_CONFIG_TYPE_STRING: > /* Remember the get function for strings returns memory > * that must be freed. */ > tmp_string = (char *) config->config_get_fn(arg); > PR_snprintf(buf, CB_BUFSIZE, "%s", (char *) tmp_string); > slapi_ch_free((void **)&tmp_string); > break; > case CB_CONFIG_TYPE_ONOFF: >- if ((int) config->config_get_fn(arg)) { >+ if ((int) ((uintptr_t)config->config_get_fn(arg))) { > sprintf(buf,"%s","on"); > } else { > sprintf(buf,"%s","off"); > } > break; > default: > slapi_log_error( SLAPI_LOG_PLUGIN, CB_PLUGIN_SUBSYSTEM, > "Invalid attribute syntax.\n"); >Index: ldapserver/ldap/servers/plugins/dna/dna.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/dna/dna.c,v >retrieving revision 1.9 >diff -u -8 -r1.9 dna.c >--- ldapserver/ldap/servers/plugins/dna/dna.c 24 Sep 2008 21:21:51 -0000 1.9 >+++ ldapserver/ldap/servers/plugins/dna/dna.c 1 Oct 2008 13:15:48 -0000 >@@ -50,16 +50,23 @@ > #include "portable.h" > #include "nspr.h" > #include "slapi-private.h" > #include "dirlite_strings.h" > #include "dirver.h" > #include "prclist.h" > #include "ldif.h" > >+/* Required to get portable printf/scanf format macros */ >+#ifdef HAVE_INTTYPES_H >+#include <inttypes.h> >+#else >+#error Need to define portable format macros such as PRIu64 >+#endif /* HAVE_INTTYPES_H */ >+ > /* get file mode flags for unix */ > #ifndef _WIN32 > #include <sys/stat.h> > #endif > > #define DNA_PLUGIN_SUBSYSTEM "dna-plugin" > #define DNA_PLUGIN_VERSION 0x00020000 > >@@ -669,17 +676,17 @@ > value = slapi_entry_attr_get_charptr(e, DNA_NEXTVAL); > if (value) { > entry->nextval = strtoull(value, 0, 0); > slapi_ch_free_string(&value); > } else > goto bail; > > slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, >- "----------> %s [%llu]\n", DNA_NEXTVAL, entry->nextval, 0, >+ "----------> %s [" PRIu64 "]\n", DNA_NEXTVAL, entry->nextval, 0, > 0); > > value = slapi_entry_attr_get_charptr(e, DNA_PREFIX); > if (value && value[0]) { > entry->prefix = value; > } else { > /* TODO - If a prefix is not defined, then we need to ensure > * that the proper matching rule is in place for this >@@ -698,17 +705,17 @@ > value = slapi_entry_attr_get_charptr(e, DNA_INTERVAL); > if (value) { > entry->interval = strtoull(value, 0, 0); > slapi_ch_free_string(&value); > } else > goto bail; > > slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, >- "----------> %s [%llu]\n", DNA_INTERVAL, entry->interval, 0, 0); >+ "----------> %s [" PRIu64 "]\n", DNA_INTERVAL, entry->interval, 0, 0); > #endif > > value = slapi_entry_attr_get_charptr(e, DNA_GENERATE); > if (value) { > entry->generate = value; > } > > slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, >@@ -741,17 +748,17 @@ > > /* optional, if not specified set -1 which is converted to the max unisgnee > * value */ > value = slapi_entry_attr_get_charptr(e, DNA_MAXVAL); > if (value) { > entry->maxval = strtoull(value, 0, 0); > > slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, >- "----------> %s [%llu]\n", DNA_MAXVAL, value, 0, 0); >+ "----------> %s [" PRIu64 "]\n", DNA_MAXVAL, value, 0, 0); > > slapi_ch_free_string(&value); > } else { > entry->maxval = -1; > } > > value = slapi_entry_attr_get_charptr(e, DNA_SHARED_CFG_DN); > if (value) { >@@ -791,29 +798,29 @@ > entry->shared_cfg_base, 0, 0); > } > > value = slapi_entry_attr_get_charptr(e, DNA_THRESHOLD); > if (value) { > entry->threshold = strtoull(value, 0, 0); > > slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, >- "----------> %s [%llu]\n", DNA_THRESHOLD, value, 0, 0); >+ "----------> %s [" PRIu64 "]\n", DNA_THRESHOLD, value, 0, 0); > > slapi_ch_free_string(&value); > } else { > entry->threshold = 1; > } > > value = slapi_entry_attr_get_charptr(e, DNA_RANGE_REQUEST_TIMEOUT); > if (value) { > entry->timeout = strtoull(value, 0, 0); > > slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, >- "----------> %s [%llu]\n", DNA_RANGE_REQUEST_TIMEOUT, >+ "----------> %s [" PRIu64 "]\n", DNA_RANGE_REQUEST_TIMEOUT, > value, 0, 0); > > slapi_ch_free_string(&value); > } else { > entry->timeout = DNA_DEFAULT_TIMEOUT; > } > > value = slapi_entry_attr_get_charptr(e, DNA_NEXT_RANGE); >@@ -1220,18 +1227,18 @@ > /* update the shared configuration */ > dna_update_shared_config(config_entry); > } > > /* Check if we passed the threshold and try to fix maxval if so. We > * don't need to do this if we already have a next range on deck. */ > if ((config_entry->next_range_lower == 0) && (config_entry->remaining <= config_entry->threshold)) { > slapi_log_error(SLAPI_LOG_FATAL, DNA_PLUGIN_SUBSYSTEM, >- "dna_notice_allocation: Passed threshold of %llu remaining values " >- "for range %s. (%llu values remain)\n", >+ "dna_notice_allocation: Passed threshold of " PRIu64 " remaining values " >+ "for range %s. (" PRIu64 " values remain)\n", > config_entry->threshold, config_entry->dn, config_entry->remaining); > /* Only attempt to fix maxval if the fix flag is set. */ > if (fix != 0) { > dna_fix_maxval(config_entry); > } > } > > return; >@@ -1362,23 +1369,21 @@ > * Returns 0 on success and will fill in upper > * and lower. Returns non-0 on failure and will > * zero out upper and lower. > */ > static int dna_request_range(struct configEntry *config_entry, > struct dnaServer *server, > PRUint64 *lower, PRUint64 *upper) > { >- Slapi_DN *agmt_sdn = NULL; > char *bind_dn = NULL; > char *bind_passwd = NULL; > char *bind_method = NULL; > int is_ssl = 0; > int is_client_auth = 0; >- int replport = 0; > struct berval *request = NULL; > char *retoid = NULL; > struct berval *responsedata = NULL; > BerElement *respber = NULL; > LDAP *ld = NULL; > char *lower_str = NULL; > char *upper_str = NULL; > int set_extend_flag = 0; >@@ -1668,35 +1673,35 @@ > attrs[1] = NULL; > > /* We don't sort if we're using a prefix (non integer type). Instead, > * we just search to see if the next value is free, and keep incrementing > * until we find the next free value. */ > if (prefix) { > /* The 7 below is for all of the filter characters "(&(=))" > * plus the trailing \0. The 20 is for the maximum string >- * representation of a %llu. */ >+ * representation of a " PRIu64 ". */ > filterlen = strlen(config_entry->filter) + > strlen(prefix) + strlen(type) > + 7 + 20; > filter = slapi_ch_malloc(filterlen); >- snprintf(filter, filterlen, "(&%s(%s=%s%llu))", >+ snprintf(filter, filterlen, "(&%s(%s=%s%" PRIu64 "))", > config_entry->filter, type, prefix, tmpval); > } else { > ctrls = (LDAPControl **)slapi_ch_calloc(2, sizeof(LDAPControl)); > if (NULL == ctrls) > return LDAP_OPERATIONS_ERROR; > > ctrls[0] = dna_build_sort_control(config_entry->type); > if (NULL == ctrls[0]) { > slapi_ch_free((void **)&ctrls); > return LDAP_OPERATIONS_ERROR; > } > >- filter = slapi_ch_smprintf("(&%s(&(%s>=%llu)(%s<=%llu)))", >+ filter = slapi_ch_smprintf("(&%s(&(%s>=%" PRIu64 ")(%s<=%" PRIu64 ")))", > config_entry->filter, > type, tmpval, > type, config_entry->maxval); > } > > if (NULL == filter) { > ldap_controls_free(ctrls); > ctrls = NULL; >@@ -1737,17 +1742,17 @@ > /* The next value identified in the config entry has already > * been taken. We just iterate through the values until we > * (hopefully) find a free one. */ > for (tmpval += config_entry->interval; tmpval <= config_entry->maxval; > tmpval += config_entry->interval) { > /* filter is guaranteed to be big enough since we allocated > * enough space to fit a string representation of any unsigned > * 64-bit integer */ >- snprintf(filter, filterlen, "(&%s(%s=%s%llu))", >+ snprintf(filter, filterlen, "(&%s(%s=%s%" PRIu64 "))", > config_entry->filter, type, prefix, tmpval); > > /* clear out the pblock so we can re-use it */ > slapi_free_search_results_internal(pb); > slapi_pblock_init(pb); > > slapi_search_internal_set_pb(pb, config_entry->scope, > LDAP_SCOPE_SUBTREE, filter, >@@ -1869,17 +1874,17 @@ > } > } > > nextval = setval + config_entry->interval; > /* update nextval if we have not reached the end > * of our current range */ > if (nextval <= (config_entry->maxval + config_entry->interval)) { > /* try to set the new next value in the config entry */ >- snprintf(next_value, sizeof(next_value),"%llu", nextval); >+ snprintf(next_value, sizeof(next_value),"%" PRIu64, nextval); > > /* set up our replace modify operation */ > replace_val[0] = next_value; > replace_val[1] = 0; > mod_replace.mod_op = LDAP_MOD_REPLACE; > mod_replace.mod_type = DNA_NEXTVAL; > mod_replace.mod_values = replace_val; > mods[0] = &mod_replace; >@@ -1899,17 +1904,17 @@ > slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &ret); > > slapi_pblock_destroy(pb); > pb = NULL; > } > > if (LDAP_SUCCESS == ret) { > slapi_ch_free_string(next_value_ret); >- *next_value_ret = slapi_ch_smprintf("%llu", setval); >+ *next_value_ret = slapi_ch_smprintf("%" PRIu64, setval); > if (NULL == *next_value_ret) { > ret = LDAP_OPERATIONS_ERROR; > goto done; > } > > /* update our cached config */ > dna_notice_allocation(config_entry, nextval, setval, 1); > } >@@ -1946,17 +1951,17 @@ > LDAPMod mod_replace; > LDAPMod *mods[2]; > char *replace_val[2]; > /* 16 for max 64-bit unsigned plus the trailing '\0' */ > char remaining_vals[17]; > > /* We store the number of remaining assigned values > * in the shared config entry. */ >- snprintf(remaining_vals, sizeof(remaining_vals),"%llu", config_entry->remaining); >+ snprintf(remaining_vals, sizeof(remaining_vals),"%" PRIu64, config_entry->remaining); > > /* set up our replace modify operation */ > replace_val[0] = remaining_vals; > replace_val[1] = 0; > mod_replace.mod_op = LDAP_MOD_REPLACE; > mod_replace.mod_type = DNA_REMAINING; > mod_replace.mod_values = replace_val; > mods[0] = &mod_replace; >@@ -2031,17 +2036,17 @@ > LDAPMod mod_replace; > LDAPMod *mods[2]; > char *replace_val[2]; > /* 32 for the two numbers, 1 for the '-', and one for the '\0' */ > char nextrange_value[34]; > int ret = 0; > > /* Try to set the new next range in the config entry. */ >- snprintf(nextrange_value, sizeof(nextrange_value), "%llu-%llu", >+ snprintf(nextrange_value, sizeof(nextrange_value), "%" PRIu64 "-%" PRIu64, > lower, upper); > > /* set up our replace modify operation */ > replace_val[0] = nextrange_value; > replace_val[1] = 0; > mod_replace.mod_op = LDAP_MOD_REPLACE; > mod_replace.mod_type = DNA_NEXT_RANGE; > mod_replace.mod_values = replace_val; >@@ -2100,18 +2105,18 @@ > char *nextval_vals[2]; > char *nextrange_vals[1]; > /* 16 for max 64-bit unsigned plus the trailing '\0' */ > char maxval_val[17]; > char nextval_val[17]; > int ret = 0; > > /* Setup the modify operation for the config entry */ >- snprintf(maxval_val, sizeof(maxval_val),"%llu", config_entry->next_range_upper); >- snprintf(nextval_val, sizeof(nextval_val),"%llu", config_entry->next_range_lower); >+ snprintf(maxval_val, sizeof(maxval_val),"%" PRIu64, config_entry->next_range_upper); >+ snprintf(nextval_val, sizeof(nextval_val),"%" PRIu64, config_entry->next_range_lower); > > maxval_vals[0] = maxval_val; > maxval_vals[1] = 0; > nextval_vals[0] = nextval_val; > nextval_vals[1] = 0; > nextrange_vals[0] = 0; > > mod_maxval.mod_op = LDAP_MOD_REPLACE; >@@ -2693,18 +2698,18 @@ > BerElement *respber = NULL; > struct berval *respdata = NULL; > struct berval range_low = {0, NULL}; > struct berval range_high = {0, NULL}; > char lowstr[16]; > char highstr[16]; > > /* Create the exop response */ >- snprintf(lowstr, sizeof(lowstr), "%llu", lower); >- snprintf(highstr, sizeof(highstr), "%llu", upper); >+ snprintf(lowstr, sizeof(lowstr), "%" PRIu64, lower); >+ snprintf(highstr, sizeof(highstr), "%" PRIu64, upper); > range_low.bv_val = lowstr; > range_low.bv_len = strlen(range_low.bv_val); > range_high.bv_val = highstr; > range_high.bv_len = strlen(range_high.bv_val); > > if ((respber = ber_alloc()) == NULL) { > ret = LDAP_NO_MEMORY; > goto free_and_return; >@@ -2722,22 +2727,22 @@ > > ber_flatten(respber, &respdata); > ber_free(respber, 1); > > slapi_pblock_set(pb, SLAPI_EXT_OP_RET_OID, DNA_EXTEND_EXOP_RESPONSE_OID); > slapi_pblock_set(pb, SLAPI_EXT_OP_RET_VALUE, respdata); > > /* send the response ourselves */ >- send_ldap_result( pb, ret, NULL, NULL, 0, NULL ); >+ slapi_send_ldap_result( pb, ret, NULL, NULL, 0, NULL ); > ret = SLAPI_PLUGIN_EXTENDED_SENT_RESULT; > ber_bvfree(respdata); > > slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, >- "dna_extend_exop: Released range %llu-%llu.\n", >+ "dna_extend_exop: Released range " PRIu64 "-" PRIu64 ".\n", > lower, upper); > } > > free_and_return: > slapi_ch_free_string(&shared_dn); > slapi_ch_free_string(&bind_dn); > if (NULL != tmp_bere) { > ber_free(tmp_bere, 1); >@@ -2869,17 +2874,17 @@ > goto bail; > } > > /* We give away values from the upper end of our range. */ > *upper = config_entry->maxval; > *lower = *upper - release + 1; > > /* try to set the new maxval in the config entry */ >- snprintf(max_value, sizeof(max_value),"%llu", (*lower - 1)); >+ snprintf(max_value, sizeof(max_value),"%" PRIu64, (*lower - 1)); > > /* set up our replace modify operation */ > replace_val[0] = max_value; > replace_val[1] = 0; > mod_replace.mod_op = LDAP_MOD_REPLACE; > mod_replace.mod_type = DNA_MAXVAL; > mod_replace.mod_values = replace_val; > mods[0] = &mod_replace; >@@ -2968,16 +2973,16 @@ > > > void dna_dump_config_entry(struct configEntry * entry) > { > printf("<---- type -----------> %s\n", entry->type); > printf("<---- filter ---------> %s\n", entry->filter); > printf("<---- prefix ---------> %s\n", entry->prefix); > printf("<---- scope ----------> %s\n", entry->scope); >- printf("<---- next value -----> %llu\n", entry->nextval); >- printf("<---- max value ------> %llu\n", entry->maxval); >- printf("<---- interval -------> %llu\n", entry->interval); >+ printf("<---- next value -----> %" PRIu64 "\n", entry->nextval); >+ printf("<---- max value ------> %" PRIu64 "\n", entry->maxval); >+ printf("<---- interval -------> %" PRIu64 "\n", entry->interval); > printf("<---- generate flag --> %s\n", entry->generate); > printf("<---- shared cfg base > %s\n", entry->shared_cfg_base); > printf("<---- shared cfg DN --> %s\n", entry->shared_cfg_dn); >- printf("<---- threshold -----> %llu", entry->threshold); >+ printf("<---- threshold ------> %" PRIu64 "", entry->threshold); > } >Index: ldapserver/ldap/servers/plugins/pam_passthru/pam_ptimpl.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pam_passthru/pam_ptimpl.c,v >retrieving revision 1.11 >diff -u -8 -r1.11 pam_ptimpl.c >--- ldapserver/ldap/servers/plugins/pam_passthru/pam_ptimpl.c 18 Oct 2007 00:08:30 -0000 1.11 >+++ ldapserver/ldap/servers/plugins/pam_passthru/pam_ptimpl.c 1 Oct 2008 13:15:49 -0000 >@@ -172,17 +172,17 @@ > > /* > * This is the conversation function passed into pam_start(). This is what sets the password > * that PAM uses to authenticate. This function is sort of stupid - it assumes all echo off > * or binary prompts are for the password, and other prompts are for the username. Time will > * tell if this is actually the case. > */ > static int >-pam_conv_func(int num_msg, struct pam_message **msg, struct pam_response **resp, void *mydata) >+pam_conv_func(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *mydata) > { > int ii; > struct berval *creds; > struct my_pam_conv_str *my_data = (struct my_pam_conv_str *)mydata; > struct pam_response *reply; > int ret = PAM_SUCCESS; > > if (num_msg <= 0) { >Index: ldapserver/ldap/servers/plugins/passthru/ptconfig.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/passthru/ptconfig.c,v >retrieving revision 1.8 >diff -u -8 -r1.8 ptconfig.c >--- ldapserver/ldap/servers/plugins/passthru/ptconfig.c 14 Nov 2007 17:53:44 -0000 1.8 >+++ ldapserver/ldap/servers/plugins/passthru/ptconfig.c 1 Oct 2008 13:15:49 -0000 >@@ -97,17 +97,17 @@ > * for things like collisions between our suffixes and backend's suffixes. > * Returns an LDAP error code (LDAP_SUCCESS if all goes well). > * XXXmcs: this function leaks memory if any errors occur. > */ > int > passthru_config( int argc, char **argv ) > { > int i, j, rc, tosecs, using_def_connlifetime; >- char *p, **suffixarray; >+ char **suffixarray; > PassThruServer *prevsrvr, *srvr; > PassThruSuffix *suffix, *prevsuffix; > LDAPURLDesc *ludp; > > if ( inited ) { > slapi_log_error( SLAPI_LOG_FATAL, PASSTHRU_PLUGIN_SUBSYSTEM, > "only one pass through plugin instance can be used\n" ); > return( LDAP_PARAM_ERROR ); >@@ -139,17 +139,17 @@ > and commas (in suffixes), we have to search for the first space > after the last /, then look for any commas after that > This assumes the ldap url looks like this: > ldap(s)://host:port host:port .... host:port/suffixes > That is, it assumes there is always a trailing slash on the ldapurl > and that the url does not look like this: ldap://host > also assumes suffixes do not have any / in them > */ >- if (p = strrchr(srvr->ptsrvr_url, '/')) { /* look for last / */ >+ if ((p = strrchr(srvr->ptsrvr_url, '/'))) { /* look for last / */ > p = strchr(p, ' '); /* look for first space after last / */ > if (p) { > if (!strchr(p, ',')) { /* no comma */ > p = NULL; /* just use defaults */ > } > } > } > >Index: ldapserver/ldap/servers/plugins/presence/presence.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/presence/presence.c,v >retrieving revision 1.6 >diff -u -8 -r1.6 presence.c >--- ldapserver/ldap/servers/plugins/presence/presence.c 10 Nov 2006 23:45:09 -0000 1.6 >+++ ldapserver/ldap/servers/plugins/presence/presence.c 1 Oct 2008 13:15:49 -0000 >@@ -61,23 +61,17 @@ > > /* get file mode flags for unix */ > #ifndef _WIN32 > #include <sys/stat.h> > #endif > > /*** from proto-slap.h ***/ > >-int slapd_log_error_proc( char *subsystem, char *fmt, ... ) >-#ifdef __GNUC__ >- __attribute__ ((format (printf, 2, 3))); >-#else >- ; >-#endif >- >+int slapd_log_error_proc( char *subsystem, char *fmt, ... ); > > /*** from ldaplog.h ***/ > > /* edited ldaplog.h for LDAPDebug()*/ > #ifndef _LDAPLOG_H > #define _LDAPLOG_H > > #ifdef __cplusplus >@@ -341,17 +335,16 @@ > -------------- > This function registers the computed attribute evaluator > and loads the configuration parameters in the local cache. > It is called after presence_init. > */ > int presence_start( Slapi_PBlock *pb ) > { > char * plugindn = NULL; >- char * httpRootDir = NULL; > > LDAPDebug( LDAP_DEBUG_PLUGIN, "--> presence_start -- begin\n",0,0,0); > > if(slapi_apib_get_interface(HTTP_v1_0_GUID, &_HttpAPI)) > { > /** > * error cannot proceeed > */ >@@ -1100,17 +1093,16 @@ > > return status; > } > > static int setTypes(PLHashEntry *he, PRIntn i, void *arg) > { > int status; > int props = SLAPI_ATTR_FLAG_OPATTR; >- Slapi_Attr *attr = NULL; > Slapi_ValueSet *results = NULL; > int type_name_disposition = 0; > char *actual_type_name = 0; > int free_flags = 0; > > struct _vattrtypes *args = arg; > char *type = (char *)he->key; > _Vmap *map = (_Vmap *)he->value; >@@ -1145,17 +1137,16 @@ > Slapi_Value *val = NULL; > const struct berval *v = NULL; > > if ( LDAPDebugLevelIsSet( LDAP_DEBUG_PLUGIN )) { > slapi_attr_first_value(attr, &val); > v = slapi_value_get_berval(val); > if (v) { > char *ldifvalue; >- size_t attrnamelen = strlen( attrname ); > > LDAPDebug( LDAP_DEBUG_PLUGIN, "----------> %s size [%d] \n", > attrname,v->bv_len,0); > > ldifvalue = ldif_type_and_value_with_options( > (char *)attrname, /* XXX: had to cast away const */ > v->bv_val, v->bv_len, 0 ); > if ( NULL != ldifvalue ) { >Index: ldapserver/ldap/servers/plugins/pwdstorage/crypt_pwd.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/pwdstorage/crypt_pwd.c,v >retrieving revision 1.6 >diff -u -8 -r1.6 crypt_pwd.c >--- ldapserver/ldap/servers/plugins/pwdstorage/crypt_pwd.c 10 Nov 2006 23:45:10 -0000 1.6 >+++ ldapserver/ldap/servers/plugins/pwdstorage/crypt_pwd.c 1 Oct 2008 13:15:49 -0000 >@@ -48,17 +48,19 @@ > #include <stdio.h> > #include <string.h> > #include <sys/types.h> > #ifdef _WIN32 > char *crypt(char *key, char *salt); > #else > #include <sys/socket.h> > #if defined( hpux ) || defined ( AIX ) || defined (LINUX) || defined (OSF1) >+#ifndef __USE_XOPEN > #define __USE_XOPEN /* linux */ >+#endif /* __USE_XOPEN */ > #include <unistd.h> > #else /* hpux */ > #include <crypt.h> > #endif /* hpux */ > #endif /* _WIN32 */ > > #include "pwdstorage.h" > >Index: ldapserver/ldap/servers/plugins/replication/cl5_api.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_api.c,v >retrieving revision 1.21 >diff -u -8 -r1.21 cl5_api.c >--- ldapserver/ldap/servers/plugins/replication/cl5_api.c 19 Nov 2007 17:23:50 -0000 1.21 >+++ ldapserver/ldap/servers/plugins/replication/cl5_api.c 1 Oct 2008 13:15:50 -0000 >@@ -3371,18 +3371,16 @@ > > /* upgrade from db41 -> db42 -> db43 -> db44 -> db45 > * 1. Run recovery on the database environment using the DB_ENV->open method > * 2. Remove any Berkeley DB environment using the DB_ENV->remove method > * 3. Remove any Berkeley DB transaction log files > */ > static int _cl5Upgrade4_4(char *fromVersion, char *toVersion) > { >- PRDirEntry *entry = NULL; >- DB *thisdb = NULL; > CL5OpenMode backup; > int rc = 0; > > backup = s_cl5Desc.dbOpenMode; > s_cl5Desc.dbOpenMode = CL5_OPEN_CLEAN_RECOVER; > /* CL5_OPEN_CLEAN_RECOVER does 1 and 2 */ > rc = _cl5AppInit (NULL); > if (rc != CL5_SUCCESS) >Index: ldapserver/ldap/servers/plugins/replication/repl5_agmt.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_agmt.c,v >retrieving revision 1.12 >diff -u -8 -r1.12 repl5_agmt.c >--- ldapserver/ldap/servers/plugins/replication/repl5_agmt.c 28 Sep 2007 22:41:09 -0000 1.12 >+++ ldapserver/ldap/servers/plugins/replication/repl5_agmt.c 1 Oct 2008 13:15:50 -0000 >@@ -1178,17 +1178,17 @@ > char **retval = NULL; > char **frac_attrs = ra->frac_attrs; > > /* Iterate over the frac attrs */ > if (frac_attrs) > { > char *this_attr = NULL; > int i = 0; >- for (i = 0; this_attr = frac_attrs[i]; i++) >+ for (i = 0; (this_attr = frac_attrs[i]); i++) > { > if (charray_inlist(verbotten_attrs,this_attr)) { > int k = 0; > charray_add(&retval,this_attr); > /* Remove this attr from the list */ > for (k = i; frac_attrs[k] ; k++) > { > frac_attrs[k] = frac_attrs[k+1]; >Index: ldapserver/ldap/servers/plugins/replication/repl5_connection.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_connection.c,v >retrieving revision 1.8 >diff -u -8 -r1.8 repl5_connection.c >--- ldapserver/ldap/servers/plugins/replication/repl5_connection.c 18 Oct 2007 00:08:31 -0000 1.8 >+++ ldapserver/ldap/servers/plugins/replication/repl5_connection.c 1 Oct 2008 13:15:51 -0000 >@@ -1723,17 +1723,17 @@ > > static void > repl5_stop_debug_timeout(Slapi_Eq_Context eqctx, int *setlevel) > { > char buf[20]; > char msg[SLAPI_DSE_RETURNTEXT_SIZE]; > > if (eqctx && !*setlevel) { >- int found = slapi_eq_cancel(eqctx); >+ (void)slapi_eq_cancel(eqctx); > } > > if (s_debug_timeout && s_debug_level && *setlevel) { > void config_set_errorlog_level(const char *type, char *buf, char *msg, int apply); > sprintf(buf, "%d", 0); > config_set_errorlog_level("nsslapd-errorlog-level", buf, msg, 1); > } > } >Index: ldapserver/ldap/servers/plugins/replication/repl5_protocol_util.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_protocol_util.c,v >retrieving revision 1.12 >diff -u -8 -r1.12 repl5_protocol_util.c >--- ldapserver/ldap/servers/plugins/replication/repl5_protocol_util.c 3 Mar 2008 18:35:11 -0000 1.12 >+++ ldapserver/ldap/servers/plugins/replication/repl5_protocol_util.c 1 Oct 2008 13:15:51 -0000 >@@ -412,17 +412,18 @@ > "%s: Unable to obtain current CSN. " > "Replication is aborting.\n", > agmt_get_long_name(prp->agmt)); > return_value = ACQUIRE_FATAL_ERROR; > } > } > } > } >-error: >+ >+/* error: */ > if (NULL != ruv_bervals) > ber_bvecfree(ruv_bervals); > if (NULL != replarea_sdn) > slapi_sdn_free(&replarea_sdn); > if (NULL != retoid) > ldap_memfree(retoid); > if (NULL != retdata) > ber_bvfree(retdata); >Index: ldapserver/ldap/servers/plugins/replication/repl5_replica.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_replica.c,v >retrieving revision 1.17 >diff -u -8 -r1.17 repl5_replica.c >--- ldapserver/ldap/servers/plugins/replication/repl5_replica.c 24 Jun 2008 22:22:09 -0000 1.17 >+++ ldapserver/ldap/servers/plugins/replication/repl5_replica.c 1 Oct 2008 13:15:51 -0000 >@@ -1071,17 +1071,17 @@ > PR_Lock(r->repl_lock); > > gen = (CSNGen *)object_get_data (r->repl_csngen); > PR_ASSERT (gen); > > rc = csngen_adjust_time (gen, csn); > /* rc will be either CSN_SUCCESS (0) or clock skew */ > >-done: >+/* done: */ > > PR_Unlock(r->repl_lock); > if (csn != extracsn) /* do not free the given csn */ > { > csn_free (&csn); > } > > return rc; >Index: ldapserver/ldap/servers/plugins/replication/repl5_updatedn_list.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_updatedn_list.c,v >retrieving revision 1.5 >diff -u -8 -r1.5 repl5_updatedn_list.c >--- ldapserver/ldap/servers/plugins/replication/repl5_updatedn_list.c 10 Nov 2006 23:45:17 -0000 1.5 >+++ ldapserver/ldap/servers/plugins/replication/repl5_updatedn_list.c 1 Oct 2008 13:15:51 -0000 >@@ -188,17 +188,17 @@ > { > PLHashTable *hash = list; > PRBool ret = PR_FALSE; > > const char *ndn = slapi_sdn_get_ndn(dn); > > /* Bug 605169 - null ndn would cause core dump */ > if ( ndn ) { >- ret = (PRBool)PL_HashTableLookupConst(hash, ndn); >+ ret = (PRBool)((uintptr_t)PL_HashTableLookupConst(hash, ndn)); > } > > return ret; > } > > struct list_to_string_data { > char *string; > const char *delimiter; >Index: ldapserver/ldap/servers/plugins/roles/roles_plugin.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/roles/roles_plugin.c,v >retrieving revision 1.8 >diff -u -8 -r1.8 roles_plugin.c >--- ldapserver/ldap/servers/plugins/roles/roles_plugin.c 12 Oct 2007 18:03:43 -0000 1.8 >+++ ldapserver/ldap/servers/plugins/roles/roles_plugin.c 1 Oct 2008 13:15:51 -0000 >@@ -45,25 +45,19 @@ > Code to implement server roles features > */ > > #include "slap.h" > > #include "vattr_spi.h" > > #include "roles_cache.h" >+#define DEFINE_STATECHANGE_STATICS 1 > #include "statechange.h" > >- >-#ifdef SOURCEFILE >-#undef SOURCEFILE >-#endif >-#define SOURCEFILE "roles_plugin.c" >-static char *sourcefile = SOURCEFILE; >- > #define STATECHANGE_ROLES_ID "Roles" > #define STATECHANGE_ROLES_CONFG_FILTER "objectclass=nsRoleDefinition" > #define STATECHANGE_ROLES_ENTRY_FILTER "objectclass=*" > > #define ROLES_PLUGIN_SUBSYSTEM "roles-plugin" /* for logging */ > static void * roles_plugin_identity = NULL; > > static Slapi_PluginDesc pdesc = { "roles", >Index: ldapserver/ldap/servers/slapd/agtmmap.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/agtmmap.c,v >retrieving revision 1.10 >diff -u -8 -r1.10 agtmmap.c >--- ldapserver/ldap/servers/slapd/agtmmap.c 10 Nov 2006 23:45:40 -0000 1.10 >+++ ldapserver/ldap/servers/slapd/agtmmap.c 1 Oct 2008 13:15:51 -0000 >@@ -190,17 +190,17 @@ > fstat (fd, &fileinfo); > > sz = sizeof (struct agt_stats_t); > > if (fileinfo.st_size < sz) > { > /* Without this we will get segv when we try to read/write later */ > buf = calloc (1, sz); >- write (fd, buf, sz); >+ (void)write (fd, buf, sz); > free (buf); > } > > fp = mmap (NULL, sz, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0); > > if (fp == (caddr_t) -1) > { > err = errno; >Index: ldapserver/ldap/servers/slapd/auth.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/auth.c,v >retrieving revision 1.10 >diff -u -8 -r1.10 auth.c >--- ldapserver/ldap/servers/slapd/auth.c 27 Aug 2008 21:56:07 -0000 1.10 >+++ ldapserver/ldap/servers/slapd/auth.c 1 Oct 2008 13:15:51 -0000 >@@ -444,25 +444,25 @@ > cipher = slapi_ch_strdup(cipherInfo.symCipherName); > > /* If inside an Start TLS operation, perform the privacy level discovery > * and if the security degree achieved after the handshake is not reckoned > * to be enough, close the SSL connection. */ > if ( conn->c_flags & CONN_FLAG_START_TLS ) { > if ( cipherInfo.symKeyBits == 0 ) { > start_tls_graceful_closure( conn, NULL, 1 ); >- slapi_ch_free((void **)&cipher); >+ slapi_ch_free_string(&cipher); > return ; > } > } > > if (config_get_SSLclientAuth() == SLAPD_SSLCLIENTAUTH_OFF ) { > slapi_log_access (LDAP_DEBUG_STATS, "conn=%d SSL %i-bit %s\n", > conn->c_connid, keySize, cipher ? cipher : "NULL" ); >- slapi_ch_free((void **)&cipher); >+ slapi_ch_free_string(&cipher); > return; > } > if (clientCert == NULL) { > slapi_log_access (LDAP_DEBUG_STATS, "conn=%d SSL %i-bit %s\n", > conn->c_connid, keySize, cipher ? cipher : "NULL" ); > } else { > char* subject = subject_of (clientCert); > { >@@ -494,17 +494,17 @@ > LDAPDebug (LDAP_DEBUG_TRACE, "<= ldapu_cert_to_ldap_entry() %s\n", > extraErrorMsg, 0, 0); > } > } else { > extraErrorMsg = ldapu_err2string(err); > LDAPDebug (LDAP_DEBUG_TRACE, "<= ldapu_cert_to_ldap_entry() %i (%s)%s\n", > err, extraErrorMsg, chain ? "" : " NULL"); > } >- slapi_ch_free((void**)&basedn); >+ slapi_ch_free_string(&basedn); > slapu_msgfree (internal_ld, chain); > } > if (subject) free (subject); > } > > if (clientDN != NULL) { > char ebuf[ BUFSIZ ]; > slapi_log_access (LDAP_DEBUG_STATS, "conn=%d SSL client bound as %s\n", >@@ -517,11 +517,11 @@ > > /* > * Associate the new credentials with the connection. Note that > * clientDN and clientCert may be NULL. > */ > bind_credentials_set( conn, SLAPD_AUTH_SSL, clientDN, > SLAPD_AUTH_SSL, clientDN, clientCert , NULL); > >- slapi_ch_free((void **)&cipher); >+ slapi_ch_free_string(&cipher); > /* clientDN and clientCert will be freed later */ > } >Index: ldapserver/ldap/servers/slapd/bind.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/bind.c,v >retrieving revision 1.13 >diff -u -8 -r1.13 bind.c >--- ldapserver/ldap/servers/slapd/bind.c 27 Aug 2008 21:05:17 -0000 1.13 >+++ ldapserver/ldap/servers/slapd/bind.c 1 Oct 2008 13:15:51 -0000 >@@ -98,17 +98,17 @@ > Slapi_Value rdnpwbv; > Slapi_Value *rdnpwvals[2]; > slapi_value_init_string(&rdnpwbv,rootpw); > rdnpwvals[ 0 ] = &rdnpwbv; > rdnpwvals[ 1 ] = NULL; > rv = slapi_pw_find_sv( rdnpwvals, cred ) == 0; > value_done(&rdnpwbv); > } >- slapi_ch_free( (void **) &rootpw ); >+ slapi_ch_free_string( &rootpw ); > return rv; > } > > void > do_bind( Slapi_PBlock *pb ) > { > BerElement *ber = pb->pb_op->o_ber; > int err, isroot; >@@ -782,11 +782,11 @@ > } > > if ( slapi_pblock_set( pb, SLAPI_ADD_RESCONTROL, &arctrl ) != 0 ) { > slapi_log_error( SLAPI_LOG_FATAL, "bind", > "unable to add authentication response control" ); > } > > if ( NULL != dnbuf_dynamic ) { >- slapi_ch_free( (void **)&dnbuf_dynamic ); >+ slapi_ch_free_string( &dnbuf_dynamic ); > } > } >Index: ldapserver/ldap/servers/slapd/config.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/config.c,v >retrieving revision 1.11 >diff -u -8 -r1.11 config.c >--- ldapserver/ldap/servers/slapd/config.c 14 May 2008 18:39:31 -0000 1.11 >+++ ldapserver/ldap/servers/slapd/config.c 1 Oct 2008 13:15:51 -0000 >@@ -561,16 +561,16 @@ > exit (1); > } > else { > slapi_sdn_done(&plug_dn); > rc= 1; /* OK */ > } > } > >- slapi_ch_free((void **)&buf); >+ slapi_ch_free_string(&buf); > } > > bail: >- slapi_ch_free((void **)&buf); >+ slapi_ch_free_string(&buf); > return rc; > } > >Index: ldapserver/ldap/servers/slapd/configdse.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/configdse.c,v >retrieving revision 1.8 >diff -u -8 -r1.8 configdse.c >--- ldapserver/ldap/servers/slapd/configdse.c 17 Sep 2007 22:48:10 -0000 1.8 >+++ ldapserver/ldap/servers/slapd/configdse.c 1 Oct 2008 13:15:51 -0000 >@@ -97,17 +97,17 @@ > char *ptype = slapi_entry_attr_get_charptr(e, ATTR_PLUGIN_TYPE); > int retval = (ptype && !strcasecmp(ptype, "syntax")); > if (!retval) > retval = (ptype && !strcasecmp(ptype, "matchingrule")); > if (!retval) > retval = (ptype && !strcasecmp(ptype, "pwdstoragescheme")); > if (!retval) > retval = (ptype && !strcasecmp(ptype, "reverpwdstoragescheme")); >- slapi_ch_free((void**)&ptype); >+ slapi_ch_free_string(&ptype); > return retval; > } > > /* these attr types are ignored for the purposes of configuration search/modify */ > static int > ignore_attr_type(const char *attr_type) > { > if ( !attr_type || >@@ -173,34 +173,34 @@ > val.bv_len = strlen (val.bv_val); > attrlist_merge ( &e->e_attrs, "nsslapd-backendconfig", vals); > slapi_sdn_done(&dn); > } > > be = slapi_get_next_backend (cookie); > } > >- slapi_ch_free ((void **)&cookie); >+ slapi_ch_free_string (&cookie); > > /* show be_type */ > attrlist_delete( &e->e_attrs, "nsslapd-betype"); > cookie = NULL; > be = slapi_get_first_backend(&cookie); > while ( be ) { > if( !be->be_private ) > { > val.bv_val = be->be_type; > val.bv_len = strlen (be->be_type); > attrlist_replace( &e->e_attrs, "nsslapd-betype", vals ); > } > > be = slapi_get_next_backend(cookie); > } > >- slapi_ch_free ( (void **) &cookie); >+ slapi_ch_free_string (&cookie); > > /* show private suffixes */ > attrlist_delete ( &e->e_attrs, "nsslapd-privatenamespaces"); > cookie = NULL; > be = slapi_get_first_backend(&cookie); > while ( be ) > { > if(be->be_private) >@@ -217,17 +217,17 @@ > } > n++; > } while (base!=NULL); > } > > be = slapi_get_next_backend(cookie); > } > >- slapi_ch_free ((void **) &cookie); >+ slapi_ch_free_string (&cookie); > > /* show syntax plugins */ > attrlist_delete ( &e->e_attrs, CONFIG_PLUGIN_ATTRIBUTE ); > for ( pPlugin = slapi_get_global_syntax_plugins(); pPlugin != NULL; > pPlugin = pPlugin->plg_next ) { > val.bv_val = pPlugin->plg_dn; > val.bv_len = strlen ( val.bv_val ); > attrlist_merge ( &e->e_attrs, CONFIG_PLUGIN_ATTRIBUTE, vals ); >@@ -427,17 +427,17 @@ > /* > * The DSE code will be writing the resultant entry value to the > * dse.ldif file. We *must*not* write plain passwords into here. > */ > slapi_entry_attr_delete( e, CONFIG_ROOTPW_ATTRIBUTE ); > /* if the password has been set, it will be hashed */ > if ((pwd = config_get_rootpw()) != NULL) { > slapi_entry_attr_set_charptr(e, CONFIG_ROOTPW_ATTRIBUTE, pwd); >- slapi_ch_free((void**)&pwd); >+ slapi_ch_free_string(&pwd); > } > > *returncode= rc; > if(LDAP_SUCCESS == rc) { > return(SLAPI_DSE_CALLBACK_OK); /* success -- apply the mods. */ > } > else { > return(SLAPI_DSE_CALLBACK_ERROR); /* failure -- reject the mods. */ >Index: ldapserver/ldap/servers/slapd/conntable.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/conntable.c,v >retrieving revision 1.9 >diff -u -8 -r1.9 conntable.c >--- ldapserver/ldap/servers/slapd/conntable.c 18 Oct 2007 00:08:34 -0000 1.9 >+++ ldapserver/ldap/servers/slapd/conntable.c 1 Oct 2008 13:15:52 -0000 >@@ -433,17 +433,17 @@ > ct->c[i].c_opscompleted, > ct->c[i].c_gettingber ? "r" : "", > "", > ct->c[i].c_dn ? ct->c[i].c_dn : "NULLDN" ); > val.bv_val = bufptr; > val.bv_len = strlen( bufptr ); > attrlist_merge( &e->e_attrs, "connection", vals ); > if (newbuf) { >- slapi_ch_free((void **) &newbuf); >+ slapi_ch_free_string(&newbuf); > } > } > PR_Unlock( ct->c[i].c_mutex ); > } > > sprintf( buf, "%d", nconns ); > val.bv_val = buf; > val.bv_len = strlen( buf ); >Index: ldapserver/ldap/servers/slapd/detach.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/detach.c,v >retrieving revision 1.7 >diff -u -8 -r1.7 detach.c >--- ldapserver/ldap/servers/slapd/detach.c 3 Apr 2008 21:07:55 -0000 1.7 >+++ ldapserver/ldap/servers/slapd/detach.c 1 Oct 2008 13:15:52 -0000 >@@ -122,25 +122,25 @@ > (void) chdir( "/" ); > } else { > if ((ptr = strrchr(errorlog, '/')) || > (ptr = strrchr(errorlog, '\\'))) { > *ptr = 0; > } > (void) chdir( errorlog ); > config_set_workingdir(CONFIG_WORKINGDIR_ATTRIBUTE, errorlog, errorbuf, 1); >- slapi_ch_free((void**)&errorlog); >+ slapi_ch_free_string(&errorlog); > } > } else { > /* calling config_set_workingdir to check for validity of directory, don't apply */ > if (config_set_workingdir(CONFIG_WORKINGDIR_ATTRIBUTE, workingdir, errorbuf, 0) == LDAP_OPERATIONS_ERROR) { > exit(1); > } > (void) chdir( workingdir ); >- slapi_ch_free((void**)&workingdir); >+ slapi_ch_free_string(&workingdir); > } > > if ( (sd = open( "/dev/null", O_RDWR )) == -1 ) { > perror( "/dev/null" ); > exit( 1 ); > } > (void) dup2( sd, 0 ); > (void) dup2( sd, 1 ); >Index: ldapserver/ldap/servers/slapd/dse.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/dse.c,v >retrieving revision 1.9 >diff -u -8 -r1.9 dse.c >--- ldapserver/ldap/servers/slapd/dse.c 4 Jun 2008 22:22:55 -0000 1.9 >+++ ldapserver/ldap/servers/slapd/dse.c 1 Oct 2008 13:15:52 -0000 >@@ -67,16 +67,23 @@ > #include <prio.h> > #include <prcountr.h> > #include "slap.h" > > #if !defined (_WIN32) > #include <pwd.h> > #endif /* _WIN32 */ > >+/* Required to get portable printf/scanf format macros */ >+#ifdef HAVE_INTTYPES_H >+#include <inttypes.h> >+#else >+#error Need to define portable format macros such as PRIu64 >+#endif /* HAVE_INTTYPES_H */ >+ > /* #define SLAPI_DSE_DEBUG */ /* define this to force trace log */ > /* messages to always be logged */ > > #ifdef SLAPI_DSE_DEBUG > #define SLAPI_DSE_TRACELEVEL LDAP_DEBUG_ANY > #else /* SLAPI_DSE_DEBUG */ > #define SLAPI_DSE_TRACELEVEL LDAP_DEBUG_TRACE > #endif /* SLAPI_DSE_DEBUG */ >@@ -458,16 +465,18 @@ > nentries = avl_free(pdse->dse_tree, dse_internal_delete_entry); > if (pdse->dse_rwlock) { > PR_RWLock_Unlock(pdse->dse_rwlock); > PR_DestroyRWLock(pdse->dse_rwlock); > } > slapi_ch_free((void **)&pdse); > LDAPDebug( SLAPI_DSE_TRACELEVEL, "Removed [%d] entries from the dse tree.\n", > nentries,0,0 ); >+ >+ return 0; /* no one checks this return value */ > } > > /* > * Get rid of a dse structure. > */ > int > dse_deletedse(Slapi_PBlock *pb) > { >@@ -598,17 +607,17 @@ > current_sub_count--; > } > { > char value_buffer[20]; /* enough digits for 2^64 children */ > struct berval *vals[2]; > struct berval val; > vals[0] = &val; > vals[1] = NULL; >- sprintf(value_buffer,"%lu",current_sub_count); >+ sprintf(value_buffer,"%" PRIuPTR,current_sub_count); > val.bv_val = value_buffer; > val.bv_len = strlen (val.bv_val); > switch(mod_op) > { > case LDAP_MOD_ADD: > attrlist_merge( &entry->e_attrs, subordinatecount, vals); > break; > case LDAP_MOD_REPLACE: >Index: ldapserver/ldap/servers/slapd/filter.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/filter.c,v >retrieving revision 1.9 >diff -u -8 -r1.9 filter.c >--- ldapserver/ldap/servers/slapd/filter.c 10 Nov 2006 23:45:40 -0000 1.9 >+++ ldapserver/ldap/servers/slapd/filter.c 1 Oct 2008 13:15:52 -0000 >@@ -1275,17 +1275,17 @@ > *bufsize -= size; > } > } > buf += strlen(buf); > > if(1 < *bufsize) > { > sprintf( buf, ")" ); >- *bufsize--; >+ (*bufsize)--; > } > } > break; > > case LDAP_FILTER_PRESENT: > size = strlen(f->f_type) + 4; > > if(size < *bufsize) >@@ -1308,17 +1308,17 @@ > buf += strlen(buf); > slapi_filter_to_string_internal( p, buf, bufsize ); > } > buf += strlen(buf); > > if(1 < *bufsize) > { > sprintf( buf, ")" ); >- *bufsize--; >+ (*bufsize)--; > } > } > break; > > default: > size = 25; > > if(size < *bufsize) >Index: ldapserver/ldap/servers/slapd/libglobs.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/libglobs.c,v >retrieving revision 1.24 >diff -u -8 -r1.24 libglobs.c >--- ldapserver/ldap/servers/slapd/libglobs.c 27 Aug 2008 21:05:25 -0000 1.24 >+++ ldapserver/ldap/servers/slapd/libglobs.c 1 Oct 2008 13:15:52 -0000 >@@ -5061,16 +5061,18 @@ > config_set_value( > Slapi_Entry *e, > struct config_get_and_set *cgas, > void **value > ) > { > struct berval **values = 0; > char *sval = 0; >+ int ival = 0; >+ uintptr_t pval; > > /* for null values, just set the attr value to the empty > string */ > if (!value) { > slapi_entry_attr_set_charptr(e, cgas->attr_name, ""); > return; > } > >@@ -5120,17 +5122,19 @@ > > case CONFIG_CONSTANT_STRING: > PR_ASSERT(value); /* should be a constant value */ > slapi_entry_attr_set_charptr(e, cgas->attr_name, (char*)value); > break; > > case CONFIG_CONSTANT_INT: > PR_ASSERT(value); /* should be a constant value */ >- slapi_entry_attr_set_int(e, cgas->attr_name, (int)value); >+ pval = (uintptr_t)value; >+ ival = (int)pval; >+ slapi_entry_attr_set_int(e, cgas->attr_name, ival); > break; > > case CONFIG_SPECIAL_SSLCLIENTAUTH: > if (!value) { > slapi_entry_attr_set_charptr(e, cgas->attr_name, "off"); > break; > } > >Index: ldapserver/ldap/servers/slapd/log.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/log.c,v >retrieving revision 1.22 >diff -u -8 -r1.22 log.c >--- ldapserver/ldap/servers/slapd/log.c 3 Apr 2008 17:18:11 -0000 1.22 >+++ ldapserver/ldap/servers/slapd/log.c 1 Oct 2008 13:15:53 -0000 >@@ -2211,22 +2211,22 @@ > ********************************************************************************/ > #define LOG_SIZE_EXCEEDED 1 > #define LOG_EXPIRED 2 > static int > log__needrotation(LOGFD fp, int logtype) > { > time_t curr_time; > time_t log_createtime= 0; >- time_t syncclock; >+ time_t syncclock = 0; > int type = LOG_CONTINUE; > int f_size = 0; > int maxlogsize, nlogs; > int rotationtime_secs = -1; >- int sync_enabled, timeunit; >+ int sync_enabled = 0, timeunit = 0; > > if (fp == NULL) { > return LOG_ROTATE; > } > > switch (logtype) { > case SLAPD_ACCESS_LOG: > nlogs = loginfo.log_access_maxnumlogs; >Index: ldapserver/ldap/servers/slapd/log.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/log.h,v >retrieving revision 1.7 >diff -u -8 -r1.7 log.h >--- ldapserver/ldap/servers/slapd/log.h 10 Nov 2006 23:45:40 -0000 1.7 >+++ ldapserver/ldap/servers/slapd/log.h 1 Oct 2008 13:15:53 -0000 >@@ -44,19 +44,23 @@ > /*********************************************************************** > * log.h > * > * structures related to logging facility. > * > *************************************************************************/ > #include <stdio.h> > #ifdef LINUX >+#ifndef _XOPEN_SOURCE > #define _XOPEN_SOURCE /* glibc2 needs this */ >+#endif >+#ifndef __USE_XOPEN > #define __USE_XOPEN > #endif >+#endif > #include <time.h> > #include <stdarg.h> > #include <sys/types.h> > #include <sys/stat.h> > #ifndef _WIN32 > #include <errno.h> > #ifdef LINUX > #include <sys/statfs.h> >Index: ldapserver/ldap/servers/slapd/main.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/main.c,v >retrieving revision 1.24 >diff -u -8 -r1.24 main.c >--- ldapserver/ldap/servers/slapd/main.c 3 Apr 2008 21:07:55 -0000 1.24 >+++ ldapserver/ldap/servers/slapd/main.c 1 Oct 2008 13:15:53 -0000 >@@ -256,17 +256,16 @@ > /* Changes the owner of the files in the logs and > * config directory to the user that the server runs as. > */ > > static void > fix_ownership() > { > struct passwd* pw=NULL; >- char dirname[MAXPATHLEN + 1]; > > slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); > > if (slapdFrontendConfig->localuser != NULL) { > if (slapdFrontendConfig->localuserinfo == NULL) { > pw = getpwnam( slapdFrontendConfig->localuser ); > if ( NULL == pw ) { > LDAPDebug(LDAP_DEBUG_ANY, >@@ -625,17 +624,16 @@ > > int > main( int argc, char **argv) > { > int return_value = 0; > slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); > daemon_ports_t ports_info = {0}; > Slapi_Backend *be = NULL; >- int init_ssl; > #ifndef __LP64__ > #if defined(__hpux) && !defined(__ia64) > /* for static constructors */ > _main(); > #endif > #endif > /* > * Initialize NSPR very early. NSPR supports implicit initialization, >@@ -2593,17 +2591,16 @@ > * function to perform DB verify > */ > static int > slapd_exemode_dbverify() > { > int return_value = 0; > Slapi_PBlock pb; > struct slapdplugin *backend_plugin; >- slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig(); > > /* this should be the first time to be called! if the init order > * is ever changed, these lines should be changed (or erased)! > */ > mapping_tree_init(); > if ((backend_plugin = plugin_get_by_name("ldbm database")) == NULL) { > LDAPDebug(LDAP_DEBUG_ANY, > "ERROR: Could not find the ldbm backend plugin.\n", >Index: ldapserver/ldap/servers/slapd/mapping_tree.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/mapping_tree.c,v >retrieving revision 1.14 >diff -u -8 -r1.14 mapping_tree.c >--- ldapserver/ldap/servers/slapd/mapping_tree.c 12 Jun 2008 15:23:44 -0000 1.14 >+++ ldapserver/ldap/servers/slapd/mapping_tree.c 1 Oct 2008 13:15:54 -0000 >@@ -1993,17 +1993,17 @@ > target_node = slapi_get_mapping_tree_node_by_dn(target_sdn); > if (target_node == NULL) > target_node = mapping_tree_root; > > /* The processing of the base scope root DSE search and all other LDAP operations on "" > * will be transferred to the internal DSE backend > */ > if( sdn_is_nulldn(target_sdn) && >- ((op_type == SLAPI_OPERATION_SEARCH) && (scope == LDAP_SCOPE_BASE) || >+ (((op_type == SLAPI_OPERATION_SEARCH) && (scope == LDAP_SCOPE_BASE)) || > (op_type != SLAPI_OPERATION_SEARCH)) ) { > > mtn_unlock(); > *be = slapi_be_select_by_instance_name(DSE_BACKEND); > if(*be != NULL && !be_isdeleted(*be)) > { > ret = LDAP_SUCCESS; > slapi_be_Rlock(*be); /* also done inside mtn_get_be() below */ >Index: ldapserver/ldap/servers/slapd/pblock.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/pblock.c,v >retrieving revision 1.16 >diff -u -8 -r1.16 pblock.c >--- ldapserver/ldap/servers/slapd/pblock.c 5 Aug 2008 22:18:37 -0000 1.16 >+++ ldapserver/ldap/servers/slapd/pblock.c 1 Oct 2008 13:15:54 -0000 >@@ -2868,17 +2868,17 @@ > break; > > case SLAPI_URP_TOMBSTONE_UNIQUEID: > pblock->pb_urp_tombstone_uniqueid = (char *)value; > break; > > case SLAPI_LDIF2DB_ENCRYPT: > case SLAPI_DB2LDIF_DECRYPT: >- pblock->pb_ldif_encrypt = (int)value; >+ pblock->pb_ldif_encrypt = *((int *)value); > break; > > default: > LDAPDebug( LDAP_DEBUG_ANY, > "Unknown parameter block argument %d\n", arg, 0, 0 ); > return( -1 ); > } > >Index: ldapserver/ldap/servers/slapd/saslbind.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/saslbind.c,v >retrieving revision 1.26 >diff -u -8 -r1.26 saslbind.c >--- ldapserver/ldap/servers/slapd/saslbind.c 27 Aug 2008 21:05:35 -0000 1.26 >+++ ldapserver/ldap/servers/slapd/saslbind.c 1 Oct 2008 13:15:54 -0000 >@@ -292,17 +292,16 @@ > const char *user, > const char *user_realm > ) > { > int found = 0; > int attrsonly = 0, scope = LDAP_SCOPE_SUBTREE; > LDAPControl **ctrls = NULL; > Slapi_Entry *entry = NULL; >- Slapi_DN *sdn; > char **attrs = NULL; > int regexmatch = 0; > char *base = NULL; > char *filter = NULL; > > /* Check for wildcards in the authid and realm. If we encounter one, > * just fail the mapping without performing a costly internal search. */ > if (user && strchr(user, '*')) { >Index: ldapserver/ldap/servers/slapd/snmp_collator.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/snmp_collator.c,v >retrieving revision 1.13 >diff -u -8 -r1.13 snmp_collator.c >--- ldapserver/ldap/servers/slapd/snmp_collator.c 18 Oct 2007 14:05:24 -0000 1.13 >+++ ldapserver/ldap/servers/slapd/snmp_collator.c 1 Oct 2008 13:15:54 -0000 >@@ -394,17 +394,16 @@ > * starts the collator thread > ************************************************************************************/ > > int snmp_collator_start() > { > > int err; > char *statspath = config_get_rundir(); >- char *lp = NULL; > char *instdir = config_get_configdir(); > char *instname = NULL; > > /* > * Get directory for our stats file > */ > if (NULL == statspath) { > statspath = slapi_ch_strdup("/tmp"); >Index: ldapserver/ldap/servers/slapd/statechange.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/statechange.h,v >retrieving revision 1.5 >diff -u -8 -r1.5 statechange.h >--- ldapserver/ldap/servers/slapd/statechange.h 10 Nov 2006 23:45:40 -0000 1.5 >+++ ldapserver/ldap/servers/slapd/statechange.h 1 Oct 2008 13:15:54 -0000 >@@ -73,12 +73,14 @@ > > /* Vattr state change handler to be passed to statechange_register() by va sps*/ > #define statechange_vattr_cache_invalidator_callback(api) api[4] > > #define STATECHANGE_VATTR_GLOBAL_INVALIDATE 1 > #define STATECHANGE_VATTR_ENTRY_INVALIDATE 2 > > /* Vattr api caller data to be passed to statechange_register() */ >+#ifdef DEFINE_STATECHANGE_STATICS > static int vattr_global_invalidate = STATECHANGE_VATTR_GLOBAL_INVALIDATE; >-static int vattr_entry_invalidate = STATECHANGE_VATTR_ENTRY_INVALIDATE; >+/* static int vattr_entry_invalidate = STATECHANGE_VATTR_ENTRY_INVALIDATE; */ >+#endif /* DEFINE_STATECHANGE_STATICS */ > > #endif /*_STATE_NOTIFY_H_*/ >Index: ldapserver/ldap/servers/slapd/task.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/task.c,v >retrieving revision 1.15 >diff -u -8 -r1.15 task.c >--- ldapserver/ldap/servers/slapd/task.c 3 Apr 2008 16:52:46 -0000 1.15 >+++ ldapserver/ldap/servers/slapd/task.c 1 Oct 2008 13:15:55 -0000 >@@ -188,16 +188,18 @@ > /* > * Get the current state of a task > */ > int slapi_task_get_state(Slapi_Task *task) > { > if (task) { > return task->task_state; > } >+ >+ return 0; /* return value not currently used */ > } > > /* this changes the 'nsTaskStatus' value, which is transient (anything logged > * here wipes out any previous status) > */ > void slapi_task_log_status(Slapi_Task *task, char *format, ...) > { > va_list ap; >@@ -336,16 +338,18 @@ > /* > * Retrieve some opaque task specific data from the task. > */ > void * slapi_task_get_data(Slapi_Task *task) > { > if (task) { > return task->task_private; > } >+ >+ return NULL; /* return value not currently used */ > } > > /* > * Increment the task reference count > */ > void slapi_task_inc_refcount(Slapi_Task *task) > { > if (task) { >@@ -366,16 +370,18 @@ > /* > * Returns the task reference count > */ > int slapi_task_get_refcount(Slapi_Task *task) > { > if (task) { > return task->task_refcount; > } >+ >+ return 0; /* return value not currently used */ > } > > /* name is, for example, "import" */ > int slapi_task_register_handler(const char *name, dseCallbackFn func) > { > char *dn = NULL; > Slapi_PBlock *pb = NULL; > Slapi_Operation *op; >Index: ldapserver/ldap/servers/slapd/uuid.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/uuid.c,v >retrieving revision 1.11 >diff -u -8 -r1.11 uuid.c >--- ldapserver/ldap/servers/slapd/uuid.c 18 Oct 2007 00:08:34 -0000 1.11 >+++ ldapserver/ldap/servers/slapd/uuid.c 1 Oct 2008 13:15:55 -0000 >@@ -356,18 +356,18 @@ > format_uuid_v1(uuid, timestamp, _state.genstate.clockseq); > > return UUID_SUCCESS; > } > > /* uuid_create -- multithreaded generation */ > static int uuid_create_mt(guid_t *uuid) > { >- uuid_time_t timestamp; >- unsigned16 clock_seq; >+ uuid_time_t timestamp = 0; >+ unsigned16 clock_seq = 0; > > /* just bumps time sequence number. the actual > time calls are made by a uuid_update_state */ > update_time_mt (×tamp, &clock_seq); > > if (timestamp == (uuid_time_t)NEED_TIME_UPDATE) > { > slapi_log_error (SLAPI_LOG_FATAL, MODULE, "uuid_create_mt: generator ran " >Index: ldapserver/ldap/servers/slapd/back-ldbm/back-ldbm.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/back-ldbm.h,v >retrieving revision 1.15 >diff -u -8 -r1.15 back-ldbm.h >--- ldapserver/ldap/servers/slapd/back-ldbm/back-ldbm.h 5 Aug 2008 21:03:42 -0000 1.15 >+++ ldapserver/ldap/servers/slapd/back-ldbm/back-ldbm.h 1 Oct 2008 13:15:55 -0000 >@@ -109,16 +109,25 @@ > #define ID2ENTRY "id2entry" /* main db file name: ID2ENTRY+LDBM_SUFFIX */ > > #define LDBM_SUFFIX_OLD ".db3" > #define LDBM_SUFFIX ".db4" > > #define MEGABYTE (1024 * 1024) > #define GIGABYTE (1024 * MEGABYTE) > >+#define DB_USES_LOCKING(env) \ >+ (DB_INIT_LOCK & ((env)->get_open_flags((env), NULL))) >+#define DB_USES_TRANSACTIONS(env) \ >+ (DB_INIT_TXN & ((env)->get_open_flags((env), NULL))) >+#define DB_USES_MPOOL(env) \ >+ (DB_INIT_MPOOL & ((env)->get_open_flags((env), NULL))) >+#define DB_USES_LOGGING(env) \ >+ (DB_INIT_LOG & ((env)->get_open_flags((env), NULL))) >+ > > /* include NSPR header files */ > #include "nspr.h" > #include "plhash.h" > > #include "slap.h" > #include "slapi-plugin.h" > #include "slapi-private.h" >Index: ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c,v >retrieving revision 1.27 >diff -u -8 -r1.27 dblayer.c >--- ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c 3 Apr 2008 16:52:47 -0000 1.27 >+++ ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c 1 Oct 2008 13:15:55 -0000 >@@ -92,16 +92,23 @@ > > > */ > > #include "back-ldbm.h" > #include "dblayer.h" > #include <prrwlock.h> > >+/* Required to get portable printf/scanf format macros */ >+#ifdef HAVE_INTTYPES_H >+#include <inttypes.h> >+#else >+#error Need to define portable format macros such as PRIu64 >+#endif /* HAVE_INTTYPES_H */ >+ > #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4100 > #define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval) \ > { \ > if (((oflags) & DB_INIT_TXN) && ((oflags) & DB_INIT_LOG)) \ > { \ > (rval) = ((db)->open)((db), (txnid), (file), (database), (type), (flags)|DB_AUTO_COMMIT, (mode)); \ > } \ > else \ >@@ -279,17 +286,17 @@ > 2. value = 1 makes behavior be like 5.0 but leaves batching on > 3. value > 1 changes batch value > > 2 and 3 assume that nsslapd-db-transaction-batch-val is greater 0 at startup > */ > > int > dblayer_set_batch_transactions(void *arg, void *value, char *errorbuf, int phase, int apply) { >- int val = (int) value; >+ int val = (int)((uintptr_t)value); > int retval = LDAP_SUCCESS; > > if (apply) { > if(phase == CONFIG_PHASE_STARTUP) { > trans_batch_limit=val; > } else if(trans_batch_limit != FLUSH_REMOTEOFF ) { > if((val == 0) && (log_flush_thread)) { > log_flush_thread=PR_FALSE; >@@ -299,17 +306,17 @@ > } > } > } > return retval; > } > > void * > dblayer_get_batch_transactions(void *arg) { >- return (void *)trans_batch_limit; >+ return (void *)((uintptr_t)trans_batch_limit); > } > > > /* > Threading: dblayer isolates upper layers from threading considerations > Everything in dblayer is free-threaded. That is, you can have multiple > threads performing operations on a database and not worry about things. > Obviously, if you do something stupid, like move a cursor forward in >@@ -460,35 +467,35 @@ > * -robey, 28oct98 > */ > int dblayer_open_huge_file(const char *path, int oflag, int mode) > { > return dblayer_open_large(path, oflag, (mode_t)mode); > } > > >-/* Helper function for large seeks, db2.4 */ >-static int dblayer_seek24_large(int fd, size_t pgsize, db_pgno_t pageno, >- u_long relative, int isrewind, int whence) >+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 >+/* Helper function for large seeks, db4.3 */ >+static int dblayer_seek43_large(int fd, off64_t offset, int whence) > { >- off64_t offset = 0, ret; >+ int ret = 0; > >- offset = (off64_t)pgsize * pageno + relative; >- if (isrewind) offset = -offset; > ret = lseek64(fd, offset, whence); > > return (ret < 0) ? errno : 0; > } >- >-#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 >-/* Helper function for large seeks, db4.3 */ >-static int dblayer_seek43_large(int fd, off64_t offset, int whence) >+#else >+/* Helper function for large seeks, db2.4 */ >+static int dblayer_seek24_large(int fd, size_t pgsize, db_pgno_t pageno, >+ u_long relative, int isrewind, int whence) > { >- int ret = 0; >+ off64_t offset = 0, ret; > >+ offset = (off64_t)pgsize * pageno + relative; >+ if (isrewind) offset = -offset; > ret = lseek64(fd, offset, whence); > > return (ret < 0) ? errno : 0; > } > #endif > > /* helper function for large fstat -- this depends on 'struct stat64' having > * the following members: >@@ -887,17 +894,17 @@ > > sprintf(fn, "/proc/%d/status", getpid()); > f = fopen(fn, "r"); > while (! feof(f)) { > fgets(s, 79, f); > if (feof(f)) > break; > if (strncmp(s, "VmSize:", 7) == 0) { >- sscanf(s+7, "%d", procpages); >+ sscanf(s+7, "%" PRIuPTR, procpages); > break; > } > } > fclose(f); > /* procpages is now in 1k chunks, not pages... */ > *procpages /= (*pagesize / 1024); > } > } >@@ -3444,17 +3451,17 @@ > > INCR_THREAD_COUNT(priv); > > interval = PR_MillisecondsToInterval(100); > while (!priv->dblayer_stop_threads) > { > if (priv->dblayer_enable_transactions) > { >- if (NULL != priv->dblayer_env->dblayer_DB_ENV->lk_handle) { >+ if (DB_USES_LOCKING(priv->dblayer_env->dblayer_DB_ENV)) { > int aborted; > if ((rval = LOCK_DETECT(priv->dblayer_env->dblayer_DB_ENV, > 0, > DB_LOCK_YOUNGEST, > &aborted)) > != 0) { > LDAPDebug(LDAP_DEBUG_ANY, > "Serious Error---Failed in deadlock detect (aborted at 0x%x), err=%d (%s)\n", >@@ -3614,17 +3621,17 @@ > checkpoint_interval = priv->dblayer_checkpoint_interval; > PR_Unlock(li->li_config_mutex); > > /* Check to see if the checkpoint interval has elapsed */ > if (current_time() - time_of_last_checkpoint_completion < > checkpoint_interval) > continue; > >- if (NULL == priv->dblayer_env->dblayer_DB_ENV->tx_handle) >+ if (!DB_USES_TRANSACTIONS(priv->dblayer_env->dblayer_DB_ENV)) > continue; > > /* now checkpoint */ > checkpoint_debug_message(debug_checkpointing, > "Starting checkpoint\n", 0, 0, 0); > rval = dblayer_txn_checkpoint(li, priv->dblayer_env, PR_TRUE, PR_TRUE); > #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR < 4100 > if (DB_INCOMPLETE == rval) >@@ -3772,17 +3779,17 @@ > > interval = PR_MillisecondsToInterval(DBLAYER_SLEEP_INTERVAL); > debug_checkpointing = priv->db_debug_checkpointing; > while (!priv->dblayer_stop_threads) > { > DS_Sleep(interval); /* 622855: wait for other threads fully started */ > if (priv->dblayer_enable_transactions) > { >- if ( (NULL != priv->dblayer_env->dblayer_DB_ENV->mp_handle) && >+ if ( DB_USES_MPOOL(priv->dblayer_env->dblayer_DB_ENV) && > (0 != priv->dblayer_trickle_percentage) ) > { > int pages_written = 0; > if ((rval = MEMP_TRICKLE( > priv->dblayer_env->dblayer_DB_ENV, > priv->dblayer_trickle_percentage, > &pages_written)) != 0) > { >Index: ldapserver/ldap/servers/slapd/back-ldbm/dbverify.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dbverify.c,v >retrieving revision 1.2 >diff -u -8 -r1.2 dbverify.c >--- ldapserver/ldap/servers/slapd/back-ldbm/dbverify.c 18 Oct 2007 00:08:34 -0000 1.2 >+++ ldapserver/ldap/servers/slapd/back-ldbm/dbverify.c 1 Oct 2008 13:15:55 -0000 >@@ -45,17 +45,16 @@ > > static int > dbverify_ext( ldbm_instance *inst, int verbose ) > { > char dbdir[MAXPATHLEN]; > char *filep = NULL; > PRDir *dirhandle = NULL; > PRDirEntry *direntry = NULL; >- backend *be = inst->inst_be; > DB *dbp = NULL; > int tmplen = 0; > int filelen = 0; > int rval = 1; > int rval_main = 0; > struct ldbminfo *li = inst->inst_li; > dblayer_private *priv = (dblayer_private*)li->li_dblayer_private; > struct dblayer_private_env *pEnv = priv->dblayer_env; >@@ -82,17 +81,16 @@ > "PR_OpenDir (%s) failed (%d): %s\n", > dbdir, PR_GetError(),slapd_pr_strerror(PR_GetError())); > return 1; > } > while (NULL != > (direntry = PR_ReadDir(dirhandle, PR_SKIP_DOT | PR_SKIP_DOT_DOT))) > { > /* struct attrinfo *ai = NULL; */ >- char *p = NULL; > dbp = NULL; > > if (!direntry->name) > { > break; > } > if (!strstr(direntry->name, LDBM_FILENAME_SUFFIX)) /* non db file */ > { >Index: ldapserver/ldap/servers/slapd/back-ldbm/import-merge.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/import-merge.c,v >retrieving revision 1.8 >diff -u -8 -r1.8 import-merge.c >--- ldapserver/ldap/servers/slapd/back-ldbm/import-merge.c 2 Oct 2007 18:39:51 -0000 1.8 >+++ ldapserver/ldap/servers/slapd/back-ldbm/import-merge.c 1 Oct 2008 13:15:56 -0000 >@@ -44,16 +44,23 @@ > * this is a bunch of routines for merging groups of db files together -- > * currently it's only used for imports (when we import into several small > * db sets for speed, then merge them). > */ > > #include "back-ldbm.h" > #include "import.h" > >+/* Required to get portable printf/scanf format macros */ >+#ifdef HAVE_INTTYPES_H >+#include <inttypes.h> >+#else >+#error Need to define portable format macros such as PRIu64 >+#endif /* HAVE_INTTYPES_H */ >+ > struct _import_merge_thang > { > int type; > #define IMPORT_MERGE_THANG_IDL 1 /* Values for type */ > #define IMPORT_MERGE_THANG_VLV 2 > union { > IDList *idl; /* if type == IMPORT_MERGE_THANG_IDL */ > DBT vlv_data; /* if type == IMPORT_MERGE_THANG_VLV */ >@@ -662,17 +669,17 @@ > int ret = 0; > time_t beginning = 0; > time_t end = 0; > int passes = job->current_pass; > > if (1 == job->number_indexers) { > import_log_notice(job, "Beginning %d-way merge of one file...", passes); > } else { >- import_log_notice(job, "Beginning %d-way merge of up to %lu files...", >+ import_log_notice(job, "Beginning %d-way merge of up to %" PRIuPTR " files...", > passes, job->number_indexers); > } > > time(&beginning); > /* Iterate over the files */ > for (current_worker = job->worker_list; > (ret == 0) && (current_worker != NULL); > current_worker = current_worker->next) { >Index: ldapserver/ldap/servers/slapd/back-ldbm/import-threads.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/import-threads.c,v >retrieving revision 1.15 >diff -u -8 -r1.15 import-threads.c >--- ldapserver/ldap/servers/slapd/back-ldbm/import-threads.c 25 Jan 2008 00:59:00 -0000 1.15 >+++ ldapserver/ldap/servers/slapd/back-ldbm/import-threads.c 1 Oct 2008 13:15:56 -0000 >@@ -44,23 +44,31 @@ > * the threads that make up an import: > * producer (1) > * foreman (1) > * worker (N: 1 for each index) > * > * a wire import (aka "fast replica" import) won't have a producer thread. > */ > >+/* Required to get portable printf/scanf format macros */ >+#ifdef HAVE_INTTYPES_H >+#include <inttypes.h> >+#else >+#error Need to define portable format macros such as PRIu64 >+#endif /* HAVE_INTTYPES_H */ >+ > #include "back-ldbm.h" > #include "vlv_srch.h" > #include "import.h" > #ifdef XP_WIN32 > #define STDIN_FILENO 0 > #endif > >+static void import_wait_for_space_in_fifo(ImportJob *job, size_t new_esize); > > static struct backentry *import_make_backentry(Slapi_Entry *e, ID id) > { > struct backentry *ep = backentry_alloc(); > > if (NULL != ep) { > ep->ep_entry = e; > ep->ep_id = id; >@@ -565,18 +573,18 @@ > > newesize = (slapi_entry_size(ep->ep_entry) + sizeof(struct backentry)); > if (newesize > job->fifo.bsize) { /* entry too big */ > char ebuf[BUFSIZ]; > import_log_notice(job, "WARNING: skipping entry \"%s\" " > "ending line %d of file \"%s\"", > escape_string(slapi_entry_get_dn(e), ebuf), > curr_lineno, curr_filename); >- import_log_notice(job, "REASON: entry too large (%d bytes) for " >- "the buffer size (%d bytes)", newesize, job->fifo.bsize); >+ import_log_notice(job, "REASON: entry too large (%ld bytes) for " >+ "the buffer size (%" PRIuPTR " bytes)", newesize, job->fifo.bsize); > backentry_free(&ep); > job->skipped++; > continue; > } > /* Now check if fifo has enough space for the new entry */ > if ((job->fifo.c_bsize + newesize) > job->fifo.bsize) { > import_wait_for_space_in_fifo( job, newesize ); > } >@@ -799,18 +807,18 @@ > backentry_free(&old_ep); > } > > newesize = (slapi_entry_size(ep->ep_entry) + sizeof(struct backentry)); > if (newesize > job->fifo.bsize) { /* entry too big */ > char ebuf[BUFSIZ]; > import_log_notice(job, "WARNING: skipping entry \"%s\"", > escape_string(slapi_entry_get_dn(e), ebuf)); >- import_log_notice(job, "REASON: entry too large (%d bytes) for " >- "the buffer size (%d bytes)", newesize, job->fifo.bsize); >+ import_log_notice(job, "REASON: entry too large (%" PRIuPTR " bytes) for " >+ "the buffer size (%" PRIuPTR " bytes)", newesize, job->fifo.bsize); > backentry_free(&ep); > job->skipped++; > continue; > } > /* Now check if fifo has enough space for the new entry */ > if ((job->fifo.c_bsize + newesize) > job->fifo.bsize) { > import_wait_for_space_in_fifo( job, newesize ); > } >@@ -1180,17 +1188,17 @@ > backend *be = inst->inst_be; > PRIntervalTime sleeptime; > int finished = 0; > ID id = info->first_ID; > int ret = 0; > int idl_disposition = 0; > struct vlvIndex* vlv_index = NULL; > void *substring_key_buffer = NULL; >- FifoItem *fi; >+ FifoItem *fi = NULL; > int is_objectclass_attribute; > int is_nsuniqueid_attribute; > void *attrlist_cursor; > > PR_ASSERT(NULL != info); > PR_ASSERT(NULL != inst); > > if (job->flags & FLAG_ABORT) { >@@ -1593,18 +1601,18 @@ > backentry_free(&old_ep); > } > > newesize = (slapi_entry_size(ep->ep_entry) + sizeof(struct backentry)); > if (newesize > job->fifo.bsize) { /* entry too big */ > char ebuf[BUFSIZ]; > import_log_notice(job, "WARNING: skipping entry \"%s\"", > escape_string(slapi_entry_get_dn(ep->ep_entry), ebuf)); >- import_log_notice(job, "REASON: entry too large (%d bytes) for " >- "the import buffer size (%d bytes). Try increasing nsslapd-cachememsize.", newesize, job->fifo.bsize); >+ import_log_notice(job, "REASON: entry too large (%" PRIuPTR " bytes) for " >+ "the import buffer size (%" PRIuPTR " bytes). Try increasing nsslapd-cachememsize.", newesize, job->fifo.bsize); > backentry_clear_entry(ep); /* entry is released in the frontend on failure*/ > backentry_free( &ep ); /* release the backend wrapper, here */ > PR_Unlock(job->wire_lock); > return -1; > } > /* Now check if fifo has enough space for the new entry */ > if ((job->fifo.c_bsize + newesize) > job->fifo.bsize) { > import_wait_for_space_in_fifo( job, newesize ); >@@ -1665,17 +1673,17 @@ > * On success (rc=0), the entry in pb->pb_import_entry will be > * consumed. For any other return value, the caller is > * responsible for freeing the entry in the pb. > */ > int ldbm_back_wire_import(Slapi_PBlock *pb) > { > struct ldbminfo *li; > backend *be = NULL; >- ImportJob *job; >+ ImportJob *job = NULL; > PRThread *thread; > int state; > > slapi_pblock_get(pb, SLAPI_BACKEND, &be); > PR_ASSERT(be != NULL); > li = (struct ldbminfo *)(be->be_database->plg_private); > slapi_pblock_get(pb, SLAPI_BULK_IMPORT_STATE, &state); > if (state == SLAPI_BI_STATE_START) { >@@ -1949,17 +1957,17 @@ > Slapi_Entry *e = NULL; > estr = import_get_entry(&c, fd, &curr_lineno); > > if (!estr) > break; > > if (entry_filter != NULL) /* Single instance restoration */ > { >- if (!(int)strstr(estr, entry_filter)) >+ if (NULL == strstr(estr, entry_filter)) > continue; > } > > e = slapi_str2entry(estr, 0); > slapi_ch_free_string(&estr); > if (!e) { > LDAPDebug(LDAP_DEBUG_ANY, "WARNING: skipping bad LDIF entry " > "ending line %d of file \"%s\"", curr_lineno, filename, 0); >Index: ldapserver/ldap/servers/slapd/back-ldbm/import.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/import.c,v >retrieving revision 1.11 >diff -u -8 -r1.11 import.c >--- ldapserver/ldap/servers/slapd/back-ldbm/import.c 3 Apr 2008 16:52:47 -0000 1.11 >+++ ldapserver/ldap/servers/slapd/back-ldbm/import.c 1 Oct 2008 13:15:56 -0000 >@@ -41,16 +41,22 @@ > #endif > > /* > * the "new" ("deluxe") backend import code > * > * please make sure you use 4-space indentation on this file. > */ > >+/* Required to get portable printf/scanf format macros */ >+#ifdef HAVE_INTTYPES_H >+#include <inttypes.h> >+#else >+#error Need to define portable format macros such as PRIu64 >+#endif /* HAVE_INTTYPES_H */ > > #include "back-ldbm.h" > #include "vlv_srch.h" > #include "import.h" > > #define ERR_IMPORT_ABORTED -23 > > >@@ -1144,17 +1150,17 @@ > goto error; > } > } > > if (0 == job->job_index_buffer_suggestion) > import_log_notice(job, "Index buffering is disabled."); > else > import_log_notice(job, >- "Index buffering enabled with bucket size %lu", >+ "Index buffering enabled with bucket size %" PRIuPTR, > job->job_index_buffer_suggestion); > > job->worker_list = producer; > } else { > /* release the startup lock and let the entries start queueing up > * in for import */ > PR_Lock(job->wire_lock); > PR_NotifyCondVar(job->wire_cv); >@@ -1307,41 +1313,41 @@ > int seconds_to_import = end - beginning; > size_t entries_processed = job->lead_ID - (job->starting_ID - 1); > double entries_per_second = (double) entries_processed / > (double) seconds_to_import; > > if (job->not_here_skipped) > { > if (job->skipped) >- import_log_notice(job, "Import complete. Processed %lu entries " >+ import_log_notice(job, "Import complete. Processed %" PRIuPTR " entries " > "(%d bad entries were skipped, " > "%d entries were skipped because they don't " > "belong to this database) in %d seconds. " > "(%.2f entries/sec)", entries_processed, > job->skipped, job->not_here_skipped, > seconds_to_import, entries_per_second); > else >- import_log_notice(job, "Import complete. Processed %lu entries " >+ import_log_notice(job, "Import complete. Processed %" PRIuPTR " entries " > "(%d entries were skipped because they don't " > "belong to this database) " > "in %d seconds. (%.2f entries/sec)", > entries_processed, job->not_here_skipped, > seconds_to_import, entries_per_second); > } > else > { > if (job->skipped) >- import_log_notice(job, "Import complete. Processed %lu entries " >+ import_log_notice(job, "Import complete. Processed %" PRIuPTR " entries " > "(%d were skipped) in %d seconds. " > "(%.2f entries/sec)", entries_processed, > job->skipped, seconds_to_import, > entries_per_second); > else >- import_log_notice(job, "Import complete. Processed %lu entries " >+ import_log_notice(job, "Import complete. Processed %" PRIuPTR " entries " > "in %d seconds. (%.2f entries/sec)", > entries_processed, seconds_to_import, > entries_per_second); > } > } > > if (0 != ret) { > import_log_notice(job, "Import failed."); >Index: ldapserver/ldap/servers/slapd/back-ldbm/import.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/import.h,v >retrieving revision 1.8 >diff -u -8 -r1.8 import.h >--- ldapserver/ldap/servers/slapd/back-ldbm/import.h 10 Nov 2006 23:45:39 -0000 1.8 >+++ ldapserver/ldap/servers/slapd/back-ldbm/import.h 1 Oct 2008 13:15:56 -0000 >@@ -230,9 +230,8 @@ > int add_op_attrs(Slapi_PBlock *pb, struct ldbminfo *li, struct backentry *ep, > int *status); > > /* import-threads.c */ > void import_producer(void *param); > void index_producer(void *param); > void import_foreman(void *param); > void import_worker(void *param); >-static void import_wait_for_space_in_fifo(ImportJob *job, size_t new_esize); >Index: ldapserver/ldap/servers/slapd/back-ldbm/ldbm_attr.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_attr.c,v >retrieving revision 1.10 >diff -u -8 -r1.10 ldbm_attr.c >--- ldapserver/ldap/servers/slapd/back-ldbm/ldbm_attr.c 15 Jul 2008 16:49:43 -0000 1.10 >+++ ldapserver/ldap/servers/slapd/back-ldbm/ldbm_attr.c 1 Oct 2008 13:15:56 -0000 >@@ -253,26 +253,26 @@ > if (!strcasecmp (index_rules[j], officialOID)) { > official_rules[k++] = slapi_ch_strdup (officialOID); > } else { > char* preamble = slapi_ch_smprintf("%s: line %d", fname, lineno); > LDAPDebug (LDAP_DEBUG_ANY, "%s: use \"%s\" instead of \"%s\" (ignored)\n", > preamble, officialOID, index_rules[j] ); > slapi_ch_free((void**)&preamble); > } >- } else if (p = >- strstr(index_rules[j], INDEX_ATTR_SUBSTRBEGIN)) { >+ } else if ((p = >+ strstr(index_rules[j], INDEX_ATTR_SUBSTRBEGIN))) { > _set_attr_substrlen(INDEX_SUBSTRBEGIN, index_rules[j], > &substrlens); >- } else if (p = >- strstr(index_rules[j], INDEX_ATTR_SUBSTRMIDDLE)) { >+ } else if ((p = >+ strstr(index_rules[j], INDEX_ATTR_SUBSTRMIDDLE))) { > _set_attr_substrlen(INDEX_SUBSTRMIDDLE, index_rules[j], > &substrlens); >- } else if (p = >- strstr(index_rules[j], INDEX_ATTR_SUBSTREND)) { >+ } else if ((p = >+ strstr(index_rules[j], INDEX_ATTR_SUBSTREND))) { > _set_attr_substrlen(INDEX_SUBSTREND, index_rules[j], > &substrlens); > } else if (!slapi_matchingrule_is_ordering(index_rules[j], attrsyntax_oid)) { > LDAPDebug (LDAP_DEBUG_ANY, "%s: line %d: " > "unknown or invalid matching rule \"%s\" in index configuration (ignored)\n", > fname, lineno, index_rules[j] ); > } else { /* assume builtin and use compare fn provided by syntax plugin */ > need_compare_fn = 1; >Index: ldapserver/ldap/servers/slapd/back-ldbm/ldbm_config.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_config.c,v >retrieving revision 1.14 >diff -u -8 -r1.14 ldbm_config.c >--- ldapserver/ldap/servers/slapd/back-ldbm/ldbm_config.c 4 Dec 2007 00:50:19 -0000 1.14 >+++ ldapserver/ldap/servers/slapd/back-ldbm/ldbm_config.c 1 Oct 2008 13:15:56 -0000 >@@ -37,16 +37,23 @@ > * END COPYRIGHT BLOCK **/ > > #ifdef HAVE_CONFIG_H > # include <config.h> > #endif > > /* ldbm_config.c - Handles configuration information that is global to all ldbm instances. */ > >+/* Required to get portable printf/scanf format macros */ >+#ifdef HAVE_INTTYPES_H >+#include <inttypes.h> >+#else >+#error Need to define portable format macros such as PRIu64 >+#endif /* HAVE_INTTYPES_H */ >+ > #include "back-ldbm.h" > #include "dblayer.h" > > /* Forward declarations */ > static int parse_ldbm_config_entry(struct ldbminfo *li, Slapi_Entry *e, config_info *config_array); > > /* Forward callback declarations */ > int ldbm_config_search_entry_callback(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg); >@@ -142,68 +149,68 @@ > > /*------------------------------------------------------------------------ > * Get and set functions for ldbm and dblayer variables > *----------------------------------------------------------------------*/ > static void *ldbm_config_lookthroughlimit_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) (li->li_lookthroughlimit); >+ return (void *) ((uintptr_t)(li->li_lookthroughlimit)); > } > > static int ldbm_config_lookthroughlimit_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > /* Do whatever we can to make sure the data is ok. */ > > if (apply) { > li->li_lookthroughlimit = val; > } > > return retval; > } > > static void *ldbm_config_mode_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) (li->li_mode); >+ return (void *) ((uintptr_t)(li->li_mode)); > } > > static int ldbm_config_mode_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > /* Do whatever we can to make sure the data is ok. */ > > if (apply) { > li->li_mode = val; > } > > return retval; > } > > static void *ldbm_config_allidsthreshold_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) (li->li_allidsthreshold); >+ return (void *) ((uintptr_t)(li->li_allidsthreshold)); > } > > static int ldbm_config_allidsthreshold_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > /* Do whatever we can to make sure the data is ok. */ > > /* Catch attempts to configure a stupidly low allidsthreshold */ > if (val < 100) { > val = 100; > } > >@@ -360,24 +367,24 @@ > > return retval; > } > > static void *ldbm_config_maxpassbeforemerge_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) (li->li_maxpassbeforemerge); >+ return (void *) ((uintptr_t)(li->li_maxpassbeforemerge)); > } > > static int ldbm_config_maxpassbeforemerge_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > if (val < 0) { > LDAPDebug( LDAP_DEBUG_ANY,"WARNING: maxpassbeforemerge will not take negative value\n", 0, 0, 0); > val = 100; > } > > li->li_maxpassbeforemerge = val; >@@ -386,24 +393,24 @@ > return retval; > } > > > static void *ldbm_config_dbncache_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) (li->li_new_dbncache); >+ return (void *) ((uintptr_t)(li->li_new_dbncache)); > } > > static int ldbm_config_dbncache_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > if (val < 0) { > LDAPDebug( LDAP_DEBUG_ANY,"WARNING: ncache will not take negative value\n", 0, 0, 0); > val = 0; > } > > if (CONFIG_PHASE_RUNNING == phase) { >@@ -449,90 +456,90 @@ > > return retval; > } > > static void *ldbm_config_db_durable_transactions_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_durable_transactions; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_durable_transactions); > } > > static int ldbm_config_db_durable_transactions_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_durable_transactions = val; > } > > return retval; > } > > static void *ldbm_config_db_lockdown_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_lockdown; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_lockdown); > } > > static int ldbm_config_db_lockdown_set( > void *arg, > void *value, > char *errorbuf, > int phase, > int apply > ) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_lockdown = val; > } > > return retval; > } > > static void *ldbm_config_db_circular_logging_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_circular_logging; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_circular_logging); > } > > static int ldbm_config_db_circular_logging_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_circular_logging = val; > } > > return retval; > } > > static void *ldbm_config_db_transaction_logging_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_enable_transactions; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_enable_transactions); > } > > static int ldbm_config_db_transaction_logging_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_enable_transactions = val; > } > > return retval; > } > >@@ -555,24 +562,24 @@ > > return retval; > } > > static void *ldbm_config_db_checkpoint_interval_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_checkpoint_interval; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_checkpoint_interval); > } > > static int ldbm_config_db_checkpoint_interval_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_checkpoint_interval = val; > } > > return retval; > } > >@@ -615,24 +622,24 @@ > > return retval; > } > > static void *ldbm_config_db_idl_divisor_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_idl_divisor; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_idl_divisor); > } > > static int ldbm_config_db_idl_divisor_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_idl_divisor = val; > } > > return retval; > } > >@@ -655,44 +662,44 @@ > > return retval; > } > > static void *ldbm_config_db_spin_count_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_spin_count; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_spin_count); > } > > static int ldbm_config_db_spin_count_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_spin_count = val; > } > > return retval; > } > > static void *ldbm_config_db_trickle_percentage_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_trickle_percentage; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_trickle_percentage); > } > > static int ldbm_config_db_trickle_percentage_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (val < 0 || val > 100) { > PR_snprintf(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, > "Error: Invalid value for %s (%d). Must be between 0 and 100\n", CONFIG_DB_TRICKLE_PERCENTAGE, val); > LDAPDebug(LDAP_DEBUG_ANY, "%s", errorbuf, 0, 0); > return LDAP_UNWILLING_TO_PERFORM; > } > >@@ -702,104 +709,104 @@ > > return retval; > } > > static void *ldbm_config_db_verbose_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_verbose; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_verbose); > } > > static int ldbm_config_db_verbose_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_verbose = val; > } > > return retval; > } > > static void *ldbm_config_db_debug_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_debug; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_debug); > } > > static int ldbm_config_db_debug_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_debug = val; > } > > return retval; > } > > static void *ldbm_config_db_named_regions_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_named_regions; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_named_regions); > } > > static int ldbm_config_db_named_regions_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_named_regions = val; > } > > return retval; > } > > static void *ldbm_config_db_private_mem_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_private_mem; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_private_mem); > } > > static int ldbm_config_db_private_mem_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_private_mem = val; > } > > return retval; > } > > static void *ldbm_config_db_private_import_mem_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_private_import_mem; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_private_import_mem); > } > > static int ldbm_config_db_private_import_mem_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_private_import_mem = val; > } > > return retval; > } > >@@ -815,30 +822,30 @@ > void *value, > char *errorbuf, > int phase, > int apply > ) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_shm_key = val; > } > > return retval; > } > > static void *ldbm_config_db_lock_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_lock_config; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_lock_config); > } > > > static int ldbm_config_db_lock_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; > size_t val = (size_t) value; >@@ -854,44 +861,44 @@ > } > > return retval; > } > static void *ldbm_config_db_cache_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_cache_config; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_cache_config); > } > > static int ldbm_config_db_cache_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_cache_config = val; > } > > return retval; > } > > static void *ldbm_config_db_debug_checkpointing_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->db_debug_checkpointing; >+ return (void *) ((uintptr_t)li->li_dblayer_private->db_debug_checkpointing); > } > > static int ldbm_config_db_debug_checkpointing_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->db_debug_checkpointing = val; > } > > return retval; > } > >@@ -917,60 +924,60 @@ > > return retval; > } > > static void *ldbm_config_import_cache_autosize_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *)arg; > >- return (void *)(li->li_import_cache_autosize); >+ return (void *)((uintptr_t)(li->li_import_cache_autosize)); > } > > static int ldbm_config_import_cache_autosize_set(void *arg, void *value, char *errorbuf, > int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *)arg; > > if (apply) >- li->li_import_cache_autosize = (int)value; >+ li->li_import_cache_autosize = (int)((uintptr_t)value); > return LDAP_SUCCESS; > } > > static void *ldbm_config_cache_autosize_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *)arg; > >- return (void *)(li->li_cache_autosize); >+ return (void *)((uintptr_t)(li->li_cache_autosize)); > } > > static int ldbm_config_cache_autosize_set(void *arg, void *value, char *errorbuf, > int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *)arg; > > if (apply) >- li->li_cache_autosize = (int)value; >+ li->li_cache_autosize = (int)((uintptr_t)value); > return LDAP_SUCCESS; > } > > static void *ldbm_config_cache_autosize_split_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *)arg; > >- return (void *)(li->li_cache_autosize_split); >+ return (void *)((uintptr_t)(li->li_cache_autosize_split)); > } > > static int ldbm_config_cache_autosize_split_set(void *arg, void *value, char *errorbuf, > int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *)arg; > > if (apply) >- li->li_cache_autosize_split = (int)value; >+ li->li_cache_autosize_split = (int)((uintptr_t)value); > return LDAP_SUCCESS; > } > > static void *ldbm_config_import_cachesize_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *)arg; > > return (void *)(li->li_import_cachesize); >@@ -1016,45 +1023,45 @@ > idl_set_tune(0); > return LDAP_SUCCESS; > } > > static void *ldbm_config_serial_lock_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_fat_lock; >+ return (void *) ((uintptr_t)li->li_fat_lock); > } > > static int ldbm_config_serial_lock_set(void *arg, void *value, char *errorbuf, > int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > > if (apply) { >- li->li_fat_lock = (int) value; >+ li->li_fat_lock = (int) ((uintptr_t)value); > } > > return LDAP_SUCCESS; > } > > static void *ldbm_config_legacy_errcode_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_legacy_errcode; >+ return (void *) ((uintptr_t)li->li_legacy_errcode); > } > > static int ldbm_config_legacy_errcode_set(void *arg, void *value, char *errorbuf, > int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > > if (apply) { >- li->li_legacy_errcode = (int) value; >+ li->li_legacy_errcode = (int) ((uintptr_t)value); > } > > return LDAP_SUCCESS; > } > > static int > ldbm_config_set_bypass_filter_test(void *arg, void *value, char *errorbuf, > int phase, int apply) >@@ -1094,33 +1101,33 @@ > retstr = slapi_ch_strdup("off"); > } > return (void *)retstr; > } > > static int ldbm_config_set_use_vlv_index(void *arg, void *value, char *errorbuf, int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *) arg; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > if (val) { > li->li_use_vlv = 1; > } else { > li->li_use_vlv = 0; > } > } > return LDAP_SUCCESS; > } > > static void *ldbm_config_get_use_vlv_index(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_use_vlv; >+ return (void *) ((uintptr_t)li->li_use_vlv); > } > > static int > ldbm_config_exclude_from_export_set( void *arg, void *value, char *errorbuf, > int phase, int apply) > { > struct ldbminfo *li = (struct ldbminfo *)arg; > >@@ -1169,30 +1176,30 @@ > > return (void *)retstr; > } > > static void *ldbm_config_db_tx_max_get(void *arg) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > >- return (void *) li->li_dblayer_private->dblayer_tx_max; >+ return (void *) ((uintptr_t)li->li_dblayer_private->dblayer_tx_max); > } > > static int ldbm_config_db_tx_max_set( > void *arg, > void *value, > char *errorbuf, > int phase, > int apply > ) > { > struct ldbminfo *li = (struct ldbminfo *) arg; > int retval = LDAP_SUCCESS; >- int val = (int) value; >+ int val = (int) ((uintptr_t)value); > > if (apply) { > li->li_dblayer_private->dblayer_tx_max = val; > } > > return retval; > } > >@@ -1404,37 +1411,37 @@ > size_t val = 0; > > if (config == NULL) { > buf[0] = '\0'; > } > > switch(config->config_type) { > case CONFIG_TYPE_INT: >- sprintf(buf, "%d", (int) config->config_get_fn(arg)); >+ sprintf(buf, "%d", (int) ((uintptr_t)config->config_get_fn(arg))); > break; > case CONFIG_TYPE_INT_OCTAL: >- sprintf(buf, "%o", (int) config->config_get_fn(arg)); >+ sprintf(buf, "%o", (int) ((uintptr_t)config->config_get_fn(arg))); > break; > case CONFIG_TYPE_LONG: > sprintf(buf, "%ld", (long) config->config_get_fn(arg)); > break; > case CONFIG_TYPE_SIZE_T: > val = (size_t) config->config_get_fn(arg); >- sprintf(buf, "%lu", val); >+ sprintf(buf, "%" PRIuPTR, val); > break; > case CONFIG_TYPE_STRING: > /* Remember the get function for strings returns memory > * that must be freed. */ > tmp_string = (char *) config->config_get_fn(arg); > PR_snprintf(buf, BUFSIZ, "%s", (char *) tmp_string); > slapi_ch_free((void **)&tmp_string); > break; > case CONFIG_TYPE_ONOFF: >- if ((int) config->config_get_fn(arg)) { >+ if ((int) ((uintptr_t)config->config_get_fn(arg))) { > sprintf(buf, "on"); > } else { > sprintf(buf, "off"); > } > break; > } > } > >@@ -1573,25 +1580,25 @@ > } else if (LL_CMP(llval, <, llminint)) { > PR_snprintf(err_buf, SLAPI_DSE_RETURNTEXT_SIZE, "Error: value %s for attr %s is less than the minimum %d\n", > str_val, attr_name, minint); > LDAPDebug(LDAP_DEBUG_ANY, "%s", err_buf, 0, 0); > return LDAP_UNWILLING_TO_PERFORM; > } > /* convert 64 bit value to 32 bit value */ > LL_L2I(int_val, llval); >- retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); >+ retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); > break; > case CONFIG_TYPE_INT_OCTAL: > if (use_default) { > int_val = (int) strtol(config->config_default_value, NULL, 8); > } else { > int_val = (int) strtol((char *)bval->bv_val, NULL, 8); > } >- retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); >+ retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); > break; > case CONFIG_TYPE_LONG: > if (use_default) { > str_val = config->config_default_value; > } else { > str_val = bval->bv_val; > } > /* get the value as a 64 bit value */ >@@ -1652,17 +1659,17 @@ > } > break; > case CONFIG_TYPE_ONOFF: > if (use_default) { > int_val = !strcasecmp(config->config_default_value, "on"); > } else { > int_val = !strcasecmp((char *) bval->bv_val, "on"); > } >- retval = config->config_set_fn(arg, (void *) int_val, err_buf, phase, apply_mod); >+ retval = config->config_set_fn(arg, (void *) ((uintptr_t)int_val), err_buf, phase, apply_mod); > break; > } > > return retval; > } > > > static int parse_ldbm_config_entry(struct ldbminfo *li, Slapi_Entry *e, config_info *config_array) >Index: ldapserver/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c,v >retrieving revision 1.10 >diff -u -8 -r1.10 ldbm_instance_config.c >--- ldapserver/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c 4 Dec 2007 00:50:19 -0000 1.10 >+++ ldapserver/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c 1 Oct 2008 13:15:56 -0000 >@@ -131,17 +131,17 @@ > return retval; > } > > static void * > ldbm_instance_config_readonly_get(void *arg) > { > ldbm_instance *inst = (ldbm_instance *)arg; > >- return (void *)inst->inst_be->be_readonly; >+ return (void *)((uintptr_t)inst->inst_be->be_readonly); > } > > static void * > ldbm_instance_config_instance_dir_get(void *arg) > { > ldbm_instance *inst = (ldbm_instance *)arg; > > if (inst->inst_dir_name == NULL) >@@ -160,17 +160,17 @@ > return slapi_ch_strdup(inst->inst_dir_name); > } > > static void * > ldbm_instance_config_require_index_get(void *arg) > { > ldbm_instance *inst = (ldbm_instance *)arg; > >- return (void *)inst->require_index; >+ return (void *)((uintptr_t)inst->require_index); > } > > static int > ldbm_instance_config_instance_dir_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > ldbm_instance *inst = (ldbm_instance *)arg; > > if (!apply) { >@@ -214,50 +214,51 @@ > } > return LDAP_SUCCESS; > } > > static int > ldbm_instance_config_readonly_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > ldbm_instance *inst = (ldbm_instance *)arg; >+ uintptr_t pval = (uintptr_t)value; > > if (!apply) { > return LDAP_SUCCESS; > } > > if (CONFIG_PHASE_RUNNING == phase) { > /* if the instance is busy, we'll save the user's readonly settings > * but won't change them until the instance is un-busy again. > */ > if (! (inst->inst_flags & INST_FLAG_BUSY)) { >- slapi_mtn_be_set_readonly(inst->inst_be, (int)value); >+ slapi_mtn_be_set_readonly(inst->inst_be, (int)pval); > } >- if ((int)value) { >+ if ((int)pval) { > inst->inst_flags |= INST_FLAG_READONLY; > } else { > inst->inst_flags &= ~INST_FLAG_READONLY; > } > } else { >- slapi_be_set_readonly(inst->inst_be, (int)value); >+ slapi_be_set_readonly(inst->inst_be, (int)pval); > } > > return LDAP_SUCCESS; > } > > static int > ldbm_instance_config_require_index_set(void *arg, void *value, char *errorbuf, int phase, int apply) > { > ldbm_instance *inst = (ldbm_instance *)arg; > > if (!apply) { > return LDAP_SUCCESS; > } > >- inst->require_index = (int)value; >+ inst->require_index = (int)((uintptr_t)value); > > return LDAP_SUCCESS; > } > > > /*------------------------------------------------------------------------ > * ldbm instance configuration array > *----------------------------------------------------------------------*/ >Index: ldapserver/ldap/servers/slapd/back-ldbm/ldbm_modify.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_modify.c,v >retrieving revision 1.6 >diff -u -8 -r1.6 ldbm_modify.c >--- ldapserver/ldap/servers/slapd/back-ldbm/ldbm_modify.c 18 Oct 2007 22:40:18 -0000 1.6 >+++ ldapserver/ldap/servers/slapd/back-ldbm/ldbm_modify.c 1 Oct 2008 13:15:57 -0000 >@@ -573,30 +573,30 @@ > int have_effect = 1; > int j; > > /* Mods have effect if there is at least a non-replace mod or > * a non-null-value mod. > */ > for ( j = 0; j < smods->num_mods - 1; j++ ) { > if ( (mod = smods->mods[j]) != NULL ) { >- if ( (mod->mod_op & LDAP_MOD_REPLACE) == 0 || >- mod->mod_vals.modv_bvals && >- strcasecmp (mod->mod_type, "modifiersname") && >- strcasecmp (mod->mod_type, "modifytime") ) { >+ if ( ((mod->mod_op & LDAP_MOD_REPLACE) == 0) || >+ (mod->mod_vals.modv_bvals && >+ strcasecmp (mod->mod_type, "modifiersname") && >+ strcasecmp (mod->mod_type, "modifytime") ) ) { > goto done; > } > } > } > > if ( entry && entry->e_sdn.dn ) { > for ( j = 0; j < smods->num_mods - 1; j++ ) { >- if ( (mod = smods->mods[j]) != NULL && >- strcasecmp (mod->mod_type, "modifiersname") && >- strcasecmp (mod->mod_type, "modifytime") ) { >+ if ( ((mod = smods->mods[j]) != NULL) && >+ strcasecmp (mod->mod_type, "modifiersname") && >+ strcasecmp (mod->mod_type, "modifytime") ) { > for ( attr = entry->e_attrs; attr; attr = attr->a_next ) { > /* Mods have effect if at least a null-value-mod is > * to actually remove an existing attribute > */ > if ( strcasecmp ( mod->mod_type, attr->a_type ) == 0 ) { > goto done; > } > } >Index: ldapserver/ldap/servers/slapd/back-ldbm/ldif2ldbm.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldif2ldbm.c,v >retrieving revision 1.16 >diff -u -8 -r1.16 ldif2ldbm.c >--- ldapserver/ldap/servers/slapd/back-ldbm/ldif2ldbm.c 3 Apr 2008 16:52:47 -0000 1.16 >+++ ldapserver/ldap/servers/slapd/back-ldbm/ldif2ldbm.c 1 Oct 2008 13:15:57 -0000 >@@ -42,16 +42,23 @@ > > /* ldif2ldbm.c > * > * common functions for import (old and new) and export > * the export code (db2ldif) > * code for db2index (is this still in use?) > */ > >+/* Required to get portable printf/scanf format macros */ >+#ifdef HAVE_INTTYPES_H >+#include <inttypes.h> >+#else >+#error Need to define portable format macros such as PRIu64 >+#endif /* HAVE_INTTYPES_H */ >+ > #include "back-ldbm.h" > #include "vlv_srch.h" > #include "dblayer.h" > #include "import.h" > > static char *sourcefile = "ldif2ldbm.c"; > > >@@ -71,27 +78,27 @@ > } > > size_t import_get_index_buffer_size() { > return import_config_index_buffer_size; > } > > static PRIntn import_subcount_hash_compare_keys(const void *v1, const void *v2) > { >- return( ((ID)v1 == (ID)v2 ) ? 1 : 0); >+ return( ((ID)((uintptr_t)v1) == (ID)((uintptr_t)v2) ) ? 1 : 0); > } > > static PRIntn import_subcount_hash_compare_values(const void *v1, const void *v2) > { > return( ((size_t)v1 == (size_t)v2 ) ? 1 : 0); > } > > static PLHashNumber import_subcount_hash_fn(const void *id) > { >- return (PLHashNumber) id; >+ return (PLHashNumber) ((uintptr_t)id); > } > > void import_subcount_stuff_init(import_subcount_stuff *stuff) > { > stuff->hashtable = PL_NewHashTable(IMPORT_SUBCOUNT_HASHTABLE_SIZE, > import_subcount_hash_fn, import_subcount_hash_compare_keys, > import_subcount_hash_compare_values, NULL, NULL); > } >@@ -258,50 +265,50 @@ > > /********** functions for maintaining the subordinate count **********/ > > /* Update subordinate count in a hint list, given the parent's ID */ > int import_subcount_mother_init(import_subcount_stuff *mothers, ID parent_id, > size_t count) > { > PR_ASSERT(NULL == PL_HashTableLookup(mothers->hashtable,(void*)parent_id)); >- PL_HashTableAdd(mothers->hashtable,(void*)parent_id,(void*)count); >+ PL_HashTableAdd(mothers->hashtable,(void*)((uintptr_t)parent_id),(void*)count); > return 0; > } > > /* Look for a subordinate count in a hint list, given the parent's ID */ > static int import_subcount_mothers_lookup(import_subcount_stuff *mothers, > ID parent_id, size_t *count) > { > size_t stored_count = 0; > > *count = 0; > /* Lookup hash table for ID */ > stored_count = (size_t)PL_HashTableLookup(mothers->hashtable, >- (void*)parent_id); >+ (void*)((uintptr_t)parent_id)); > /* If present, return the count found */ > if (0 != stored_count) { > *count = stored_count; > return 0; > } > return -1; > } > > /* Update subordinate count in a hint list, given the parent's ID */ > int import_subcount_mother_count(import_subcount_stuff *mothers, ID parent_id) > { > size_t stored_count = 0; > > /* Lookup the hash table for the target ID */ > stored_count = (size_t)PL_HashTableLookup(mothers->hashtable, >- (void*)parent_id); >+ (void*)((uintptr_t)parent_id)); > PR_ASSERT(0 != stored_count); > /* Increment the count */ > stored_count++; >- PL_HashTableAdd(mothers->hashtable, (void*)parent_id, (void*)stored_count); >+ PL_HashTableAdd(mothers->hashtable, (void*)((uintptr_t)parent_id), (void*)stored_count); > return 0; > } > > static int import_update_entry_subcount(backend *be, ID parentid, > size_t sub_count) > { > ldbm_instance *inst = (ldbm_instance *) be->be_instance_info; > int ret = 0; >@@ -315,17 +322,17 @@ > if ( (NULL == e) || (0 != ret)) { > ldbm_nasty(sourcefile,5,ret); > return (0 == ret) ? -1 : ret; > } > /* Lock it (not really required since we're single-threaded here, but > * let's do it so we can reuse the modify routines) */ > cache_lock_entry( &inst->inst_cache, e ); > modify_init(&mc,e); >- sprintf(value_buffer,"%lu",sub_count); >+ sprintf(value_buffer,"%" PRIuPTR,sub_count); > /* attr numsubordinates could already exist in the entry, > let's check whether it's already there or not */ > isreplace = (attrlist_find(e->ep_entry->e_attrs, numsubordinates) != NULL); > { > int op = isreplace ? LDAP_MOD_REPLACE : LDAP_MOD_ADD; > Slapi_Mods *smods= slapi_mods_new(); > > slapi_mods_add(smods, op | LDAP_MOD_BVALUES, numsubordinates, >@@ -756,22 +763,22 @@ > IDList *idl = NULL; /* optimization for -s include lists */ > int cnt = 0, lastcnt = 0; > int options = 0; > int keepgoing = 1; > int isfirst = 1; > int appendmode = 0; > int appendmode_1 = 0; > int noversion = 0; >- ID lastid; >+ ID lastid = 0; > int task_flags; > Slapi_Task *task; > int run_from_cmdline = 0; > char *instance_name; >- ldbm_instance *inst; >+ ldbm_instance *inst = NULL; > int str2entry_options= 0; > int retry; > int we_start_the_backends = 0; > int server_running; > > LDAPDebug( LDAP_DEBUG_TRACE, "=> ldbm_back_ldbm2ldif\n", 0, 0, 0 ); > > slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li ); >@@ -1807,17 +1814,16 @@ > err_out: > backentry_free( &ep ); /* if ep or *ep is NULL, it does nothing */ > if (idl) { > idl_free(idl); > } else { > dbc->c_close(dbc); > } > if (return_value < 0) {/* error case: undo vlv indexing */ >- struct vlvIndex *vlvip = NULL; > /* if jumped to out due to an error, vlv lock has not been released */ > for ( vlvidx = 0; vlvidx < numvlv; vlvidx++ ) { > vlvIndex_go_offline(pvlv[vlvidx], be); > vlv_acquire_lock(be); > vlvIndex_delete(&pvlv[vlvidx]); > vlv_release_lock(be); > } > } >Index: ldapserver/ldap/servers/slapd/back-ldbm/monitor.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/monitor.c,v >retrieving revision 1.7 >diff -u -8 -r1.7 monitor.c >--- ldapserver/ldap/servers/slapd/back-ldbm/monitor.c 10 Nov 2006 23:45:39 -0000 1.7 >+++ ldapserver/ldap/servers/slapd/back-ldbm/monitor.c 1 Oct 2008 13:15:57 -0000 >@@ -37,16 +37,23 @@ > * END COPYRIGHT BLOCK **/ > > #ifdef HAVE_CONFIG_H > # include <config.h> > #endif > > /* monitor.c - ldbm backend monitor function */ > >+/* Required to get portable printf/scanf format macros */ >+#ifdef HAVE_INTTYPES_H >+#include <inttypes.h> >+#else >+#error Need to define portable format macros such as PRIu64 >+#endif /* HAVE_INTTYPES_H */ >+ > #include "back-ldbm.h" > #include "dblayer.h" /* XXXmcs: not sure this is good to do... */ > #include <sys/stat.h> > > > #define MSET(_attr) do { \ > val.bv_val = buf; \ > val.bv_len = strlen(buf); \ >@@ -112,19 +119,19 @@ > cache_get_stats(&(inst->inst_cache), &hits, &tries, > &nentries, &maxentries, &size, &maxsize); > sprintf(buf, "%lu", hits); > MSET("entryCacheHits"); > sprintf(buf, "%lu", tries); > MSET("entryCacheTries"); > sprintf(buf, "%lu", (unsigned long)(100.0*(double)hits / (double)(tries > 0 ? tries : 1))); > MSET("entryCacheHitRatio"); >- sprintf(buf, "%lu", size); >+ sprintf(buf, "%" PRIuPTR, size); > MSET("currentEntryCacheSize"); >- sprintf(buf, "%lu", maxsize); >+ sprintf(buf, "%" PRIuPTR, maxsize); > MSET("maxEntryCacheSize"); > sprintf(buf, "%ld", nentries); > MSET("currentEntryCacheCount"); > sprintf(buf, "%ld", maxentries); > MSET("maxEntryCacheCount"); > > #ifdef DEBUG > { >Index: ldapserver/ldap/servers/slapd/back-ldbm/parents.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/parents.c,v >retrieving revision 1.5 >diff -u -8 -r1.5 parents.c >--- ldapserver/ldap/servers/slapd/back-ldbm/parents.c 10 Nov 2006 23:45:39 -0000 1.5 >+++ ldapserver/ldap/servers/slapd/back-ldbm/parents.c 1 Oct 2008 13:15:57 -0000 >@@ -39,16 +39,23 @@ > #ifdef HAVE_CONFIG_H > # include <config.h> > #endif > > /* parents.c - where the adults live */ > > #include "back-ldbm.h" > >+/* Required to get portable printf/scanf format macros */ >+#ifdef HAVE_INTTYPES_H >+#include <inttypes.h> >+#else >+#error Need to define portable format macros such as PRIu64 >+#endif /* HAVE_INTTYPES_H */ >+ > char *numsubordinates = "numsubordinates"; > char *hassubordinates = "hassubordinates"; > > /* Routine where any in-memory modification of a parent entry happens on some state-change in > one of its children. vaid op values are: 1 == child entry newly added, 2 == child entry about to be > deleted; 3 == child modified, in which case childmods points to the modifications. The child entry > passed is in the state which reflects the mods having been appied. op ==3 HAS NOT BEEN IMPLEMENTED YET > The routine is allowed to modify the parent entry, and to return a set of LDAPMods reflecting >@@ -125,17 +132,17 @@ > Slapi_Mods *smods= slapi_mods_new(); > if (mod_op == LDAP_MOD_DELETE) > { > slapi_mods_add(smods, mod_op | LDAP_MOD_BVALUES, numsubordinates, 0, NULL); > } > else > { > char value_buffer[20]; /* enough digits for 2^64 children */ >- sprintf(value_buffer,"%lu", current_sub_count); >+ sprintf(value_buffer,"%" PRIuPTR, current_sub_count); > slapi_mods_add(smods, mod_op | LDAP_MOD_BVALUES, numsubordinates, strlen(value_buffer), value_buffer); > } > ret = modify_apply_mods(mc,smods); /* smods passed in */ > } > > if (new_sub_count) > *new_sub_count = current_sub_count; > return ret; >Index: ldapserver/ldap/servers/slapd/back-ldbm/perfctrs.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/perfctrs.c,v >retrieving revision 1.9 >diff -u -8 -r1.9 perfctrs.c >--- ldapserver/ldap/servers/slapd/back-ldbm/perfctrs.c 26 Sep 2007 17:32:41 -0000 1.9 >+++ ldapserver/ldap/servers/slapd/back-ldbm/perfctrs.c 1 Oct 2008 13:15:57 -0000 >@@ -291,41 +291,41 @@ > if (NULL == db_env) { > return; > } > perf = (performance_counters*)priv->memory; > if (NULL == perf) { > return; > } > /* Call libdb to get the various stats */ >- if (NULL != db_env->lg_handle) >+ if (DB_USES_LOGGING(db_env)) > { > DB_LOG_STAT *logstat = NULL; > ret = LOG_STAT(db_env,&logstat,0,malloc); > if (0 == ret) { > perf->log_region_wait_rate = logstat->st_region_wait; > perf->log_write_rate = 1024*1024*logstat->st_w_mbytes + logstat->st_w_bytes; > perf->log_bytes_since_checkpoint = 1024*1024*logstat->st_wc_mbytes + logstat->st_wc_bytes; > } > free(logstat); > } >- if (NULL != db_env->tx_handle) >+ if (DB_USES_TRANSACTIONS(db_env)) > { > DB_TXN_STAT *txnstat = NULL; > ret = TXN_STAT(db_env, &txnstat, 0, malloc); > if (0 == ret) { > perf->active_txns = txnstat->st_nactive; > perf->commit_rate = txnstat->st_ncommits; > perf->abort_rate = txnstat->st_naborts; > perf->txn_region_wait_rate = txnstat->st_region_wait; > } > if (txnstat) > free(txnstat); > } >- if (NULL != db_env->lk_handle) >+ if (DB_USES_LOCKING(db_env)) > { > DB_LOCK_STAT *lockstat = NULL; > ret = LOCK_STAT(db_env,&lockstat,0,malloc); > if (0 == ret) { > perf->lock_region_wait_rate = lockstat->st_region_wait; > perf->deadlock_rate = lockstat->st_ndeadlocks; > perf->configured_locks = lockstat->st_maxlocks; > perf->current_locks = lockstat->st_nlocks; >@@ -333,17 +333,17 @@ > perf->lockers = lockstat->st_nlockers; > perf->lock_conflicts = GET_N_LOCK_WAITS(lockstat); > perf->lock_request_rate = lockstat->st_nrequests; > perf->current_lock_objects = lockstat->st_nobjects; > perf->max_lock_objects = lockstat->st_maxnobjects; > } > free(lockstat); > } >- if (NULL != db_env->mp_handle) >+ if (DB_USES_MPOOL(db_env)) > { > DB_MPOOL_STAT *mpstat = NULL; > ret = MEMP_STAT(db_env,&mpstat,NULL,0,malloc); > if (0 == ret) { > #define ONEG 1073741824 > perf->cache_size_bytes = mpstat->st_gbytes * ONEG + mpstat->st_bytes; > perf->page_access_rate = mpstat->st_cache_hit + mpstat->st_cache_miss; > perf->cache_hit = mpstat->st_cache_hit; >Index: ldapserver/ldap/servers/slapd/tools/ldif.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldif.c,v >retrieving revision 1.6 >diff -u -8 -r1.6 ldif.c >--- ldapserver/ldap/servers/slapd/tools/ldif.c 10 Nov 2006 23:45:51 -0000 1.6 >+++ ldapserver/ldap/servers/slapd/tools/ldif.c 1 Oct 2008 13:15:57 -0000 >@@ -140,17 +140,17 @@ > /* if buffer was filled, expand and keep reading unless last char > is linefeed, in which case it is OK for buffer to be full */ > while( ((curlen = strlen(buf)) == (maxlen - 1)) && buf[curlen-1] != '\n' ) { > maxlen *= 2; > if( (buf = (char *)realloc(buf, maxlen)) == NULL ) { > perror( "realloc" ); > return( 1 ); > } >- fgets(buf+curlen, maxlen/2 + 1, stdin); >+ (void)fgets(buf+curlen, maxlen/2 + 1, stdin); > } > /* we have a full line, chop potential newline and turn into ldif */ > if( buf[curlen-1] == '\n' ) > buf[curlen-1]='\0'; > if (( out = ldif_type_and_value( type, buf, strlen( buf ) )) > == NULL ) { > perror( "ldif_type_and_value" ); > return( 1 ); >Index: ldapserver/ldap/servers/slapd/tools/mmldif.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/mmldif.c,v >retrieving revision 1.8 >diff -u -8 -r1.8 mmldif.c >--- ldapserver/ldap/servers/slapd/tools/mmldif.c 18 Oct 2007 00:08:34 -0000 1.8 >+++ ldapserver/ldap/servers/slapd/tools/mmldif.c 1 Oct 2008 13:15:57 -0000 >@@ -811,17 +811,17 @@ > line, 0, 0); > continue; /* invalid line, but we'll just skip it */ > } > toolong = FALSE; > while (TRUE) { > lookahead = fgetc(edf1->fp); > if (lookahead != ' ') > break; >- fgets(line, sizeof(line), edf1->fp); >+ (void)fgets(line, sizeof(line), edf1->fp); > len = strlen(line); > for (lptr = line+len-1; len; len--, lptr--) { > if ((*lptr != '\n') && (*lptr != '\r')) > break; > *lptr = 0; > } > rc = Dec64(b64, (unsigned char *)line); > if (rc == -1) >@@ -849,17 +849,17 @@ > > att->valuelen = strlen(vptr); > memcpy(att->value, vptr, att->valuelen); > ptr = att->value + att->valuelen; > while (TRUE) { > lookahead = fgetc(edf1->fp); > if (lookahead != ' ') > break; >- fgets(line, sizeof(line), edf1->fp); >+ (void)fgets(line, sizeof(line), edf1->fp); > len = strlen(line); > for (lptr = line+len-1; len; len--, lptr--) { > if ((*lptr != '\n') && (*lptr != '\r')) > break; > *lptr = 0; > } > memcpy(ptr, line, len); > att->valuelen += len; >Index: ldapserver/ldap/servers/slapd/tools/pwenc.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/pwenc.c,v >retrieving revision 1.9 >diff -u -8 -r1.9 pwenc.c >--- ldapserver/ldap/servers/slapd/tools/pwenc.c 19 Jun 2007 18:24:58 -0000 1.9 >+++ ldapserver/ldap/servers/slapd/tools/pwenc.c 1 Oct 2008 13:15:57 -0000 >@@ -140,17 +140,17 @@ > FrontendConfig_init(); > > abs_configdir = rel2abspath( configdir ); > if ( config_set_configdir( "configdir (-D)", abs_configdir, > errorbuf, 1) != LDAP_SUCCESS ) { > fprintf( stderr, "%s\n", errorbuf ); > return( NULL ); > } >- slapi_ch_free((void **)&abs_configdir); >+ slapi_ch_free_string(&abs_configdir); > > slapdFrontendConfig = getFrontendConfig(); > if (0 == slapd_config(slapdFrontendConfig->configdir, configfile)) { > fprintf(stderr, > "The configuration files in directory %s could not be read or were not found. Please refer to the error log or output for more information.\n", > slapdFrontendConfig->configdir); > return(NULL); > } >@@ -164,21 +164,19 @@ > int argc; > char *argv[]; > { > int i, rc; > char *enc, *cmp, *name; > struct pw_scheme *pwsp, *cmppwsp; > extern int optind; > char *cpwd = NULL; /* candidate password for comparison */ >- char errorbuf[SLAPI_DSE_RETURNTEXT_SIZE]; > slapdFrontendConfig_t *slapdFrontendConfig = NULL; > > char *opts = "Hs:c:D:"; >- char *configdir = NULL; > name = argv[ 0 ]; > pwsp = cmppwsp = NULL; > > #ifdef _WIN32 > module_ldap_debug = &slapd_ldap_debug; > libldap_init_debug_level(&slapd_ldap_debug); > #endif > >@@ -404,17 +402,17 @@ > * if not explicilty set in the config file > */ > config_set_storagescheme(); > > slapi_sdn_done(&plug_dn); > rc= 1; /* OK */ > } > >- slapi_ch_free((void **)&buf); >+ slapi_ch_free_string(&buf); > } > > return rc; > } > > /* > kexcoff: direclty copied fron the server code > See if the given entry has an attribute with the given name and the >Index: ldapserver/ldap/servers/slapd/tools/ldclt/ldapfct.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/ldapfct.c,v >retrieving revision 1.7 >diff -u -8 -r1.7 ldapfct.c >--- ldapserver/ldap/servers/slapd/tools/ldclt/ldapfct.c 18 Oct 2007 00:08:35 -0000 1.7 >+++ ldapserver/ldap/servers/slapd/tools/ldclt/ldapfct.c 1 Oct 2008 13:15:58 -0000 >@@ -666,57 +666,57 @@ > if (mctx.mode & SSL) > { > /* > * LDAP session initialization in SSL mode > * added by: B Kolics (11/10/00) > */ > tttctx->ldapCtx = ldapssl_init(mctx.hostname, mctx.port, 1); > if (mctx.mode & VERY_VERBOSE) >- printf ("ldclt[%d]: T%03d: After ldapssl_init (%s, %d), ldapCtx=0x%08x\n", >+ printf ("ldclt[%d]: T%03d: After ldapssl_init (%s, %d), ldapCtx=0x%p\n", > mctx.pid, tttctx->thrdNum, mctx.hostname, mctx.port, >- (unsigned int)tttctx->ldapCtx); >+ tttctx->ldapCtx); > if (tttctx->ldapCtx == NULL) > { > printf ("ldclt[%d]: T%03d: Cannot ldapssl_init (%s, %d), errno=%d\n", > mctx.pid, tttctx->thrdNum, mctx.hostname, mctx.port, errno); > fflush (stdout); > return (-1); > } > /* > * Client authentication is used ? > */ > if (mctx.mode & CLTAUTH) > { > ret = ldapssl_enable_clientauth(tttctx->ldapCtx, "", mctx.keydbpin, mctx.cltcertname); > if (mctx.mode & VERY_VERBOSE) > printf >- ("ldclt[%d]: T%03d: After ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", >- mctx.pid, tttctx->thrdNum, (unsigned int)tttctx->ldapCtx, mctx.keydbpin, >+ ("ldclt[%d]: T%03d: After ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", >+ mctx.pid, tttctx->thrdNum, tttctx->ldapCtx, mctx.keydbpin, > mctx.cltcertname); > if (ret < 0) > { > printf >- ("ldclt[%d]: T%03d: Cannot ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", >- mctx.pid, tttctx->thrdNum, (unsigned int)tttctx->ldapCtx, mctx.keydbpin, >+ ("ldclt[%d]: T%03d: Cannot ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", >+ mctx.pid, tttctx->thrdNum, tttctx->ldapCtx, mctx.keydbpin, > mctx.cltcertname); > ldap_perror(tttctx->ldapCtx, "ldapssl_enable_clientauth"); > fflush (stdout); > return (-1); > } > } > } else { > /* > * connection initialization in normal, unencrypted mode > */ > tttctx->ldapCtx = ldap_init (mctx.hostname, mctx.port); > if (mctx.mode & VERY_VERBOSE) >- printf ("ldclt[%d]: T%03d: After ldap_init (%s, %d), ldapCtx=0x%08x\n", >+ printf ("ldclt[%d]: T%03d: After ldap_init (%s, %d), ldapCtx=0x%p\n", > mctx.pid, tttctx->thrdNum, mctx.hostname, mctx.port, >- (unsigned int)tttctx->ldapCtx); >+ tttctx->ldapCtx); > if (tttctx->ldapCtx == NULL) > { > printf ("ldclt[%d]: T%03d: Cannot ldap_init (%s, %d), errno=%d\n", > mctx.pid, tttctx->thrdNum, mctx.hostname, mctx.port, errno); > fflush (stdout); > return (-1); > } > } >@@ -800,17 +800,16 @@ > if (addErrorStat (ret) < 0) /*JLS 18-12-00*/ > return (-1); /*JLS 18-12-00*/ > return (-1); /*JLS 18-12-00*/ > } /*JLS 18-12-00*/ > } > } else if ((mctx.mod2 & M2_SASLAUTH) && ((!(tttctx->binded)) || > (mctx.mode & BIND_EACH_OPER))) { > void *defaults; >- LDAPControl **rctrls = NULL; > char *my_saslauthid = NULL; > > if ( mctx.sasl_mech == NULL) { > fprintf( stderr, "Please specify the SASL mechanism name when " > "using SASL options\n"); > return (-1); > } > >@@ -1831,42 +1830,42 @@ > if (mctx.mode & SSL) > { > /* > * LDAP session initialization in SSL mode > * added by: B Kolics (11/10/00) > */ > tttctx->ldapCtx = ldapssl_init(mctx.hostname, mctx.port, 1); > if (mctx.mode & VERY_VERBOSE) >- printf ("ldclt[%d]: T%03d: After ldapssl_init (%s, %d), ldapCtx=0x%08x\n", >+ printf ("ldclt[%d]: T%03d: After ldapssl_init (%s, %d), ldapCtx=0x%p\n", > mctx.pid, tttctx->thrdNum, mctx.hostname, mctx.port, >- (unsigned int)tttctx->ldapCtx); >+ tttctx->ldapCtx); > if (tttctx->ldapCtx == NULL) > { > printf ("ldclt[%d]: T%03d: Cannot ldapssl_init (%s, %d), errno=%d\n", > mctx.pid, tttctx->thrdNum, mctx.hostname, mctx.port, errno); > fflush (stdout); > return (-1); > } > /* > * Client authentication is used ? > */ > if (mctx.mode & CLTAUTH) > { > ret = ldapssl_enable_clientauth(tttctx->ldapCtx, "", mctx.keydbpin, mctx.cltcertname); > if (mctx.mode & VERY_VERBOSE) > printf >- ("ldclt[%d]: T%03d: After ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", >- mctx.pid, tttctx->thrdNum, (unsigned int)tttctx->ldapCtx, mctx.keydbpin, >+ ("ldclt[%d]: T%03d: After ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", >+ mctx.pid, tttctx->thrdNum, tttctx->ldapCtx, mctx.keydbpin, > mctx.cltcertname); > if (ret < 0) > { > printf >- ("ldclt[%d]: T%03d: Cannot ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", >- mctx.pid, tttctx->thrdNum, (unsigned int)tttctx->ldapCtx, mctx.keydbpin, >+ ("ldclt[%d]: T%03d: Cannot ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", >+ mctx.pid, tttctx->thrdNum, tttctx->ldapCtx, mctx.keydbpin, > mctx.cltcertname); > fflush (stdout); > return (-1); > } > } > } else { > /* > * connection initialization in normal, unencrypted mode >Index: ldapserver/ldap/servers/slapd/tools/ldclt/scalab01.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/ldclt/scalab01.c,v >retrieving revision 1.5 >diff -u -8 -r1.5 scalab01.c >--- ldapserver/ldap/servers/slapd/tools/ldclt/scalab01.c 18 Oct 2007 00:08:35 -0000 1.5 >+++ ldapserver/ldap/servers/slapd/tools/ldclt/scalab01.c 1 Oct 2008 13:15:58 -0000 >@@ -519,55 +519,55 @@ > */ > if (mctx.mode & SSL) > { > /* > * LDAP session initialization in SSL mode > */ > s1ctx.ldapCtx = ldapssl_init(mctx.hostname, mctx.port, 1); > if (mctx.mode & VERY_VERBOSE) >- printf ("ldclt[%d]: ctrl: ldapssl_init (%s, %d), ldapCtx=0x%08x\n", >- mctx.pid, mctx.hostname, mctx.port, (unsigned int)s1ctx.ldapCtx); >+ printf ("ldclt[%d]: ctrl: ldapssl_init (%s, %d), ldapCtx=0x%p\n", >+ mctx.pid, mctx.hostname, mctx.port, s1ctx.ldapCtx); > if (s1ctx.ldapCtx == NULL) > { > printf ("ldclt[%d]: ctrl: Cannot ldapssl_init (%s, %d), errno=%d\n", > mctx.pid, mctx.hostname, mctx.port, errno); > fflush (stdout); > return (-1); > } > /* > * Client authentication is used ? > */ > if (mctx.mode & CLTAUTH) > { > ret = ldapssl_enable_clientauth(s1ctx.ldapCtx, "", mctx.keydbpin, mctx.cltcertname); > if (mctx.mode & VERY_VERBOSE) > printf >- ("ldclt[%d]: ctrl: After ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", >- mctx.pid, (unsigned int)s1ctx.ldapCtx, mctx.keydbpin, mctx.cltcertname); >+ ("ldclt[%d]: ctrl: After ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", >+ mctx.pid, s1ctx.ldapCtx, mctx.keydbpin, mctx.cltcertname); > if (ret < 0) > { > printf >- ("ldclt[%d]: ctrl: Cannot ldapssl_enable_clientauth (ldapCtx=0x%08x, %s, %s)", >- mctx.pid, (unsigned int)s1ctx.ldapCtx, mctx.keydbpin, mctx.cltcertname); >+ ("ldclt[%d]: ctrl: Cannot ldapssl_enable_clientauth (ldapCtx=0x%p, %s, %s)", >+ mctx.pid, s1ctx.ldapCtx, mctx.keydbpin, mctx.cltcertname); > ldap_perror(s1ctx.ldapCtx, "ldapssl_enable_clientauth"); > fflush (stdout); > return (-1); > } > } > } > else > { > /* > * Connection initialization in normal, unencrypted mode > */ > s1ctx.ldapCtx = ldap_init (mctx.hostname, mctx.port); > if (mctx.mode & VERY_VERBOSE) >- printf ("ldclt[%d]: ctrl: After ldap_init (%s, %d), ldapCtx=0x%08x\n", >- mctx.pid, mctx.hostname, mctx.port, (unsigned int)s1ctx.ldapCtx); >+ printf ("ldclt[%d]: ctrl: After ldap_init (%s, %d), ldapCtx=0x%p\n", >+ mctx.pid, mctx.hostname, mctx.port, s1ctx.ldapCtx); > if (s1ctx.ldapCtx == NULL) > { > printf ("ldclt[%d]: ctrl: Cannot ldap_init (%s, %d), errno=%d\n", > mctx.pid, mctx.hostname, mctx.port, errno); > fflush (stdout); > return (-1); > } > } >Index: ldapserver/ldap/servers/slapd/tools/rsearch/infadd.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/rsearch/infadd.c,v >retrieving revision 1.6 >diff -u -8 -r1.6 infadd.c >--- ldapserver/ldap/servers/slapd/tools/rsearch/infadd.c 18 Oct 2007 23:49:32 -0000 1.6 >+++ ldapserver/ldap/servers/slapd/tools/rsearch/infadd.c 1 Oct 2008 13:15:58 -0000 >@@ -339,21 +339,22 @@ > double val = 1000.0 * (double)total / (double)sampleInterval; > fprintf(stdout, "Rate: %7.2f/thr (%6.2f/sec =%7.4fms/op), " > "total: %u (%d thr)\n", > (double)total/(double)numThreads, val, > (double)1000.0/val, ntotal, numThreads); > } > if (lmtCount && ntotal >= lmtCount) { > if (!quiet) { >+ tmpv = (double)ntotal*1000.0/(counter*sampleInterval); > fprintf(stdout, > "Total added records: %d, Average rate: %7.2f/thrd, " > "%6.2f/sec = %6.4fmsec/op\n", > ntotal, (double)ntotal/(double)numThreads, >- (tmpv = (double)ntotal*1000.0/(counter*sampleInterval)), >+ tmpv, > (double)1000.0/tmpv); > } > exit(1); > } > /* watchdogs were reset when we fetched the min/max counters */ > } > > fprintf(stdout, "All threads died. :(\n"); >Index: ldapserver/ldap/servers/slapd/tools/rsearch/rsearch.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/rsearch/rsearch.c,v >retrieving revision 1.4 >diff -u -8 -r1.4 rsearch.c >--- ldapserver/ldap/servers/slapd/tools/rsearch/rsearch.c 1 Aug 2007 17:51:10 -0000 1.4 >+++ ldapserver/ldap/servers/slapd/tools/rsearch/rsearch.c 1 Oct 2008 13:15:58 -0000 >@@ -496,22 +496,22 @@ > rate, val, (double)1000.0/val, total, numThreads); > } > } > if (countLimit && (counter >= countLimit)) { > printf("Thank you, and good night.\n"); > exit(0); > } > if (timeLimit && (lifeTime >= timeLimit)) { >- double tmpv; >+ double tmpv = (val + sumVal)/counter; > if (verbose) > printf("%d sec >= %d\n", lifeTime, timeLimit); > printf("Final Average rate: " > "%6.2f/sec = %6.4fmsec/op, total:%6u\n", >- (tmpv = (val + sumVal)/counter), >+ tmpv, > (double)1000.0/tmpv, > total); > exit(0); > } > sumVal += val; > /* watchdogs were reset when we fetched the min/max counters */ > } > >Index: ldapserver/ldap/servers/slapd/tools/rsearch/searchthread.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/tools/rsearch/searchthread.c,v >retrieving revision 1.5 >diff -u -8 -r1.5 searchthread.c >--- ldapserver/ldap/servers/slapd/tools/rsearch/searchthread.c 1 Aug 2007 17:51:10 -0000 1.5 >+++ ldapserver/ldap/servers/slapd/tools/rsearch/searchthread.c 1 Oct 2008 13:15:58 -0000 >@@ -496,17 +496,17 @@ > return rval; > } > > /* the main thread */ > void search_start(void *v) > { > SearchThread *st = (SearchThread *)v; > PRIntervalTime timer; >- int notBound = 1, res, searches = 0; >+ int notBound = 1, res = LDAP_SUCCESS, searches = 0; > PRUint32 span; > > st->alive = 1; > st->ld = 0; > while (1) { > timer = PR_IntervalNow(); > > /* bind if we need to */ >Index: ldapserver/ldap/servers/snmp/ldap-agent.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/ldap/servers/snmp/ldap-agent.h,v >retrieving revision 1.9 >diff -u -8 -r1.9 ldap-agent.h >--- ldapserver/ldap/servers/snmp/ldap-agent.h 10 Nov 2006 23:45:53 -0000 1.9 >+++ ldapserver/ldap/servers/snmp/ldap-agent.h 1 Oct 2008 13:15:58 -0000 >@@ -42,17 +42,37 @@ > > #ifndef DSOPSTABLE_H > #define DSOPSTABLE_H > > #ifdef __cplusplus > extern "C" { > #endif > >+/* net-snmp-config.h defines >+ all of these unconditionally - so we undefine >+ them here to make the compiler warnings shut up >+ hopefully we don't need the real versions >+ of these, but then with no warnings the compiler >+ will just silently redefine them to the wrong >+ ones anyway >+ Then undefine them after the include so that >+ our own local defines will take effect >+*/ >+#undef PACKAGE_BUGREPORT >+#undef PACKAGE_NAME >+#undef PACKAGE_STRING >+#undef PACKAGE_TARNAME >+#undef PACKAGE_VERSION > #include <net-snmp/net-snmp-config.h> >+#undef PACKAGE_BUGREPORT >+#undef PACKAGE_NAME >+#undef PACKAGE_STRING >+#undef PACKAGE_TARNAME >+#undef PACKAGE_VERSION > #include <net-snmp/net-snmp-includes.h> > #include <net-snmp/agent/net-snmp-agent-includes.h> > #include <net-snmp/library/snmp_assert.h> > #include <net-snmp/library/container.h> > #include <net-snmp/agent/table_array.h> > #include "../slapd/agtmmap.h" > > #define MAXLINE 4096 >Index: ldapserver/lib/ldaputil/certmap.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/ldaputil/certmap.c,v >retrieving revision 1.8 >diff -u -8 -r1.8 certmap.c >--- ldapserver/lib/ldaputil/certmap.c 18 Oct 2007 00:08:36 -0000 1.8 >+++ ldapserver/lib/ldaputil/certmap.c 1 Oct 2008 13:15:58 -0000 >@@ -50,16 +50,17 @@ > #include <sec.h> > */ > #include <plstr.h> > #include <prlink.h> > #include <prprf.h> > > #include <key.h> > #include <cert.h> >+#define DEFINE_LDAPU_STRINGS 1 > #include <ldaputil/certmap.h> > #include <ldaputil/ldapauth.h> > #include <ldaputil/errors.h> > #include <ldaputil/ldaputil.h> > #include "ldaputili.h" > > #ifndef BIG_LINE > #define BIG_LINE 1024 >@@ -295,17 +296,18 @@ > > static int ldapu_list_print (LDAPUList_t *list, LDAPUListNodeFn_t print_fn, > LDAPUPrintInfo_t *pinfo) > { > LDAPUListNode_t *node = list->head; > int rv; > > while(node) { >- rv = (int)(*print_fn)(node->info, pinfo); >+ uintptr_t retval = (uintptr_t)(*print_fn)(node->info, pinfo); >+ rv = (int)retval; > if (rv != LDAPU_SUCCESS) return rv; > node = node->next; > } > > return LDAPU_SUCCESS; > } > > >@@ -1686,16 +1688,17 @@ > * file. Rename the temporary file to the new file. > */ > FILE *ofp; > FILE *tfp; > char buf[BIG_LINE]; > char *ptr; > int eof; > int rv; >+ uintptr_t retval; > LDAPUPrintInfo_t pinfo; > > #ifdef XP_WIN32 > if ((ofp = fopen(old_fname, "rt")) == NULL) > #else > if ((ofp = fopen(old_fname, "r")) == NULL) > #endif > { >@@ -1725,17 +1728,18 @@ > } > > fclose(ofp); > > /* Output the default_certmap_info */ > pinfo.fp = tfp; > pinfo.arg = default_certmap_info->issuerName; > >- rv = (int)ldapu_certinfo_print (default_certmap_info, &pinfo); >+ retval = (uintptr_t)ldapu_certinfo_print (default_certmap_info, &pinfo); >+ rv = (int)retval; > > if (rv != LDAPU_SUCCESS) { > fclose(tfp); > return rv; > } > > if (certmap_listinfo) { > rv = ldapu_list_print (certmap_listinfo, ldapu_certinfo_print, >Index: ldapserver/lib/ldaputil/ldapauth.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/ldaputil/ldapauth.c,v >retrieving revision 1.7 >diff -u -8 -r1.7 ldapauth.c >--- ldapserver/lib/ldaputil/ldapauth.c 10 Nov 2006 23:46:00 -0000 1.7 >+++ ldapserver/lib/ldaputil/ldapauth.c 1 Oct 2008 13:15:58 -0000 >@@ -48,16 +48,17 @@ > > /* #define DBG_PRINT */ > > #include <stdio.h> /* for BUFSIZ */ > #include <string.h> /* for strncpy, strcat */ > #include <ldap.h> > #include <prprf.h> > >+#define DEFINE_LDAPU_STRINGS 1 > #include <ldaputil/certmap.h> > #include <ldaputil/errors.h> > #include <ldaputil/ldapauth.h> > > #include <ldaputili.h> > > /* If we are not interested in the returned attributes, just ask for one > * attribute in the call to ldap_search. Also don't ask for the attribute >Index: ldapserver/lib/ldaputil/ldapdb.c >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/ldaputil/ldapdb.c,v >retrieving revision 1.6 >diff -u -8 -r1.6 ldapdb.c >--- ldapserver/lib/ldaputil/ldapdb.c 10 Nov 2006 23:46:00 -0000 1.6 >+++ ldapserver/lib/ldaputil/ldapdb.c 1 Oct 2008 13:15:58 -0000 >@@ -166,17 +166,20 @@ > return( ldapu_copyPRHostEnt2LDAPHostEnt( result, &prhent )); > } > > static LDAPHostEnt * > ldapu_gethostbyaddr( const char *addr, int length, int type, > LDAPHostEnt *result, char *buffer, int buflen, int *statusp, > void *extradata ) > { >+ /* old code did this which was clearly wrong: > return( (LDAPHostEnt *)PR_GetError() ); >+ which leads me to believe this is not used */ >+ return( NULL ); > } > #endif /* LDAP_OPT_DNS_FN_PTRS */ > > > static void unescape_ldap_basedn (char *str) > { > if (strchr(str, '%')) { > register int x = 0, y = 0; >Index: ldapserver/lib/libaccess/aclerror.cpp >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/libaccess/aclerror.cpp,v >retrieving revision 1.8 >diff -u -8 -r1.8 aclerror.cpp >--- ldapserver/lib/libaccess/aclerror.cpp 10 Nov 2006 23:46:02 -0000 1.8 >+++ ldapserver/lib/libaccess/aclerror.cpp 1 Oct 2008 13:15:58 -0000 >@@ -95,17 +95,17 @@ > * msgbuf - pointer to error message buffer > * maxlen - maximum length of generated message > * maxdepth - maximum depth for traceback > */ > > void aclErrorFmt(NSErr_t * errp, char * msgbuf, int maxlen, int maxdepth) > { > NSEFrame_t * efp; /* error frame pointer */ >- int len; /* length of error message text */ >+ int len = 0; /* length of error message text */ > int depth = 0; /* current depth */ > > msgbuf[0] = 0; > > while ((efp = errp->err_first) != 0) { > > /* Stop if the message buffer is full */ > if (maxlen <= 0) break; >Index: ldapserver/lib/libaccess/acltools.cpp >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/libaccess/acltools.cpp,v >retrieving revision 1.8 >diff -u -8 -r1.8 acltools.cpp >--- ldapserver/lib/libaccess/acltools.cpp 18 Oct 2007 00:08:36 -0000 1.8 >+++ ldapserver/lib/libaccess/acltools.cpp 1 Oct 2008 13:15:59 -0000 >@@ -3055,17 +3055,17 @@ > */ > > NSAPI_PUBLIC int > ACL_FileGetNameList(NSErr_t *errp, char * filename, char ***name_list) > { > > const int block_size = 50; > int rv, list_size, list_index; >- char ** local_list; >+ char ** local_list = NULL; > char * block ; > char * name; > char * next; > long filesize; > FILE * file; > char * head; > > if ((rv=open_file_buf(&file, filename, "rb", &block, &filesize))<0) >Index: ldapserver/lib/libaccess/lasdns.cpp >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/libaccess/lasdns.cpp,v >retrieving revision 1.8 >diff -u -8 -r1.8 lasdns.cpp >--- ldapserver/lib/libaccess/lasdns.cpp 10 Nov 2006 23:46:02 -0000 1.8 >+++ ldapserver/lib/libaccess/lasdns.cpp 1 Oct 2008 13:15:59 -0000 >@@ -135,17 +135,17 @@ > * RETURNS Zero on success, else LAS_EVAL_INVALID > */ > int > LASDnsBuild(NSErr_t *errp, char *attr_pattern, LASDnsContext_t *context, int aliasflg) > { > size_t delimiter; /* length of valid token */ > char token[256]; /* max length dns name */ > int i; >- int ipcnt; >+ int ipcnt = 0; > char **p; > unsigned long *ipaddrs=0; > pool_handle_t *pool; > PRStatus error=PR_SUCCESS; > char buffer[PR_NETDB_BUF_SIZE]; > #ifdef UTEST > struct hostent *he, host; > #else >@@ -342,17 +342,17 @@ > int LASDnsEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator, > char *attr_pattern, ACLCachable_t *cachable, void **LAS_cookie, > PList_t subject, PList_t resource, > PList_t auth_info, PList_t global_auth) > { > int result; > int aliasflg; > char *my_dns; >- LASDnsContext_t *context; >+ LASDnsContext_t *context = NULL; > int rv; > > *cachable = ACL_INDEF_CACHABLE; > > if (strcmp(attr_name, "dns") == 0) > aliasflg = 0; > else if (strcmp(attr_name, "dnsalias") == 0) > aliasflg = 1; >Index: ldapserver/lib/libaccess/lasip.cpp >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/libaccess/lasip.cpp,v >retrieving revision 1.7 >diff -u -8 -r1.7 lasip.cpp >--- ldapserver/lib/libaccess/lasip.cpp 10 Nov 2006 23:46:02 -0000 1.7 >+++ ldapserver/lib/libaccess/lasip.cpp 1 Oct 2008 13:15:59 -0000 >@@ -335,17 +335,17 @@ > * **treetop If this is a new tree, the head of the tree. > */ > static int > LASIpAddPattern(NSErr_t *errp, int netmask, int pattern, LASIpTree_t **treetop) > { > int stopbit; /* Don't care after this point */ > int curbit; /* current bit we're working on */ > int curval; /* value of pattern[curbit] */ >- LASIpTree_t *curptr; /* pointer to the current node */ >+ LASIpTree_t *curptr = NULL; /* pointer to the current node */ > LASIpTree_t *newptr; > > /* stop at the first 1 in the netmask from low to high */ > for (stopbit=0; stopbit<32; stopbit++) { > if ((netmask&(1<<stopbit)) != 0) > break; > } > >@@ -443,17 +443,17 @@ > PList_t subject, PList_t resource, PList_t auth_info, > PList_t global_auth) > { > int bit; > int value; > IPAddr_t ip; > int retcode; > LASIpTree_t *node; >- LASIpContext_t *context; >+ LASIpContext_t *context = NULL; > int rv; > char ip_str[124]; > > *cachable = ACL_INDEF_CACHABLE; > > if (strcmp(attr_name, "ip") != 0) { > nserrGenerate(errp, ACLERRINVAL, ACLERR5200, ACL_Program, 2, XP_GetAdminStr(DBT_lasIpBuildReceivedRequestForAttr_), attr_name); > return LAS_EVAL_INVALID; >Index: ldapserver/lib/libaccess/ldapacl.cpp >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/libaccess/ldapacl.cpp,v >retrieving revision 1.6 >diff -u -8 -r1.6 ldapacl.cpp >--- ldapserver/lib/libaccess/ldapacl.cpp 10 Nov 2006 23:46:02 -0000 1.6 >+++ ldapserver/lib/libaccess/ldapacl.cpp 1 Oct 2008 13:15:59 -0000 >@@ -757,17 +757,17 @@ > NSErr_t err = NSERRINIT; > NSErr_t *errp = &err; > pool_handle_t *pool = 0; > time_t *req_time = 0; > PList_t subject = 0; > PList_t resource = 0; > PList_t auth_info = 0; > PList_t global_auth = NULL; >- int rv; >+ int rv = 0; > > /* Check if the userdn is available in the usr_cache */ > if (acl_usr_cache_enabled() && userdn) { > /* avoid unnecessary system call to get time if cache is disabled */ > req_time = (time_t *)MALLOC(sizeof(time_t)); > > if (req_time) { > time(req_time); >Index: ldapserver/lib/libaccess/oneeval.cpp >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/libaccess/oneeval.cpp,v >retrieving revision 1.8 >diff -u -8 -r1.8 oneeval.cpp >--- ldapserver/lib/libaccess/oneeval.cpp 18 Oct 2007 00:08:36 -0000 1.8 >+++ ldapserver/lib/libaccess/oneeval.cpp 1 Oct 2008 13:15:59 -0000 >@@ -339,17 +339,17 @@ > int > ACLEvalBuildContext( > NSErr_t *errp, > ACLEvalHandle_t *acleval) > { > ACLHandle_t *acl; > ACLExprHandle_t *ace; > int ace_cnt = -1; >- ACLAceEntry_t *acelast, *new_ace; >+ ACLAceEntry_t *acelast = NULL, *new_ace; > ACLAceNumEntry_t *entry, *temp_entry; > char **argp; > ACLListCache_t *cache; > ACLWrapper_t *wrapper; > PList_t curauthplist=NULL, absauthplist=NULL; > int i, rv; > ACLExprEntry_t *expr; > PList_t authplist; >@@ -630,17 +630,17 @@ > ACLAceNumEntry_t *alllist; /* List of ACEs for "all" rights */ > ACLAceEntry_t *cur_ace; > ACLListCache_t *cache; > int rights_cnt = 0; > int prev_acenum, cur_acenum; > int i, j, right_num, delta; > ACLCachable_t ace_cachable; > int result; >- int absolute; >+ int absolute = 0; > int skipflag; > int g_num; /* index into the generic rights array. */ > char **g_rights; > PList_t global_auth=NULL; > int allow_error = 0; > int allow_absolute = 0; > char *allow_tag = NULL; > int allow_num = 0; >Index: ldapserver/lib/libsi18n/getstrmem.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/libsi18n/getstrmem.h,v >retrieving revision 1.7 >diff -u -8 -r1.7 getstrmem.h >--- ldapserver/lib/libsi18n/getstrmem.h 10 Nov 2006 23:46:05 -0000 1.7 >+++ ldapserver/lib/libsi18n/getstrmem.h 1 Oct 2008 13:15:59 -0000 >@@ -48,17 +48,16 @@ > } DATABIN; > > /* It is intended that this header file be generated by program dblink */ > static char emptyString[] = ""; > > #define NUM_BUCKETS 32 /* must be a power of 2 */ > > /* strings in library libadmin */ >-static char* libadminid[] = {"$DBT: libadmin in memory v1 $"}; > static char* libadmin[] = { > "", > " Help ", > " OK ", > " Reset ", > " Done ", > " Cancel ", > emptyString }; >@@ -84,17 +83,16 @@ > static struct DATABIN bucket4[] = { > {emptyString,NULL,0} }; > > /* libraries in bucket for hashKey==5 */ > static struct DATABIN bucket5[] = { > {emptyString,NULL,0} }; > > /* strings in library userforms */ >-static char* userformsid[] = {"$DBT: userforms in memory v1 $"}; > static char* userforms[] = { > "", > "Error: could not open servers list file.<p>\n", > "Error: could not open %s server list file.<p>\n", > "Fedora Server Account", > "Server Account Management for %s", > "Server Account Management", > emptyString }; >@@ -108,17 +106,16 @@ > static struct DATABIN bucket7[] = { > {emptyString,NULL,0} }; > > /* libraries in bucket for hashKey==8 */ > static struct DATABIN bucket8[] = { > {emptyString,NULL,0} }; > > /* strings in library libaccess */ >-static char* libaccessid[] = {"$DBT: libaccess in memory v1 $"}; > static char* libaccess[] = { > "", > "basic-ncsa", > "cannot open database %s", > "basic-ncsa", > "user %s password did not match database %s", > "basic-ncsa", > "cannot open connection to LDAP server on %s:%d", >@@ -269,17 +266,16 @@ > {"libaccess",libaccess,146}, > {emptyString,NULL,0} }; > > /* libraries in bucket for hashKey==10 */ > static struct DATABIN bucket10[] = { > {emptyString,NULL,0} }; > > /* strings in library frame */ >-static char* frameid[] = {"$DBT: frame in memory v1 $"}; > static char* frame[] = { > "", > "<TITLE>Not Found</TITLE><H1>Not Found</H1> The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. ", > "Please inform the site administrator of the <A HREF=\"%s\">referring page</A>.", > "Your browser sent a request that this proxy could not understand.", > "Proper authorization is required for the administration of this proxy.\nEither your browser does not perform authorization, or your authorization\nhas failed.", > "Username authentication is required for using this proxy.\nEither your browser does not perform proxy authorization, or your\nauthorization has failed.", > "The proxy's access control configuration denies access to\nthe requested object through this proxy.", >@@ -460,46 +456,43 @@ > static struct DATABIN bucket16[] = { > {emptyString,NULL,0} }; > > /* libraries in bucket for hashKey==17 */ > static struct DATABIN bucket17[] = { > {emptyString,NULL,0} }; > > /* strings in library admserv */ >-static char* admservid[] = {"$DBT: admserv in memory v1 $"}; > static char* admserv[] = { > "", > "Unauthorized host", > "Invalid URL", > "no filename extension", > "unrecognized type", > "<title>Internal Error</title>\n<h1>Internal Error</h1>\nThe administration server was unable to fulfill your request.<p>\n", > "Reason:", > emptyString }; > > /* strings in library libir */ >-static char* libirid[] = {"$DBT: libadmin in memory v1 $"}; > static char* libir[] = { > "", > "An I/O error occurred before all form data could be read.", > emptyString }; > > /* libraries in bucket for hashKey==18 */ > static struct DATABIN bucket18[] = { > {"admserv",admserv,6}, > {"libir",libir,1}, > {emptyString,NULL,0} }; > > /* libraries in bucket for hashKey==19 */ > static struct DATABIN bucket19[] = { > {emptyString,NULL,0} }; > > /* strings in library httpdaemon */ >-static char* httpdaemonid[] = {"$DBT: httpdaemon in memory v1 $"}; > static char* httpdaemon[] = { > "", > "Error in ConvertThreadToFiber", > "Error in ConvertThreadToFiber", > "Error in md_start_system", > "Error in CreateFiber - idlefiber", > "Error in GetQueuedCompletionStatus", > "Error creating completion port", >@@ -535,17 +528,16 @@ > emptyString }; > > /* libraries in bucket for hashKey==20 */ > static struct DATABIN bucket20[] = { > {"httpdaemon",httpdaemon,35}, > {emptyString,NULL,0} }; > > /* strings in library dsgw */ >-static char* dsgwid[] = {"$DBT: dsgw in memory v1 $"}; > static char* dsgw[] = { > "", > "Unknown HTTP request method", > "Invalid or incomplete HTML form data", > "Out of memory", > "Required query/form input is missing", > "Illegal character in file path", > "Bad or missing configuration file", >@@ -851,17 +843,16 @@ > static struct DATABIN bucket25[] = { > {emptyString,NULL,0} }; > > /* libraries in bucket for hashKey==26 */ > static struct DATABIN bucket26[] = { > {emptyString,NULL,0} }; > > /* strings in library base */ >-static char* baseid[] = {"$DBT: base in memory v1 $"}; > static char* base[] = { > "", > "insufficient memory to create hash table", > "insufficient memory to create hash table", > "cache_destroy: cache tables appear corrupt.", > "unable to allocate hash entry", > "cache_insert: unable to create cache entry", > "HTTP/1.0 200 OK\nContent-type: text/html\n\n", >@@ -1067,17 +1058,16 @@ > emptyString }; > > /* libraries in bucket for hashKey==27 */ > static struct DATABIN bucket27[] = { > {"base",base,205}, > {emptyString,NULL,0} }; > > /* strings in library cgiadmin */ >-static char* cgiadminid[] = {"$DBT: cgiadmin in memory v1 $"}; > static char* cgiadmin[] = { > "", > "Missing REQUEST_METHOD", > "This should only be invoked as CGI program", > "Missing ADMSERV_ROOT", > "This should only be invoked as CGI program", > "Unrecognized request type.", > "Startup", >Index: ldapserver/lib/libsi18n/gsslapd.h >=================================================================== >RCS file: /cvs/dirsec/ldapserver/lib/libsi18n/gsslapd.h,v >retrieving revision 1.7 >diff -u -8 -r1.7 gsslapd.h >--- ldapserver/lib/libsi18n/gsslapd.h 27 Apr 2007 22:59:32 -0000 1.7 >+++ ldapserver/lib/libsi18n/gsslapd.h 1 Oct 2008 13:15:59 -0000 >@@ -49,15 +49,15 @@ > #include "base/dbtbase.h" > #undef LIBRARY_NAME > #include "libaccess/dbtlibaccess.h" > #undef LIBRARY_NAME > #include "libadmin/dbtlibadmin.h" > #undef LIBRARY_NAME > > static RESOURCE_GLOBAL allxpstr[] = { >- base, >- libaccess, >- libadmin, >- 0 >+ {base}, >+ {libaccess}, >+ {libadmin}, >+ {0} > }; > > #endif /* ifdef RESOURCE_STR */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 454030
:
310967
| 318201 |
319432
|
319773
|
319885
|
320698
|
325774
|
325921