Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25950/ldap/servers/slapd
Modified Files:
add.c auditlog.c bind.c compare.c connection.c conntable.c
daemon.c defbackend.c delete.c dse.c dynalib.c entry.c
errormap.c getopt_ext.c index_subsystem.c log.c main.c
mapping_tree.c match.c modify.c modrdn.c opshared.c
passwd_extop.c plugin_internal_op.c protect_db.c proto-slap.h
pw.c pw_mgmt.c result.c sasl_io.c search.c slap.h
slapi-private.h snmp_collator.c ssl.c task.c uuid.c
Log Message:
Resolves: #188320
Summary: HP-UX: warnings reported by the HP-UX compiler
Index: add.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/add.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- add.c 10 Nov 2006 23:45:40 -0000 1.10
+++ add.c 18 Oct 2007 00:08:34 -0000 1.11
@@ -93,7 +93,7 @@
ber = operation->o_ber;
/* count the add request */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsAddEntryOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsAddEntryOps);
/*
* Parse the add request. It looks like this:
Index: auditlog.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/auditlog.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- auditlog.c 10 Nov 2006 23:45:40 -0000 1.6
+++ auditlog.c 18 Oct 2007 00:08:34 -0000 1.7
@@ -66,7 +66,6 @@
char *dn;
void *change;
int flag = 0;
- int internal_op = 0;
Operation *op;
/* if the audit log is not enabled, just skip all of
@@ -76,7 +75,6 @@
}
slapi_pblock_get( pb, SLAPI_OPERATION, &op );
- internal_op = operation_is_flag_set(op, OP_FLAG_INTERNAL);
slapi_pblock_get( pb, SLAPI_TARGET_DN, &dn );
switch ( operation_get_type(op) )
{
Index: bind.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/bind.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- bind.c 27 Feb 2007 02:57:29 -0000 1.10
+++ bind.c 18 Oct 2007 00:08:34 -0000 1.11
@@ -335,7 +335,7 @@
* All SASL auth methods are categorized as strong binds,
* although they are not necessarily stronger than simple.
*/
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsStrongAuthBinds);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsStrongAuthBinds);
if ( saslmech == NULL || *saslmech == '\0' ) {
send_ldap_result( pb, LDAP_AUTH_METHOD_NOT_SUPPORTED, NULL,
"SASL mechanism absent", 0, NULL );
@@ -407,13 +407,13 @@
}
break;
case LDAP_AUTH_SIMPLE:
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsSimpleAuthBinds);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsSimpleAuthBinds);
/* accept null binds */
if (dn == NULL || *dn == '\0') {
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsAnonymousBinds);
+
snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsAnonymousBinds);
/* by definition its anonymous is also UnAuthenticated so increment
that counter */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsUnAuthBinds);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsUnAuthBinds);
/* call preop plugins */
if (plugin_call_plugins( pb, SLAPI_PLUGIN_PRE_BIND_FN ) == 0){
@@ -439,7 +439,7 @@
if ( isroot && method == LDAP_AUTH_SIMPLE ) {
if ( cred.bv_len == 0 ) {
/* unauthenticated bind */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsUnAuthBinds);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsUnAuthBinds);
} else {
/* a passwd was supplied -- check it */
@@ -457,7 +457,7 @@
send_ldap_result( pb, LDAP_INVALID_CREDENTIALS, NULL,
NULL, 0, NULL );
/* increment BindSecurityErrorcount */
-
PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsBindSecurityErrors);
+
snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsBindSecurityErrors);
value_done(&cv);
goto free_and_return;
}
@@ -601,11 +601,11 @@
if(cred.bv_len == 0) {
/* its an UnAuthenticated Bind, DN specified but no pw */
-
PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsUnAuthBinds);
+
snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsUnAuthBinds);
}else{
/* password must have been invalid */
/* increment BindSecurityError count */
-
PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsBindSecurityErrors);
+
snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsBindSecurityErrors);
}
}
Index: compare.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/compare.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- compare.c 10 Nov 2006 23:45:40 -0000 1.6
+++ compare.c 18 Oct 2007 00:08:34 -0000 1.7
@@ -77,7 +77,7 @@
LDAPDebug( LDAP_DEBUG_TRACE, "do_compare\n", 0, 0, 0 );
/* count the compare request */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsCompareOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsCompareOps);
/* have to init this here so we can "done" it below if we short circuit */
slapi_sdn_init(&sdn);
Index: connection.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/connection.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- connection.c 20 Sep 2007 16:54:38 -0000 1.17
+++ connection.c 18 Oct 2007 00:08:34 -0000 1.18
@@ -222,8 +222,8 @@
PR_Unlock( num_conns_mutex );
if (! in_referral_mode) {
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsConnectionSeq);
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsConnections);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsConnectionSeq);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsConnections);
}
/*
@@ -823,7 +823,7 @@
if (! config_check_referral_mode()) {
PR_AtomicIncrement(&ops_initiated);
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsInOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsInOps);
}
if ( (tag = ber_get_int( op->o_ber, &msgid ))
@@ -1920,10 +1920,9 @@
*/
void connection_find_our_rank(Connection *conn,int *connection_count, int *our_rank)
{
- int ret = 0;
table_iterate_info info = {0};
info.our_rate = conn->c_private->operation_rate;
- ret = connection_table_iterate_active_connections(the_connection_table, &info,
&table_iterate_function);
+ connection_table_iterate_active_connections(the_connection_table, &info,
&table_iterate_function);
*connection_count = info.connection_count;
*our_rank = info.rank_count;
}
@@ -2060,7 +2059,7 @@
PR_Unlock(conn->c_mutex);
if (! config_check_referral_mode()) {
PR_AtomicIncrement(&ops_initiated);
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsInOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsInOps);
}
}
/* Once we're here we have a pb */
@@ -2243,7 +2242,7 @@
if (! config_check_referral_mode()) {
PR_AtomicIncrement(&ops_initiated);
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsInOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsInOps);
}
return 0;
}
@@ -2562,7 +2561,7 @@
}
if (! config_check_referral_mode()) {
- PR_AtomicDecrement(g_get_global_snmp_vars()->ops_tbl.dsConnections);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsConnections);
}
conn->c_gettingber = 0;
Index: conntable.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/conntable.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- conntable.c 7 Sep 2007 19:49:51 -0000 1.8
+++ conntable.c 18 Oct 2007 00:08:34 -0000 1.9
@@ -249,6 +249,7 @@
return ret;
}
+#ifdef FOR_DEBUGGING
static void
connection_table_dump_active_connection (Connection *c)
{
@@ -257,7 +258,6 @@
c->c_mutex, c->c_next, c->c_prev);
}
-#if 0 /* useful for debugging */
static void
connection_table_dump_active_connections (Connection_Table *ct)
{
@@ -289,8 +289,10 @@
/* we always have previous element because list contains a dummy header */;
PR_ASSERT (c->c_prev);
- /* slapi_log_error(SLAPI_LOG_FATAL, "connection", "Moving connection
out of active list\n");
- connection_table_dump_active_connection (c);*/
+#ifdef FOR_DEBUGGING
+ slapi_log_error(SLAPI_LOG_FATAL, "connection", "Moving connection out
of active list\n");
+ connection_table_dump_active_connection (c);
+#endif
/*
* Note: the connection will NOT be moved off the active list if any other threads
still hold
@@ -314,7 +316,9 @@
PR_Unlock(ct->table_mutex);
- /* connection_table_dump_active_connections (ct); */
+#ifdef FOR_DEBUGGING
+ connection_table_dump_active_connections (ct);
+#endif
}
/*
@@ -333,8 +337,10 @@
connection_acquire_nolock (c);
- /* slapi_log_error(SLAPI_LOG_FATAL, "connection", "Moving connection
into active list\n");
- connection_table_dump_active_connection (c);*/
+#ifdef FOR_DEBUGGING
+ slapi_log_error(SLAPI_LOG_FATAL, "connection", "Moving connection into
active list\n");
+ connection_table_dump_active_connection (c);
+#endif
c->c_next = ct->c[0].c_next;
if ( c->c_next != NULL )
@@ -346,7 +352,9 @@
PR_Unlock(ct->table_mutex);
- /* connection_table_dump_active_connections (ct); */
+#ifdef FOR_DEBUGGING
+ connection_table_dump_active_connections (ct);
+#endif
}
/*
Index: daemon.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/daemon.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- daemon.c 10 Oct 2007 01:55:36 -0000 1.16
+++ daemon.c 18 Oct 2007 00:08:34 -0000 1.17
@@ -1570,7 +1570,6 @@
struct POLL_STRUCT pr_pd;
PRIntervalTime timeout = PR_MillisecondsToInterval(ioblock_timeout);
- if (timeout < 0) timeout = 0;
pr_pd.fd = (PRFileDesc *)handle;
pr_pd.in_flags = output ? PR_POLL_WRITE : PR_POLL_READ;
pr_pd.out_flags = 0;
@@ -2841,7 +2840,7 @@
exit( 1 );
suppressed:
- return (PRFileDesc *)-1;
+ return (PRFileDesc **)-1;
} /* createprlistensockets */
Index: defbackend.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/defbackend.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- defbackend.c 10 Nov 2006 23:45:40 -0000 1.5
+++ defbackend.c 18 Oct 2007 00:08:34 -0000 1.6
@@ -216,7 +216,7 @@
slapi_pblock_get( pb, SLAPI_BIND_METHOD, &method );
slapi_pblock_get( pb, SLAPI_BIND_CREDENTIALS, &cred );
if ( method == LDAP_AUTH_SIMPLE && cred->bv_len == 0 ) {
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsAnonymousBinds);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsAnonymousBinds);
rc = SLAPI_BIND_ANONYMOUS;
} else {
send_nobackend_ldap_result( pb );
Index: delete.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/delete.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- delete.c 10 Nov 2006 23:45:40 -0000 1.7
+++ delete.c 18 Oct 2007 00:08:34 -0000 1.8
@@ -80,7 +80,7 @@
ber = operation->o_ber;
/* count the delete request */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsRemoveEntryOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsRemoveEntryOps);
/*
* Parse the delete request. It looks like this:
Index: dse.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/dse.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- dse.c 10 Nov 2006 23:45:40 -0000 1.7
+++ dse.c 18 Oct 2007 00:08:34 -0000 1.8
@@ -590,7 +590,7 @@
struct berval val;
vals[0] = &val;
vals[1] = NULL;
- sprintf(value_buffer,"%u",current_sub_count);
+ sprintf(value_buffer,"%lu",current_sub_count);
val.bv_val = value_buffer;
val.bv_len = strlen (val.bv_val);
switch(mod_op)
@@ -640,7 +640,6 @@
char *buf = NULL;
char *lastp = NULL;
int rc= 0; /* Fail */
- PRInt32 remaining;
PRInt32 nr = 0;
PRFileInfo prfinfo;
PRFileDesc *prfd = 0;
@@ -689,7 +688,6 @@
int done= 0;
/* read the entire file into core */
buf = slapi_ch_malloc( prfinfo.size + 1 );
- remaining = prfinfo.size;
if (( nr = slapi_read_buffer( prfd, buf, prfinfo.size )) < 0 )
{
slapi_log_error(SLAPI_LOG_FATAL, "dse",
Index: dynalib.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/dynalib.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- dynalib.c 19 Jun 2007 18:24:58 -0000 1.7
+++ dynalib.c 18 Oct 2007 00:08:34 -0000 1.8
@@ -150,12 +150,12 @@
symload_report_error( const char *libpath, char *symbol, char *plugin, int libopen )
{
char *errtext = NULL;
- PRInt32 errlen, err;
+ PRInt32 errlen;
errlen = PR_GetErrorTextLength();
if ( errlen > 0 ) {
errtext = slapi_ch_malloc( errlen );
- if (( err = PR_GetErrorText( errtext )) > 0 ) {
+ if ( PR_GetErrorText( errtext ) > 0 ) {
LDAPDebug( LDAP_DEBUG_ANY, SLAPI_COMPONENT_NAME_NSPR " error %d: %s\n",
PR_GetError(), errtext, 0 );
}
Index: entry.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/entry.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- entry.c 11 Jun 2007 17:22:37 -0000 1.13
+++ entry.c 18 Oct 2007 00:08:34 -0000 1.14
@@ -197,7 +197,6 @@
Slapi_Attr **a;
char *valuecharptr=NULL;
int valuelen;
- CSNType attributecsntype;
int value_state= VALUE_NOTFOUND;
int attr_state= ATTRIBUTE_NOTFOUND;
int maxvals;
@@ -217,7 +216,6 @@
/*
* Extract the attribute and value CSNs from the attribute type.
*/
- attributecsntype= CSN_TYPE_NONE;
csn_free(&attributedeletioncsn); /* JCM - Do this more efficiently */
csnset_free(&valuecsnset);
value_state= VALUE_NOTFOUND;
@@ -596,7 +594,6 @@
while ( (s = ldif_getline( &next )) != NULL )
{
CSN *attributedeletioncsn= NULL;
- CSNType attributecsntype;
CSNSet *valuecsnset= NULL;
int value_state= VALUE_NOTFOUND;
int attr_state= VALUE_NOTFOUND;
@@ -615,7 +612,6 @@
/*
* Extract the attribute and value CSNs from the attribute type.
*/
- attributecsntype= CSN_TYPE_UNKNOWN;
csn_free(&attributedeletioncsn);
csnset_free(&valuecsnset);
value_state= VALUE_NOTFOUND;
Index: errormap.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/errormap.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- errormap.c 10 Nov 2006 23:45:40 -0000 1.6
+++ errormap.c 18 Oct 2007 00:08:34 -0000 1.7
@@ -106,7 +106,7 @@
const char *s;
if (( s = (const char *)SECU_Strerror( prerrno )) == NULL ) {
- s = slapd_system_strerror( (const int)prerrno );
+ s = slapd_system_strerror( prerrno );
}
return( s );
Index: getopt_ext.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/getopt_ext.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- getopt_ext.c 10 Nov 2006 23:45:40 -0000 1.5
+++ getopt_ext.c 18 Oct 2007 00:08:34 -0000 1.6
@@ -52,7 +52,6 @@
static int _getopt_ext_inited = 0;
static int _optind_firstHandled = 0;
static int _optind_firstRecognized = 0;
-static int _getopt_ext_done_long = 0;
static
int _getopt_ext_init(int argc)
@@ -63,7 +62,6 @@
_optind_firstHandled = argc;
_optind_firstRecognized = argc;
/* optind = 1;*/
- _getopt_ext_done_long = 0;
return(0);
}
Index: index_subsystem.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/index_subsystem.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- index_subsystem.c 10 Nov 2006 23:45:40 -0000 1.6
+++ index_subsystem.c 18 Oct 2007 00:08:34 -0000 1.7
@@ -611,8 +611,6 @@
/* indicates we found an existing targetf */
int assigned = 0;
- struct slapi_filter *f_last = 0; /* previos filter in list */
-
/* something to join with next compatible
* subfilter we find - this will be the
* first occurence of a filter assigned
@@ -768,8 +766,6 @@
break;
}
}
-
- f_last = f;
}
/* iterate through the main list
Index: log.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/log.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- log.c 5 Oct 2007 17:00:04 -0000 1.18
+++ log.c 18 Oct 2007 00:08:34 -0000 1.19
@@ -1488,7 +1488,7 @@
{
int value = 0;
int rv = 0;
- int eunit, etimeunit, rsecs;
+ int etimeunit, rsecs;
slapdFrontendConfig_t *fe_cfg = getFrontendConfig();
if ( logtype != SLAPD_ACCESS_LOG &&
@@ -1543,16 +1543,12 @@
}
if (strcasecmp(expunit, "month") == 0) {
- eunit = LOG_UNIT_MONTHS;
value = 31 * 24 * 60 * 60 * etimeunit;
} else if (strcasecmp(expunit, "week") == 0) {
- eunit = LOG_UNIT_WEEKS;
value = 7 * 24 * 60 * 60 * etimeunit;
} else if (strcasecmp(expunit, "day") == 0) {
- eunit = LOG_UNIT_DAYS;
value = 24 * 60 * 60 * etimeunit;
} else {
- eunit = LOG_UNIT_UNKNOWN;
value = -1;
}
@@ -2225,7 +2221,7 @@
int f_size = 0;
int maxlogsize, nlogs;
int rotationtime_secs = -1;
- int sync_enabled, synchour, syncmin, timeunit;
+ int sync_enabled, timeunit;
if (fp == NULL) {
return LOG_ROTATE;
@@ -2236,8 +2232,6 @@
nlogs = loginfo.log_access_maxnumlogs;
maxlogsize = loginfo.log_access_maxlogsize;
sync_enabled = loginfo.log_access_rotationsync_enabled;
- synchour = loginfo.log_access_rotationsynchour;
- syncmin = loginfo.log_access_rotationsyncmin;
syncclock = loginfo.log_access_rotationsyncclock;
timeunit = loginfo.log_access_rotationunit;
rotationtime_secs = loginfo.log_access_rotationtime_secs;
@@ -2247,8 +2241,6 @@
nlogs = loginfo.log_error_maxnumlogs;
maxlogsize = loginfo.log_error_maxlogsize;
sync_enabled = loginfo.log_error_rotationsync_enabled;
- synchour = loginfo.log_error_rotationsynchour;
- syncmin = loginfo.log_error_rotationsyncmin;
syncclock = loginfo.log_error_rotationsyncclock;
timeunit = loginfo.log_error_rotationunit;
rotationtime_secs = loginfo.log_error_rotationtime_secs;
@@ -2258,8 +2250,6 @@
nlogs = loginfo.log_audit_maxnumlogs;
maxlogsize = loginfo.log_audit_maxlogsize;
sync_enabled = loginfo.log_audit_rotationsync_enabled;
- synchour = loginfo.log_audit_rotationsynchour;
- syncmin = loginfo.log_audit_rotationsyncmin;
syncclock = loginfo.log_audit_rotationsyncclock;
timeunit = loginfo.log_audit_rotationunit;
rotationtime_secs = loginfo.log_audit_rotationtime_secs;
@@ -2875,11 +2865,10 @@
log__getfilesize(LOGFD fp)
{
PRFileInfo info;
- int rv;
- if ((rv = PR_GetOpenFileInfo (fp, &info)) == PR_FAILURE) {
- return -1;
- }
+ if (PR_GetOpenFileInfo (fp, &info) == PR_FAILURE) {
+ return -1;
+ }
return info.size;
}
#endif
@@ -3076,6 +3065,7 @@
*/
if (++numoflogs > loginfo.log_error_maxnumlogs) {
logstr = "Exceeded max number of logs allowed";
+ syslog(LOG_ERR, "%s\n", logstr);
goto delete_logfile;
}
@@ -3166,7 +3156,15 @@
/* Delete the error file */
log_convert_time (delete_logp->l_ctime, tbuf, 1 /*short */);
PR_snprintf (buffer, sizeof(buffer), "%s.%s", loginfo.log_error_file, tbuf);
- PR_Delete(buffer);
+ if (PR_Delete(buffer) != PR_SUCCESS) {
+ LDAPDebug(LDAP_DEBUG_ANY, "LOGINFO:Unable to remove file:%s.%s\n",
+ loginfo.log_audit_file, tbuf,0);
+ } else {
+ LDAPDebug(LDAP_DEBUG_TRACE,
+ "LOGINFO:Removed file:%s.%s because of (%s)\n",
+ loginfo.log_error_file, tbuf,
+ logstr);
+ }
slapi_ch_free((void**)&delete_logp);
loginfo.log_numof_error_logs--;
@@ -3222,7 +3220,7 @@
** have to delete one any how.
*/
if (++numoflogs > loginfo.log_audit_maxnumlogs) {
- logstr = "Exceeded max number of logs allowed";
+ logstr = "Delete Error Log File: Exceeded max number of logs allowed";
goto delete_logfile;
}
Index: main.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/main.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- main.c 7 Sep 2007 19:08:45 -0000 1.21
+++ main.c 18 Oct 2007 00:08:34 -0000 1.22
@@ -189,17 +189,14 @@
* yourself).
*/
-#if 0
- LDAPDebug( LDAP_DEBUG_ANY, "slapd got shutdown signal\n", 0, 0, 0 );
-#endif
- c_set_shutdown();
+ c_set_shutdown();
#ifndef _WIN32
#ifndef LINUX
- /* don't mess with USR1/USR2 on linux, used by libpthread */
- (void) SIGNAL( SIGUSR2, cmd_set_shutdown );
+ /* don't mess with USR1/USR2 on linux, used by libpthread */
+ (void) SIGNAL( SIGUSR2, cmd_set_shutdown );
#endif
- (void) SIGNAL( SIGTERM, cmd_set_shutdown );
- (void) SIGNAL( SIGHUP, cmd_set_shutdown );
+ (void) SIGNAL( SIGTERM, cmd_set_shutdown );
+ (void) SIGNAL( SIGHUP, cmd_set_shutdown );
#endif
}
@@ -470,7 +467,6 @@
static int s_port = 0;
static char **ldif_file = NULL;
static int ldif_files = 0;
-static int ldif_backend = 0;
static char *cmd_line_instance_name = NULL;
static char **cmd_line_instance_names = NULL;
static int skip_db_protect_check = 0;
@@ -484,7 +480,6 @@
static int db2ldif_dump_replica = 0;
static int db2ldif_dump_uniqueid = 1;
static int ldif2db_generate_uniqueid = SLAPI_UNIQUEID_GENERATE_TIME_BASED;
-static int ldif2db_load_state = 1;
static int dbverify_verbose = 0;
static char *ldif2db_namespaceid = NULL;
int importexport_encrypt = 0;
@@ -1218,7 +1213,7 @@
#if ( defined( hpux ) || defined( irix ))
-void *
+void
signal2sigaction( int s, void *a )
{
struct sigaction act;
@@ -1596,8 +1591,6 @@
slapd_exemode == SLAPD_EXEMODE_DBVERIFY) {
char *s = slapi_ch_strdup(optarg_ext);
charray_add(&cmd_line_instance_names, s);
- } else {
- ldif_backend = atoi( optarg_ext );
}
break;
case 's': /* which suffix to include in import/export */
@@ -1766,7 +1759,6 @@
case 'Z':
if (slapd_exemode == SLAPD_EXEMODE_LDIF2DB)
{
- ldif2db_load_state= 0;
break;
}
usage( myname, *extraname );
@@ -2122,7 +2114,6 @@
pb.pb_ldif_generate_uniqueid = ldif2db_generate_uniqueid;
pb.pb_ldif_namespaceid = ldif2db_namespaceid;
pb.pb_ldif_encrypt = importexport_encrypt;
-/* pb.pb_ldif_load_state = ldif2db_load_state; */
pb.pb_instance_name = cmd_line_instance_name;
pb.pb_ldif_files = ldif_file;
pb.pb_ldif_include = db2ldif_include;
@@ -2662,7 +2653,7 @@
memset( &pb, '\0', sizeof(pb) );
pb.pb_backend = NULL;
- pb.pb_seq_val = dbverify_verbose;
+ pb.pb_seq_type = dbverify_verbose;
pb.pb_plugin = backend_plugin;
pb.pb_instance_name = (char *)cmd_line_instance_names;
pb.pb_task_flags = TASK_RUNNING_FROM_COMMANDLINE;
Index: mapping_tree.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/mapping_tree.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- mapping_tree.c 25 Sep 2007 22:12:26 -0000 1.11
+++ mapping_tree.c 18 Oct 2007 00:08:34 -0000 1.12
@@ -2059,8 +2059,6 @@
int ret_code = LDAP_SUCCESS;
int be_index = 0 ;
int referral_index = 0 ;
- int be_list_size = 0;
- int referral_list_size = 0;
Slapi_Backend * be;
Slapi_Entry * referral;
int scope = LDAP_SCOPE_BASE;
@@ -2091,8 +2089,6 @@
mtn_lock();
- be_list_size = BE_LIST_SIZE;
- referral_list_size = BE_LIST_SIZE;
be_list[0] = NULL;
referral_list[0] = NULL;
@@ -3182,7 +3178,6 @@
char *
slapi_mtn_get_state(const Slapi_DN *sdn)
{
- int hint;
char * node_dn;
Slapi_Attr *attr;
char * state = NULL;
@@ -3199,7 +3194,7 @@
if (attr)
{
/* entry state was found */
- hint = slapi_attr_first_value(attr, &val);
+ slapi_attr_first_value(attr, &val);
state = slapi_ch_strdup(slapi_value_get_string(val));
slapi_attr_free(&attr);
}
Index: match.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/match.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- match.c 2 Oct 2007 18:39:50 -0000 1.6
+++ match.c 18 Oct 2007 00:08:34 -0000 1.7
@@ -216,12 +216,11 @@
{
struct matchingRuleList *mrl=NULL;
struct matchingRuleList *newmrl=NULL;
- int rc=0;
if(NULL == mrule) {
return(-1);
}
- if((rc = _mr_alloc_new(&newmrl)) != 0) {
+ if(_mr_alloc_new(&newmrl) != 0) {
return(-1);
}
if(NULL != mrule->mr_name) {
Index: modify.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/modify.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- modify.c 5 Oct 2007 23:31:07 -0000 1.15
+++ modify.c 18 Oct 2007 00:08:34 -0000 1.16
@@ -138,7 +138,7 @@
ber = operation->o_ber;
/* count the modify request */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsModifyEntryOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsModifyEntryOps);
/*
* Parse the modify request. It looks like this:
Index: modrdn.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/modrdn.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- modrdn.c 10 Nov 2006 23:45:40 -0000 1.8
+++ modrdn.c 18 Oct 2007 00:08:34 -0000 1.9
@@ -79,7 +79,7 @@
LDAPDebug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 );
/* count the modrdn request */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsModifyRDNOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsModifyRDNOps);
slapi_pblock_get( pb, SLAPI_OPERATION, &operation);
ber = operation->o_ber;
Index: opshared.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/opshared.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- opshared.c 3 Oct 2007 17:44:50 -0000 1.10
+++ opshared.c 18 Oct 2007 00:08:34 -0000 1.11
@@ -464,6 +464,7 @@
while (be)
{
const Slapi_DN * be_suffix;
+ int err = 0;
if (be->be_search == NULL)
{
@@ -546,7 +547,6 @@
rc = (*be->be_search)(pb);
switch (rc)
{
- int err = 0;
case 1: /* if the backend returned LDAP_NO_SUCH_OBJECT for a SEARCH request,
it will not have sent back a result - otherwise, it will have
sent a result */
Index: passwd_extop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/passwd_extop.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- passwd_extop.c 27 Feb 2007 02:57:30 -0000 1.15
+++ passwd_extop.c 18 Oct 2007 00:08:34 -0000 1.16
@@ -436,7 +436,7 @@
char *errMesg = NULL;
int ret=0, rc=0, sasl_ssf=0;
ber_tag_t tag=0;
- ber_len_t len=-1;
+ ber_len_t len=(ber_len_t)-1;
struct berval *extop_value = NULL;
struct berval *gen_passwd = NULL;
BerElement *ber = NULL;
Index: plugin_internal_op.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/plugin_internal_op.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- plugin_internal_op.c 12 Oct 2007 16:53:03 -0000 1.8
+++ plugin_internal_op.c 18 Oct 2007 00:08:34 -0000 1.9
@@ -591,7 +591,6 @@
int opresult = 0;
Slapi_Entry **pb_search_entries = NULL;
char **pb_search_referrals = NULL;
- int rc;
PR_ASSERT (pb);
@@ -609,7 +608,7 @@
/* call internal search callback, define search_entry_callback, and result_callback
such
that the results of the search are stuffed into pb */
- rc = search_internal_callback_pb (pb, &psid, internal_plugin_result_callback,
+ search_internal_callback_pb (pb, &psid, internal_plugin_result_callback,
internal_plugin_search_entry_callback,
internal_plugin_search_referral_callback);
opresult = psid.rc;
Index: protect_db.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/protect_db.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- protect_db.c 17 Aug 2007 02:12:37 -0000 1.11
+++ protect_db.c 18 Oct 2007 00:08:34 -0000 1.12
@@ -248,7 +248,6 @@
}
}
}
-bail:
PR_Close(prfd);
}
Index: proto-slap.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/proto-slap.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- proto-slap.h 20 Sep 2007 16:54:38 -0000 1.29
+++ proto-slap.h 18 Oct 2007 00:08:34 -0000 1.30
@@ -1273,6 +1273,6 @@
* main.c
*/
#if ( defined( hpux ) || defined( irix ))
-void * signal2sigaction( int s, void *a );
+void signal2sigaction( int s, void *a );
#endif
#endif /* _PROTO_SLAP */
Index: pw.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/pw.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- pw.c 9 Oct 2007 17:51:14 -0000 1.16
+++ pw.c 18 Oct 2007 00:08:34 -0000 1.17
@@ -782,7 +782,7 @@
num_digits++;
} else if ( ldap_utf8isalpha( p ) ) {
num_alphas++;
- if ( slapi_utf8isLower( p ) ) {
+ if ( slapi_utf8isLower( (unsigned char *)p ) ) {
num_lowers++;
} else {
num_uppers++;
Index: pw_mgmt.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/pw_mgmt.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- pw_mgmt.c 7 Mar 2007 22:06:19 -0000 1.9
+++ pw_mgmt.c 18 Oct 2007 00:08:34 -0000 1.10
@@ -297,7 +297,6 @@
time_t unlock_time;
time_t cur_time;
- double diff_t;
char *cur_time_str = NULL;
char *accountUnlockTime;
passwdPolicy *pwpolicy = NULL;
@@ -401,8 +400,7 @@
}
cur_time = current_time();
cur_time_str = format_genTime( cur_time);
- if ( ( diff_t = difftime ( parse_genTime( cur_time_str ),
- unlock_time ) ) < 0 ) {
+ if ( difftime ( parse_genTime( cur_time_str ), unlock_time ) < 0 ) {
/* account is locked, cannot do anything */
if (pwresponse_req) {
Index: result.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/result.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- result.c 3 Oct 2007 17:44:50 -0000 1.11
+++ result.c 18 Oct 2007 00:08:34 -0000 1.12
@@ -328,7 +328,7 @@
|| err == LDAP_AUTH_UNKNOWN )
{
if(g_get_global_snmp_vars()->ops_tbl.dsSecurityErrors!=NULL)
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsSecurityErrors);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsSecurityErrors);
}else if( err != LDAP_REFERRAL
&& err != LDAP_OPT_REFERRALS
&& err != LDAP_PARTIAL_RESULTS)
@@ -339,7 +339,7 @@
-- partially seviced operations will not be conted as an error
*/
if(g_get_global_snmp_vars()->ops_tbl.dsErrors!=NULL)
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsErrors);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsErrors);
}
}
@@ -413,7 +413,7 @@
int len;
/* count the referral */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsReferrals);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsReferrals);
/*
* figure out how much space we need
@@ -486,7 +486,7 @@
*/
/* count the referral */
if (! config_check_referral_mode())
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsReferrals);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsReferrals);
rc = ber_printf( ber, "{it{esst{s", operation->o_msgid, tag, err,
matched ? matched : "", text ? text : "", LDAP_TAG_REFERRAL,
urls[0]->bv_val );
@@ -524,7 +524,7 @@
if ( operation->o_results.result_controls != NULL
&& conn->c_ldapversion >= LDAP_VERSION3
&& write_controls( ber, operation->o_results.result_controls ) != 0 ) {
- rc = LBER_ERROR;
+ rc = (int)LBER_ERROR;
}
if ( rc != LBER_ERROR ) { /* end the LDAPMessage sequence */
@@ -677,7 +677,7 @@
char *attrs[2] = { NULL, NULL };
/* count the referral */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsReferrals);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsReferrals);
attrs[0] = refAttr;
if ( e != NULL &&
@@ -1550,11 +1550,11 @@
plugin_call_plugins( pb, SLAPI_PLUGIN_POST_RESULT_FN );
break;
case _LDAP_SEND_REFERRAL:
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsReferralsReturned);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsReferralsReturned);
plugin_call_plugins( pb, SLAPI_PLUGIN_POST_REFERRAL_FN );
break;
case _LDAP_SEND_ENTRY:
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsEntriesReturned);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsEntriesReturned);
plugin_call_plugins( pb, SLAPI_PLUGIN_POST_ENTRY_FN );
break;
}
Index: sasl_io.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/sasl_io.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- sasl_io.c 3 Oct 2007 00:55:35 -0000 1.12
+++ sasl_io.c 18 Oct 2007 00:08:34 -0000 1.13
@@ -227,7 +227,7 @@
static int
sasl_io_read_packet(Connection *c, PRInt32 *err)
{
- size_t ret = 0;
+ PRInt32 ret = 0;
sasl_io_private *sp = c->c_sasl_io_private;
size_t bytes_remaining_to_read = sp->encrypted_buffer_count -
sp->encrypted_buffer_offset;
Index: search.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/search.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- search.c 10 Nov 2006 23:45:40 -0000 1.7
+++ search.c 18 Oct 2007 00:08:34 -0000 1.8
@@ -86,7 +86,7 @@
ber = operation->o_ber;
/* count the search request */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsSearchOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsSearchOps);
/*
* Parse the search request. It looks like this:
@@ -140,11 +140,11 @@
/* check and record the scope for snmp */
if ( scope == LDAP_SCOPE_ONELEVEL) {
/* count the one level search request */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsOneLevelSearchOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsOneLevelSearchOps);
} else if (scope == LDAP_SCOPE_SUBTREE) {
/* count the subtree search request */
- PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsWholeSubtreeSearchOps);
+ snmp_increment_counter(g_get_global_snmp_vars()->ops_tbl.dsWholeSubtreeSearchOps);
}
/* filter - returns a "normalized" version */
Index: slap.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slap.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- slap.h 12 Oct 2007 18:03:42 -0000 1.28
+++ slap.h 18 Oct 2007 00:08:34 -0000 1.29
@@ -1368,7 +1368,6 @@
int pb_ldif_dump_replica;
int pb_ldif_dump_uniqueid; /* dump uniqueid during db2ldif */
int pb_ldif_generate_uniqueid; /* generate uniqueid during db2ldif */
-/* JCMREPL int pb_ldif_load_state; */
char* pb_ldif_namespaceid; /* used for name based uniqueid generation */
int pb_ldif_encrypt; /* used to enable encrypt/decrypt on import and export */
/*
Index: slapi-private.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slapi-private.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- slapi-private.h 12 Oct 2007 18:03:42 -0000 1.18
+++ slapi-private.h 18 Oct 2007 00:08:34 -0000 1.19
@@ -377,6 +377,8 @@
/* filter.c */
int filter_flag_is_set(const Slapi_Filter *f,unsigned char flag);
char *slapi_filter_to_string(const Slapi_Filter *f, char *buffer, size_t bufsize);
+char *
+slapi_filter_to_string_internal( const struct slapi_filter *f, char *buf, size_t *bufsize
);
/* operation.c */
@@ -1226,6 +1228,14 @@
#define PRLDAP_SET_PORT(myaddr,myport) \
((myaddr)->raw.family == PR_AF_INET6 ? ((myaddr)->ipv6.port = PR_htons(myport))
: ((myaddr)->inet.port = PR_htons(myport)))
+/*
+ * snmp_collator.c
+ * wrapper functions to ease the cast burdon between net-snmp APIs which expect
+ * unsigned int and PR_AtomicIncrement/PR_AtomicSet which expect signed int.
+ */
+void snmp_increment_counter(PRUint32 *counter);
+void snmp_set_counter(PRUint32 *counter, PRInt32 newval);
+
#ifdef __cplusplus
}
#endif
Index: snmp_collator.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/snmp_collator.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- snmp_collator.c 10 Nov 2006 23:45:40 -0000 1.10
+++ snmp_collator.c 18 Oct 2007 00:08:34 -0000 1.11
@@ -570,7 +570,7 @@
/* if we got a value for entrycachehits, then set it */
if(val != NULL)
{
- PR_AtomicSet(g_get_global_snmp_vars()->entries_tbl.dsCacheHits,
atoi(val->bv_val));
+ snmp_set_counter(g_get_global_snmp_vars()->entries_tbl.dsCacheHits,
atoi(val->bv_val));
}
@@ -590,7 +590,7 @@
/* if we got a value for currententrycachesize, then set it */
if(val != NULL)
{
- PR_AtomicSet(g_get_global_snmp_vars()->entries_tbl.dsCacheEntries,
atoi(val->bv_val));
+ snmp_set_counter(g_get_global_snmp_vars()->entries_tbl.dsCacheEntries,
atoi(val->bv_val));
}
@@ -704,7 +704,7 @@
slapi_sdn_done( &sdn );
return *e;
}
-
+
static void
freeConfigEntry( Slapi_Entry **e ) {
if ( (e != NULL) && (*e != NULL) ) {
@@ -713,9 +713,20 @@
}
}
+/*
+ * wrapper functions to ease the cast burdon between net=snmp APIs which expect
+ * unsigned int and PR_AtomicIncrement/PR_AtomicSet which expect signed int.
+ * NSPR_API(PRInt32) PR_AtomicSet(PRInt32 *val, PRInt32 newval);
+ * NSPR_API(PRInt32) PR_AtomicIncrement(PRInt32 *val);
+ */
+void
+snmp_increment_counter(PRUint32 *counter)
+{
+ PR_AtomicIncrement((PRInt32 *)counter);
+}
-
-
-
-
+void snmp_set_counter(PRUint32 *counter, PRInt32 newval)
+{
+ PR_AtomicSet((PRInt32 *)counter, newval);
+}
Index: ssl.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/ssl.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ssl.c 5 Oct 2007 23:31:07 -0000 1.14
+++ ssl.c 18 Oct 2007 00:08:34 -0000 1.15
@@ -400,7 +400,6 @@
{
SECStatus secStatus;
PRErrorCode errorCode;
- PRStatus status;
int rv = 0;
int len = 0;
PRUint32 nssFlags = 0;
@@ -423,7 +422,7 @@
} else { /* otherwise, NSS will create empty databases */
/* we open the key/cert db in rw mode, so make sure the directory
is writable */
- if (PR_SUCCESS != (status = PR_Access(certdir, PR_ACCESS_WRITE_OK))) {
+ if (PR_SUCCESS != PR_Access(certdir, PR_ACCESS_WRITE_OK)) {
char *serveruser = "unknown";
#ifndef _WIN32
serveruser = config_get_localuser();
Index: task.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/task.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- task.c 20 Sep 2007 16:54:38 -0000 1.13
+++ task.c 18 Oct 2007 00:08:34 -0000 1.14
@@ -425,7 +425,7 @@
Slapi_Attr *attr;
Slapi_Value *val = NULL;
Slapi_Backend *be = NULL;
- const char *cn, *instance_name;
+ const char *instance_name;
char **ldif_file = NULL, **include = NULL, **exclude = NULL;
int idx, rv = 0;
const char *do_attr_indexes, *uniqueid_kind_str;
@@ -435,7 +435,7 @@
char *nameFrombe_name = NULL;
const char *encrypt_on_import = NULL;
- if ((cn = fetch_attr(e, "cn", NULL)) == NULL) {
+ if (fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
return SLAPI_DSE_CALLBACK_ERROR;
}
@@ -724,7 +724,6 @@
Slapi_Attr *attr;
Slapi_Value *val = NULL;
Slapi_Backend *be = NULL;
- const char *cn;
char *ldif_file = NULL;
char **instance_names = NULL, **inp;
char **include = NULL, **exclude = NULL;
@@ -744,7 +743,7 @@
const char *decrypt_on_export = NULL;
*returncode = LDAP_SUCCESS;
- if ((cn = fetch_attr(e, "cn", NULL)) == NULL) {
+ if (fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
@@ -994,7 +993,6 @@
{
Slapi_Backend *be = NULL;
PRThread *thread = NULL;
- const char *cn;
const char *archive_dir = NULL;
const char *my_database_type = NULL;
const char *database_type = "ldbm database";
@@ -1004,7 +1002,7 @@
Slapi_Task *task = NULL;
*returncode = LDAP_SUCCESS;
- if ((cn = fetch_attr(e, "cn", NULL)) == NULL) {
+ if (fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
@@ -1139,7 +1137,6 @@
Slapi_Entry *eAfter, int *returncode, char *returntext, void
*arg)
{
Slapi_Backend *be = NULL;
- const char *cn = NULL;
const char *instance_name = NULL;
const char *archive_dir = NULL;
const char *my_database_type = NULL;
@@ -1151,7 +1148,7 @@
PRThread *thread = NULL;
*returncode = LDAP_SUCCESS;
- if ((cn = fetch_attr(e, "cn", NULL)) == NULL) {
+ if (fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
@@ -1285,7 +1282,6 @@
Slapi_Entry *eAfter, int *returncode, char *returntext, void
*arg)
{
const char *instance_name;
- const char *cn;
int rv = SLAPI_DSE_CALLBACK_OK;
Slapi_Backend *be = NULL;
Slapi_Task *task = NULL;
@@ -1297,7 +1293,7 @@
PRThread *thread = NULL;
*returncode = LDAP_SUCCESS;
- if ((cn = fetch_attr(e, "cn", NULL)) == NULL) {
+ if (fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
@@ -1411,7 +1407,6 @@
task_upgradedb_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter,
int *returncode, char *returntext, void *arg)
{
- const char *cn;
int rv = SLAPI_DSE_CALLBACK_OK;
Slapi_Backend *be = NULL;
Slapi_Task *task = NULL;
@@ -1423,7 +1418,7 @@
char *cookie = NULL;
*returncode = LDAP_SUCCESS;
- if ((cn = fetch_attr(e, "cn", NULL)) == NULL) {
+ if (fetch_attr(e, "cn", NULL) == NULL) {
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
goto out;
@@ -1556,8 +1551,6 @@
if ((task->task_state == SLAPI_TASK_FINISHED) &&
!(task->task_flags & SLAPI_TASK_DESTROYING)) {
- /* queue an event to destroy the state info */
- Slapi_Eq_Context event;
Slapi_PBlock *pb = slapi_pblock_new();
Slapi_Entry *e;
int ttl;
@@ -1571,7 +1564,8 @@
ttl = 3600; /* be reasonable. */
expire = time(NULL) + ttl;
task->task_flags |= SLAPI_TASK_DESTROYING;
- event = slapi_eq_once(destroy_task, (void *)task, expire);
+ /* queue an event to destroy the state info */
+ slapi_eq_once(destroy_task, (void *)task, expire);
slapi_free_search_results_internal(pb);
slapi_pblock_destroy(pb);
Index: uuid.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/uuid.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- uuid.c 13 Oct 2007 01:47:15 -0000 1.10
+++ uuid.c 18 Oct 2007 00:08:34 -0000 1.11
@@ -291,7 +291,7 @@
void uuid_format(const guid_t *u, char *buff)
{
- sprintf(buff,
"%8.8lx-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
+ sprintf(buff,
"%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
u->time_low, u->time_mid, u->time_hi_and_version,
u->clock_seq_hi_and_reserved, u->clock_seq_low, u->node[0],
u->node[1], u->node[2], u->node[3], u->node[4], u->node[5]);
@@ -368,7 +368,7 @@
time calls are made by a uuid_update_state */
update_time_mt (×tamp, &clock_seq);
- if (timestamp == NEED_TIME_UPDATE)
+ if (timestamp == (uuid_time_t)NEED_TIME_UPDATE)
{
slapi_log_error (SLAPI_LOG_FATAL, MODULE, "uuid_create_mt: generator ran "
"out of sequence numbers.\n");