[Fedora-directory-commits] ldapserver/ldap/servers/plugins/syntaxes string.c, 1.16, 1.17
by Noriko Hosoi
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/syntaxes
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27877
Modified Files:
string.c
Log Message:
Resolves: 459433
Summray: MMR: intensive conflict test crashes the server
Description: values2keys functions in the syntax plugin did not check the
existence of the input and output variable.
Index: string.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/syntaxes/string.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- string.c 15 Oct 2008 06:30:02 -0000 1.16
+++ string.c 5 Dec 2008 23:57:14 -0000 1.17
@@ -357,9 +357,12 @@
Slapi_Value **bvlp;
char *w, *c, *p;
+ if (NULL == ivals) {
+ return 1;
+ }
+ *ivals = NULL;
if (NULL == bvals) {
- *ivals = NULL;
- return 0;
+ return 1;
}
switch ( ftype ) {
@@ -435,7 +438,7 @@
* nsSubStrEnd: 2
* [...]
*
- * By default, begin == 2, middle == 3, end == 2 (defined in syntax.h)
+ * By default, begin == 3, middle == 3, end == 3 (defined in syntax.h)
*/
/* If nsSubStrLen is specified in each index entry,
15 years, 4 months
[Fedora-directory-commits] directoryconsole/src/com/netscape/admin/dirserv/propedit DSEntryPanel.java, 1.1.1.1, 1.2
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/propedit
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25087/directoryconsole/src/com/netscape/admin/dirserv/propedit
Modified Files:
DSEntryPanel.java
Log Message:
Resolves: bug 234948
Bug Description: Console hangs when adding a custom entry and schema items are in certain order
Reviewed by: nkinder (Thanks!)
Fix Description: The problem is primarily due to https://bugzilla.redhat.com/show_bug.cgi?id=170791 "Schema file parsing overly picky?" - the console schema editor expects an objectclass to always have at least 1 superior. The bug causes SUP not to be present in the schema entry in the directory server. The fix is to use a schema helper function to make sure the list of superior objectclasses always contains at least "top". I also added a check for a null value to avoid the NullPointerException console error.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Index: DSEntryPanel.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/propedit/DSEntryPanel.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- DSEntryPanel.java 18 Jul 2005 00:56:14 -0000 1.1.1.1
+++ DSEntryPanel.java 5 Dec 2008 23:46:25 -0000 1.2
@@ -1647,14 +1647,16 @@
/* Enable/Disable the checkbox for showing attributes with values: if the entry is an extensible
object we don't allow to show all the values */
IAttributeEditor ed = (IAttributeEditor)_visible.get(OBJECTCLASS);
- Vector v = ed.getValues();
- if (v != null) {
- for (int i=0; i< v.size(); i++) {
- if (((String)v.elementAt(i)).equalsIgnoreCase(EXTENSIBLEOBJECT)) {
- _cbAllowedAttributes.setEnabled(false);
- break;
- }
- }
+ if (ed != null) {
+ Vector v = ed.getValues();
+ if (v != null) {
+ for (int i=0; i< v.size(); i++) {
+ if (((String)v.elementAt(i)).equalsIgnoreCase(EXTENSIBLEOBJECT)) {
+ _cbAllowedAttributes.setEnabled(false);
+ break;
+ }
+ }
+ }
}
_cbShowDN = UIFactory.makeJCheckBox(this, _section, "cbshowdn", _dnLabel.isVisible(), _resource);
15 years, 4 months
[Fedora-directory-commits] directoryconsole/src/com/netscape/admin/dirserv DSSchemaHelper.java, 1.1.1.1, 1.2
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25087/directoryconsole/src/com/netscape/admin/dirserv
Modified Files:
DSSchemaHelper.java
Log Message:
Resolves: bug 234948
Bug Description: Console hangs when adding a custom entry and schema items are in certain order
Reviewed by: nkinder (Thanks!)
Fix Description: The problem is primarily due to https://bugzilla.redhat.com/show_bug.cgi?id=170791 "Schema file parsing overly picky?" - the console schema editor expects an objectclass to always have at least 1 superior. The bug causes SUP not to be present in the schema entry in the directory server. The fix is to use a schema helper function to make sure the list of superior objectclasses always contains at least "top". I also added a check for a null value to avoid the NullPointerException console error.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Index: DSSchemaHelper.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/DSSchemaHelper.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- DSSchemaHelper.java 18 Jul 2005 00:55:40 -0000 1.1.1.1
+++ DSSchemaHelper.java 5 Dec 2008 23:46:25 -0000 1.2
@@ -110,7 +110,7 @@
String[] superiors;
Integer integer;
- superiors = oc.getSuperiors();
+ superiors = getSuperiors(oc);
if (superiors != null) {
int i;
for (i=0; i<superiors.length; i++) {
@@ -164,7 +164,7 @@
String[] superiors;
Integer integer;
- superiors = oc.getSuperiors();
+ superiors = getSuperiors(oc);
if (superiors != null) {
int i;
for (i=0; i<superiors.length; i++) {
@@ -222,7 +222,7 @@
String[] superiors;
Integer integer;
- superiors = oc.getSuperiors();
+ superiors = getSuperiors(oc);
if (superiors != null) {
int i;
for (i=0; i<superiors.length; i++) {
@@ -284,7 +284,7 @@
String[] superiors;
Integer integer;
- superiors = oc.getSuperiors();
+ superiors = getSuperiors(oc);
if (superiors != null) {
int i;
for (i=0; i<superiors.length; i++) {
@@ -345,7 +345,7 @@
oc = schema.getObjectClass( value );
String[] superiors;
if ( oc != null ) {
- superiors = oc.getSuperiors();
+ superiors = getSuperiors(oc);
if (superiors != null) {
int i;
Integer integer;
@@ -480,6 +480,18 @@
_operationalAttributes = null;
}
+ public static String[] getSuperiors(LDAPObjectClassSchema oc) {
+ String[] superiors = oc.getSuperiors();
+ if ((superiors == null) && (oc.getType() == LDAPObjectClassSchema.STRUCTURAL)) {
+ // a structural objectclass must always have top as a superior
+ // due to https://bugzilla.redhat.com/show_bug.cgi?id=170791 the SUP
+ // may not have shown up, so we add it if necessary
+ superiors = new String[1];
+ superiors[0] = "top";
+ }
+
+ return superiors;
+ }
private static String[] _editableOperationalAttributes = null;
private static String[] _operationalAttributes = null;
15 years, 4 months
[Fedora-directory-commits] directoryconsole/src/com/netscape/admin/dirserv/attredit ObjectClassAttributeEditor.java, 1.1.1.1, 1.2
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/attredit
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25087/directoryconsole/src/com/netscape/admin/dirserv/attredit
Modified Files:
ObjectClassAttributeEditor.java
Log Message:
Resolves: bug 234948
Bug Description: Console hangs when adding a custom entry and schema items are in certain order
Reviewed by: nkinder (Thanks!)
Fix Description: The problem is primarily due to https://bugzilla.redhat.com/show_bug.cgi?id=170791 "Schema file parsing overly picky?" - the console schema editor expects an objectclass to always have at least 1 superior. The bug causes SUP not to be present in the schema entry in the directory server. The fix is to use a schema helper function to make sure the list of superior objectclasses always contains at least "top". I also added a check for a null value to avoid the NullPointerException console error.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Index: ObjectClassAttributeEditor.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/attredit/ObjectClassAttributeEditor.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ObjectClassAttributeEditor.java 18 Jul 2005 00:55:46 -0000 1.1.1.1
+++ ObjectClassAttributeEditor.java 5 Dec 2008 23:46:25 -0000 1.2
@@ -167,7 +167,7 @@
LDAPObjectClassSchema oschema =
_schema.getObjectClass( val );
if ( oschema != null ) {
- String[] superiors = oschema.getSuperiors();
+ String[] superiors = DSSchemaHelper.getSuperiors(oschema);
if (superiors != null) {
for (int i=0 ; i< superiors.length ; i++) {
String superior = superiors[i];
15 years, 4 months
[Fedora-directory-commits] directoryconsole/src/com/netscape/admin/dirserv/panel SchemaObjectClassesPanel.java, 1.2, 1.3
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25087/directoryconsole/src/com/netscape/admin/dirserv/panel
Modified Files:
SchemaObjectClassesPanel.java
Log Message:
Resolves: bug 234948
Bug Description: Console hangs when adding a custom entry and schema items are in certain order
Reviewed by: nkinder (Thanks!)
Fix Description: The problem is primarily due to https://bugzilla.redhat.com/show_bug.cgi?id=170791 "Schema file parsing overly picky?" - the console schema editor expects an objectclass to always have at least 1 superior. The bug causes SUP not to be present in the schema entry in the directory server. The fix is to use a schema helper function to make sure the list of superior objectclasses always contains at least "top". I also added a check for a null value to avoid the NullPointerException console error.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Index: SchemaObjectClassesPanel.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/panel/SchemaObjectClassesPanel.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SchemaObjectClassesPanel.java 13 Jan 2006 22:53:13 -0000 1.2
+++ SchemaObjectClassesPanel.java 5 Dec 2008 23:46:25 -0000 1.3
@@ -317,7 +317,7 @@
_currOCEntry = schema.getObjectClass(ocName);
enableButtons( !DSUtil.isStandardSchema(_currOCEntry) );
String oid = _currOCEntry.getID();
- String[] superiors = _currOCEntry.getSuperiors();
+ String[] superiors = DSSchemaHelper.getSuperiors(_currOCEntry);
if (oid.length() == 0)
oid = OID_UNKNOWN_STR;
15 years, 4 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd abandon.c, 1.8, 1.9 add.c, 1.15, 1.16 auth.c, 1.12, 1.13 bind.c, 1.18, 1.19 compare.c, 1.9, 1.10 config.c, 1.12, 1.13 connection.c, 1.22, 1.23 conntable.c, 1.11, 1.12 daemon.c, 1.22, 1.23 delete.c, 1.10, 1.11 entry.c, 1.19, 1.20 extendop.c, 1.9, 1.10 libglobs.c, 1.33, 1.34 modify.c, 1.19, 1.20 modrdn.c, 1.11, 1.12 monitor.c, 1.8, 1.9 opshared.c, 1.13, 1.14 psearch.c, 1.10, 1.11 result.c, 1.17, 1.18 sasl_io.c, 1.17, 1.18 search.c, 1.11, 1.12 slap.h, 1.
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13701/ldapserver/ldap/servers/slapd
Modified Files:
abandon.c add.c auth.c bind.c compare.c config.c connection.c
conntable.c daemon.c delete.c entry.c extendop.c libglobs.c
modify.c modrdn.c monitor.c opshared.c psearch.c result.c
sasl_io.c search.c slap.h slapi-plugin.h snmp_collator.c ssl.c
unbind.c util.c
Log Message:
Resolves: bug 454030
Bug Description: Need to address 64-bit compiler warnings - again
Reviewed by: nhosoi (Thanks!)
Fix Description: This patch cleans up most of the other remaining compiler warnings. I compiled the directory server code with these flags on RHEL5 x86_64: -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
I also enabled argument/format match checking for most of the commonly used varadic functions. Most of the problems I found fell into these categories:
1) Too many or not enough arguments e.g. most everything that uses or did use LDAPDebug had extra 0,0 arguments. If they had been switched to use slapi_log_error, I removed the extra arguments - for those places still using LDAPDebug, I introduced more macros to handle the number of arguments, since C macros cannot be varadic.
2) When using NSPR formatting functions, we have to use %llu or %lld for 64-bit values, even on 64-bit systems. However, for regular system formatting functions, we have to use %ld or %lu. I introduced two new macros NSPRIu64 and NSPRI64 to handle cases where we are passing explicit 64-bit values to NSPR formatting functions, so that we can use the regular PRIu64 and PRI64 macros for regular system formatting functions. I also made sure we used NSPRI* only with NSPR functions, and used PRI* only with system functions.
3) use %lu for size_t and %ld for time_t
I did find a few "real" errors, places that the code was doing something definitely not right:
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
This is why it's important to use this compiler checking, and why it's important to fix compiler warnings, if for no other reason than the sheer noise from so many warnings can mask real errors.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Index: abandon.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/abandon.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- abandon.c 17 Oct 2008 22:12:47 -0000 1.8
+++ abandon.c 5 Dec 2008 22:41:52 -0000 1.9
@@ -153,15 +153,15 @@
}
if ( NULL == o ) {
- slapi_log_access( LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d ABANDON"
+ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ABANDON"
" targetop=NOTFOUND msgid=%d\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid, id );
} else if ( suppressed_by_plugin ) {
- slapi_log_access( LDAP_DEBUG_STATS, "conn=%" PRIu64" op=%d ABANDON"
+ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ABANDON"
" targetop=SUPPRESSED-BY-PLUGIN msgid=%d\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid, id );
} else {
- slapi_log_access( LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d ABANDON"
+ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ABANDON"
" targetop=%d msgid=%d nentries=%d etime=%ld\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid, o->o_opid, id,
o->o_results.r.r_search.nentries, current_time() - o->o_time );
Index: add.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/add.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- add.c 24 Oct 2008 22:36:58 -0000 1.15
+++ add.c 5 Dec 2008 22:41:52 -0000 1.16
@@ -166,7 +166,7 @@
if (( rc = slapi_entry_add_values( e, normtype, vals ))
!= LDAP_SUCCESS ) {
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d ADD dn=\"%s\", add values for type %s failed\n",
+ "conn=%" NSPRIu64 " op=%d ADD dn=\"%s\", add values for type %s failed\n",
pb->pb_conn->c_connid, operation->o_opid,
escape_string( slapi_entry_get_dn_const(e), ebuf ), normtype );
send_ldap_result( pb, rc, NULL, NULL, 0, NULL );
@@ -432,7 +432,7 @@
{
if ( !internal_op )
{
- slapi_log_access(LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d ADD dn=\"%s\"\n",
+ slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ADD dn=\"%s\"\n",
pb->pb_conn->c_connid,
operation->o_opid,
escape_string(slapi_entry_get_dn_const(e), ebuf));
Index: auth.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/auth.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- auth.c 17 Oct 2008 22:12:47 -0000 1.12
+++ auth.c 5 Dec 2008 22:41:52 -0000 1.13
@@ -391,7 +391,7 @@
char* subject = subject_of (clientCert);
char* issuer = issuer_of (clientCert);
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " " SLAPI_COMPONENT_NAME_NSPR " error %i (%s); unauthenticated client %s; issuer %s\n",
+ "conn=%" NSPRIu64 " " SLAPI_COMPONENT_NAME_NSPR " error %i (%s); unauthenticated client %s; issuer %s\n",
conn->c_connid, errorCode, slapd_pr_strerror(errorCode),
subject ? escape_string( subject, sbuf ) : "NULL",
issuer ? escape_string( issuer, ibuf ) : "NULL" );
@@ -425,7 +425,7 @@
if ( (slapd_ssl_getChannelInfo (prfd, &channelInfo, sizeof(channelInfo))) != SECSuccess ) {
PRErrorCode errorCode = PR_GetError();
slapi_log_access (LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " SSL failed to obtain channel info; "
+ "conn=%" NSPRIu64 " SSL failed to obtain channel info; "
SLAPI_COMPONENT_NAME_NSPR " error %i (%s)\n",
conn->c_connid, errorCode, slapd_pr_strerror(errorCode));
return;
@@ -434,7 +434,7 @@
!= SECSuccess) {
PRErrorCode errorCode = PR_GetError();
slapi_log_access (LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " SSL failed to obtain cipher info; "
+ "conn=%" NSPRIu64 " SSL failed to obtain cipher info; "
SLAPI_COMPONENT_NAME_NSPR " error %i (%s)\n",
conn->c_connid, errorCode, slapd_pr_strerror(errorCode));
return;
@@ -455,13 +455,13 @@
}
if (config_get_SSLclientAuth() == SLAPD_SSLCLIENTAUTH_OFF ) {
- slapi_log_access (LDAP_DEBUG_STATS, "conn=%" PRIu64 " SSL %i-bit %s\n",
+ slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL %i-bit %s\n",
conn->c_connid, keySize, cipher ? cipher : "NULL" );
slapi_ch_free_string(&cipher);
return;
}
if (clientCert == NULL) {
- slapi_log_access (LDAP_DEBUG_STATS, "conn=%" PRIu64 " SSL %i-bit %s\n",
+ slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL %i-bit %s\n",
conn->c_connid, keySize, cipher ? cipher : "NULL" );
} else {
char* subject = subject_of (clientCert);
@@ -469,7 +469,7 @@
char* issuer = issuer_of (clientCert);
char sbuf[ BUFSIZ ], ibuf[ BUFSIZ ];
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " SSL %i-bit %s; client %s; issuer %s\n",
+ "conn=%" NSPRIu64 " SSL %i-bit %s; client %s; issuer %s\n",
conn->c_connid, keySize, cipher ? cipher : "NULL",
subject ? escape_string( subject, sbuf ) : "NULL",
issuer ? escape_string( issuer, ibuf ) : "NULL");
@@ -507,11 +507,11 @@
if (clientDN != NULL) {
char ebuf[ BUFSIZ ];
- slapi_log_access (LDAP_DEBUG_STATS, "conn=%" PRIu64 " SSL client bound as %s\n",
+ slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL client bound as %s\n",
conn->c_connid, escape_string( clientDN, ebuf ));
} else if (clientCert != NULL) {
slapi_log_access (LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " SSL failed to map client certificate to LDAP DN (%s)\n",
+ "conn=%" NSPRIu64 " SSL failed to map client certificate to LDAP DN (%s)\n",
conn->c_connid, extraErrorMsg );
}
Index: bind.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/bind.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- bind.c 7 Nov 2008 22:32:57 -0000 1.18
+++ bind.c 5 Dec 2008 22:41:52 -0000 1.19
@@ -694,25 +694,25 @@
if (method == LDAP_AUTH_SASL && saslmech && msg) {
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d BIND dn=\"%s\" "
+ "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" "
"method=sasl version=%d mech=%s, %s\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid, edn,
version, saslmech, msg );
} else if (method == LDAP_AUTH_SASL && saslmech) {
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d BIND dn=\"%s\" "
+ "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" "
"method=sasl version=%d mech=%s\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid, edn,
version, saslmech );
} else if (msg) {
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d BIND dn=\"%s\" "
+ "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" "
"method=%d version=%d, %s\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid, edn,
method, version, msg );
} else {
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d BIND dn=\"%s\" "
+ "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" "
"method=%d version=%d\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid, edn,
method, version );
Index: compare.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/compare.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- compare.c 24 Oct 2008 22:36:58 -0000 1.9
+++ compare.c 5 Dec 2008 22:41:52 -0000 1.10
@@ -122,7 +122,7 @@
dn, ava.ava_type, 0 );
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d CMP dn=\"%s\" attr=\"%s\"\n",
+ "conn=%" NSPRIu64 " op=%d CMP dn=\"%s\" attr=\"%s\"\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid,
escape_string( dn, ebuf ), ava.ava_type );
Index: config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/config.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- config.c 8 Oct 2008 17:29:03 -0000 1.12
+++ config.c 5 Dec 2008 22:41:52 -0000 1.13
@@ -126,7 +126,7 @@
slapi_log_error( SLAPI_LOG_FATAL, "bootstrap config",
"Ignoring extremely large value for"
" configuration attribute %s"
- " (length=%d, value=%40.40s...)\n",
+ " (length=%ld, value=%40.40s...)\n",
attrname, len, s );
retval = 0; /* value is too large: ignore it */
}
Index: connection.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/connection.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- connection.c 24 Oct 2008 22:36:58 -0000 1.22
+++ connection.c 5 Dec 2008 22:41:52 -0000 1.23
@@ -352,7 +352,7 @@
/* log useful stuff to our access log */
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " fd=%d slot=%d %sconnection from %s to %s\n",
+ "conn=%" NSPRIu64 " fd=%d slot=%d %sconnection from %s to %s\n",
conn->c_connid, conn->c_sd, ns, pTmp, str_ip, str_destip );
/* initialize the remaining connection fields */
@@ -452,7 +452,7 @@
op->o_tag != LDAP_REQ_ABANDON )
{
slapi_add_pwd_control ( pb, LDAP_CONTROL_PWEXPIRED, 0);
- slapi_log_access( LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d %s\n",
+ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid,
"need new password" );
send_ldap_result( pb, LDAP_UNWILLING_TO_PERFORM,
@@ -522,7 +522,7 @@
{
ret = setsockopt(conn->c_sd,IPPROTO_TCP,TCP_CORK,&i,sizeof(i));
if (ret < 0) {
- LDAPDebug(LDAP_DEBUG_ANY, "Failed to set TCP_CORK on connection %" PRIu64 "\n",conn->c_connid, 0, 0);
+ LDAPDebug(LDAP_DEBUG_ANY, "Failed to set TCP_CORK on connection %" NSPRIu64 "\n",conn->c_connid, 0, 0);
}
}
#endif
@@ -536,7 +536,7 @@
{
ret = setsockopt(conn->c_sd,IPPROTO_TCP,TCP_CORK,&i,sizeof(i));
if (ret < 0) {
- LDAPDebug(LDAP_DEBUG_ANY, "Failed to clear TCP_CORK on connection %" PRIu64 "\n",conn->c_connid, 0, 0);
+ LDAPDebug(LDAP_DEBUG_ANY, "Failed to clear TCP_CORK on connection %" NSPRIu64 "\n",conn->c_connid, 0, 0);
}
}
}
@@ -562,7 +562,7 @@
default:
LDAPDebug( LDAP_DEBUG_ANY,
- "ignoring unknown LDAP request (conn=%" PRIu64 ", tag=0x%lx)\n",
+ "ignoring unknown LDAP request (conn=%" NSPRIu64 ", tag=0x%lx)\n",
conn->c_connid, op->o_tag, 0 );
break;
}
@@ -574,7 +574,7 @@
if (conn->c_refcnt <= 0)
{
slapi_log_error(SLAPI_LOG_FATAL, "connection",
- "conn=%" PRIu64 " fd=%d Attempt to release connection that is not aquired\n",
+ "conn=%" NSPRIu64 " fd=%d Attempt to release connection that is not aquired\n",
conn->c_connid, conn->c_sd);
PR_ASSERT (PR_FALSE);
return -1;
@@ -595,7 +595,7 @@
{
/* This may happen while other threads are still working on this connection */
slapi_log_error(SLAPI_LOG_FATAL, "connection",
- "conn=%" PRIu64 " fd=%d Attempt to acquire connection in the closing state\n",
+ "conn=%" NSPRIu64 " fd=%d Attempt to acquire connection in the closing state\n",
conn->c_connid, conn->c_sd);
return -1;
}
@@ -773,7 +773,7 @@
/* if connection is closing */
if (return_value != 0) {
LDAPDebug(LDAP_DEBUG_CONNS,
- "handle_read_data returns as conn %" PRIu64 " closing, fd=%d\n",
+ "handle_read_data returns as conn %" NSPRIu64 " closing, fd=%d\n",
conn->c_connid,conn->c_sd,0);
return return_value;
}
@@ -836,7 +836,7 @@
!= LDAP_TAG_MSGID ) {
/* log, close and send error */
LDAPDebug( LDAP_DEBUG_ANY,
- "conn=%" PRIu64 " unable to read tag for incoming request\n", conn->c_connid, 0, 0 );
+ "conn=%" NSPRIu64 " unable to read tag for incoming request\n", conn->c_connid, 0, 0 );
return_value = -1;
goto done;
}
@@ -848,7 +848,7 @@
case LDAP_TAG_LDAPDN: /* optional username, for CLDAP */
/* log, close and send error */
LDAPDebug( LDAP_DEBUG_ANY,
- "conn=%" PRIu64 " ber_peek_tag returns 0x%lx\n", conn->c_connid, tag, 0 );
+ "conn=%" NSPRIu64 " ber_peek_tag returns 0x%lx\n", conn->c_connid, tag, 0 );
return_value = -1;
goto done;
default:
@@ -979,7 +979,7 @@
PR_Lock( conn->c_mutex );
if (connection_is_active_nolock(conn) == 0) {
LDAPDebug(LDAP_DEBUG_CONNS,
- "not creating a new operation when conn %" PRIu64 " closing\n",
+ "not creating a new operation when conn %" NSPRIu64 " closing\n",
conn->c_connid,0,0);
PR_Unlock( conn->c_mutex );
return -1;
@@ -1071,7 +1071,7 @@
So, we toss it away ! */
if (LBER_OVERFLOW == tag) {
slapi_log_error( SLAPI_LOG_FATAL, "connection",
- "conn=%" PRIu64 " fd=%d The length of BER Element was too long.\n",
+ "conn=%" NSPRIu64 " fd=%d The length of BER Element was too long.\n",
conn->c_connid, conn->c_sd );
}
PR_Lock( conn->c_mutex );
@@ -1108,7 +1108,7 @@
* We received a non-LDAP message. Log and close connection.
*/
LDAPDebug( LDAP_DEBUG_ANY,
- "conn=%" PRIu64 " received a non-LDAP message"
+ "conn=%" NSPRIu64 " received a non-LDAP message"
" (tag 0x%lx, expected 0x%lx)\n",
conn->c_connid, tag, LDAP_TAG_MESSAGE );
PR_Lock( conn->c_mutex );
@@ -1126,7 +1126,7 @@
if (Bytes_Scanned != Bytes_Read) {
if (connection_increment_reference(conn) == -1) {
LDAPDebug(LDAP_DEBUG_CONNS,
- "could not acquire lock in issue_new_read as conn %" PRIu64 " closing fd=%d\n",
+ "could not acquire lock in issue_new_read as conn %" NSPRIu64 " closing fd=%d\n",
conn->c_connid,conn->c_sd,0);
/* XXX how to handle this error? */
/* MAB: 25 Jan 01: let's try like this and pray this won't leak... */
@@ -1148,7 +1148,7 @@
*/
connection_decrement_reference(conn);
LDAPDebug(LDAP_DEBUG_CONNS,
- "push_back_data failed: closing conn %" PRIu64 " fd=%d\n",
+ "push_back_data failed: closing conn %" NSPRIu64 " fd=%d\n",
conn->c_connid,conn->c_sd,0);
}
} else {
@@ -1246,7 +1246,7 @@
if (connection_increment_reference(conn) == -1) {
LDAPDebug(LDAP_DEBUG_CONNS,
- "could not acquire lock in issue_new_read as conn %" PRIu64 " closing fd=%d\n",
+ "could not acquire lock in issue_new_read as conn %" NSPRIu64 " closing fd=%d\n",
conn->c_connid,conn->c_sd,0);
/* This means that the connection is closing */
return -1;
@@ -1408,7 +1408,7 @@
be decremented in wait_for_new_work(). */
if (connection_acquire_nolock (conn) == -1) {
LDAPDebug(LDAP_DEBUG_CONNS,
- "could not acquire lock in connection_activity as conn %" PRIu64 " closing fd=%d\n",
+ "could not acquire lock in connection_activity as conn %" NSPRIu64 " closing fd=%d\n",
conn->c_connid,conn->c_sd,0);
/* XXX how to handle this error? */
/* MAB: 25 Jan 01: let's return on error and pray this won't leak */
@@ -1644,7 +1644,7 @@
syserr = errno;
/* Bad stuff happened, like the client sent us some junk */
LDAPDebug( LDAP_DEBUG_CONNS,
- "ber_get_next failed for connection %" PRIu64 "\n", conn->c_connid, 0, 0 );
+ "ber_get_next failed for connection %" NSPRIu64 "\n", conn->c_connid, 0, 0 );
/* reset private buffer */
conn->c_private->c_buffer_bytes = conn->c_private->c_buffer_offset = 0;
@@ -1713,7 +1713,7 @@
ret = sasl_io_setup(conn);
if (ret) {
LDAPDebug( LDAP_DEBUG_ANY,
- "conn=%" PRIu64 " unable to enable SASL I/O\n", conn->c_connid, 0, 0 );
+ "conn=%" NSPRIu64 " unable to enable SASL I/O\n", conn->c_connid, 0, 0 );
disconnect_server( conn, conn->c_connid, -1, SLAPD_DISCONNECT_BAD_BER_TAG, EPROTO );
return CONN_DONE;
}
@@ -1774,7 +1774,7 @@
} else {
/* Otherwise we loop, unless we exceeded the ioblock timeout */
if (waits_done > ioblocktimeout_waits) {
- LDAPDebug( LDAP_DEBUG_CONNS,"ioblock timeout expired on connection %" PRIu64 "\n", conn->c_connid, 0, 0 );
+ LDAPDebug( LDAP_DEBUG_CONNS,"ioblock timeout expired on connection %" NSPRIu64 "\n", conn->c_connid, 0, 0 );
disconnect_server( conn, conn->c_connid, -1,
SLAPD_DISCONNECT_IO_TIMEOUT, 0 );
return CONN_DONE;
@@ -1794,7 +1794,7 @@
err = PR_GetError();
syserr = PR_GetOSError();
LDAPDebug( LDAP_DEBUG_ANY,
- "PR_Poll for connection %" PRIu64 " returns %d (%s)\n", conn->c_connid, err, slapd_pr_strerror( err ) );
+ "PR_Poll for connection %" NSPRIu64 " returns %d (%s)\n", conn->c_connid, err, slapd_pr_strerror( err ) );
/* If this happens we should close the connection */
disconnect_server( conn, conn->c_connid, -1, err, syserr );
return CONN_DONE;
@@ -1803,7 +1803,7 @@
/* Some other error, typically meaning bad stuff */
syserr = PR_GetOSError();
LDAPDebug( LDAP_DEBUG_CONNS,
- "PR_Recv for connection %" PRIu64 " returns %d (%s)\n", conn->c_connid, err, slapd_pr_strerror( err ) );
+ "PR_Recv for connection %" NSPRIu64 " returns %d (%s)\n", conn->c_connid, err, slapd_pr_strerror( err ) );
/* If this happens we should close the connection */
disconnect_server( conn, conn->c_connid, -1, err, syserr );
return CONN_DONE;
@@ -1835,7 +1835,7 @@
* We received a non-LDAP message. Log and close connection.
*/
LDAPDebug( LDAP_DEBUG_ANY,
- "conn=%" PRIu64 " received a non-LDAP message (tag 0x%lx, expected 0x%lx)\n",
+ "conn=%" NSPRIu64 " received a non-LDAP message (tag 0x%lx, expected 0x%lx)\n",
conn->c_connid, *tag, LDAP_TAG_MESSAGE );
disconnect_server( conn, conn->c_connid, -1,
SLAPD_DISCONNECT_BAD_BER_TAG, EPROTO );
@@ -1846,7 +1846,7 @@
!= LDAP_TAG_MSGID ) {
/* log, close and send error */
LDAPDebug( LDAP_DEBUG_ANY,
- "conn=%" PRIu64 " unable to read tag for incoming request\n", conn->c_connid, 0, 0 );
+ "conn=%" NSPRIu64 " unable to read tag for incoming request\n", conn->c_connid, 0, 0 );
disconnect_server( conn, conn->c_connid, -1, SLAPD_DISCONNECT_BAD_BER_TAG, EPROTO );
return CONN_DONE;
}
@@ -1863,7 +1863,7 @@
case LDAP_TAG_LDAPDN: /* optional username, for CLDAP */
/* log, close and send error */
LDAPDebug( LDAP_DEBUG_ANY,
- "conn=%" PRIu64 " ber_peek_tag returns 0x%lx\n", conn->c_connid, *tag, 0 );
+ "conn=%" NSPRIu64 " ber_peek_tag returns 0x%lx\n", conn->c_connid, *tag, 0 );
disconnect_server( conn, conn->c_connid, -1, SLAPD_DISCONNECT_BER_PEEK, EPROTO );
return CONN_DONE;
default:
@@ -1900,7 +1900,7 @@
/* update the last checked time */
conn->c_private->previous_count_check_time = current_time();
PR_Unlock( conn->c_mutex );
- LDAPDebug(LDAP_DEBUG_CONNS,"conn %" PRIu64 " activity level = %d\n",conn->c_connid,delta_count,0);
+ LDAPDebug(LDAP_DEBUG_CONNS,"conn %" NSPRIu64 " activity level = %d\n",conn->c_connid,delta_count,0);
}
typedef struct table_iterate_info_struct {
@@ -1955,7 +1955,7 @@
} else {
double activet = 0.0;
connection_find_our_rank(conn,&connection_count, &our_rank);
- LDAPDebug(LDAP_DEBUG_CONNS,"conn %" PRIu64 " turbo rank = %d out of %d conns\n",conn->c_connid,our_rank,connection_count);
+ LDAPDebug(LDAP_DEBUG_CONNS,"conn %" NSPRIu64 " turbo rank = %d out of %d conns\n",conn->c_connid,our_rank,connection_count);
activet = (double)g_get_active_threadcnt();
threshold_rank = (int)(activet * ((double)CONN_TURBO_PERCENTILE / 100.0));
@@ -1997,9 +1997,9 @@
PR_Unlock(conn->c_mutex);
if (current_mode != new_mode) {
if (current_mode) {
- LDAPDebug(LDAP_DEBUG_CONNS,"conn %" PRIu64 " leaving turbo mode\n",conn->c_connid,0,0);
+ LDAPDebug(LDAP_DEBUG_CONNS,"conn %" NSPRIu64 " leaving turbo mode\n",conn->c_connid,0,0);
} else {
- LDAPDebug(LDAP_DEBUG_CONNS,"conn %" PRIu64 " entering turbo mode\n",conn->c_connid,0,0);
+ LDAPDebug(LDAP_DEBUG_CONNS,"conn %" NSPRIu64 " entering turbo mode\n",conn->c_connid,0,0);
}
}
*new_turbo_flag = new_mode;
@@ -2090,7 +2090,7 @@
/* turn off turbo mode immediately if any pb waiting in global queue */
if (thread_turbo_flag && (counter > 0)) {
thread_turbo_flag = 0;
- LDAPDebug(LDAP_DEBUG_CONNS,"conn %" PRIu64 " leaving turbo mode\n",conn->c_connid,0,0);
+ LDAPDebug(LDAP_DEBUG_CONNS,"conn %" NSPRIu64 " leaving turbo mode\n",conn->c_connid,0,0);
}
#endif
@@ -2233,7 +2233,7 @@
if (connection_acquire_nolock (conn) == -1) {
LDAPDebug(LDAP_DEBUG_CONNS,
- "could not acquire lock in connection_activity as conn %" PRIu64 " closing fd=%d\n",
+ "could not acquire lock in connection_activity as conn %" NSPRIu64 " closing fd=%d\n",
conn->c_connid,conn->c_sd,0);
/* XXX how to handle this error? */
/* MAB: 25 Jan 01: let's return on error and pray this won't leak */
@@ -2385,7 +2385,7 @@
if ( *tmp == NULL )
{
- LDAPDebug( LDAP_DEBUG_ANY, "connection_remove_operation: can't find op %d for conn %" PRIu64 "\n",
+ LDAPDebug( LDAP_DEBUG_ANY, "connection_remove_operation: can't find op %d for conn %" NSPRIu64 "\n",
(int)op->o_msgid, conn->c_connid, 0 );
}
else
@@ -2496,13 +2496,13 @@
}
if (0 == ber_len) {
slapi_log_error( SLAPI_LOG_FATAL, "connection",
- "conn=%" PRIu64 " fd=%d Incoming BER Element was too long, max allowable"
+ "conn=%" NSPRIu64 " fd=%d Incoming BER Element was too long, max allowable"
" is %u bytes. Change the nsslapd-maxbersize attribute in"
" cn=config to increase.\n",
conn->c_connid, conn->c_sd, maxbersize );
} else {
slapi_log_error( SLAPI_LOG_FATAL, "connection",
- "conn=%" PRIu64 " fd=%d Incoming BER Element was %u bytes, max allowable"
+ "conn=%" NSPRIu64 " fd=%d Incoming BER Element was %u bytes, max allowable"
" is %u bytes. Change the nsslapd-maxbersize attribute in"
" cn=config to increase.\n",
conn->c_connid, conn->c_sd, ber_len, maxbersize );
@@ -2555,13 +2555,13 @@
*/
if (error && (EPIPE != error) ) {
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d fd=%d closed error %d (%s) - %s\n",
+ "conn=%" NSPRIu64 " op=%d fd=%d closed error %d (%s) - %s\n",
conn->c_connid, opid, conn->c_sd, error,
slapd_system_strerror(error),
slapd_pr_strerror(reason));
} else {
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d fd=%d closed - %s\n",
+ "conn=%" NSPRIu64 " op=%d fd=%d closed - %s\n",
conn->c_connid, opid, conn->c_sd,
slapd_pr_strerror(reason));
}
Index: conntable.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/conntable.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- conntable.c 17 Oct 2008 22:12:47 -0000 1.11
+++ conntable.c 5 Dec 2008 22:41:52 -0000 1.12
@@ -444,22 +444,22 @@
PR_Unlock( ct->c[i].c_mutex );
}
- sprintf( buf, "%d", nconns );
+ PR_snprintf( buf, sizeof(buf), "%d", nconns );
val.bv_val = buf;
val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "currentconnections", vals );
- sprintf( buf, "%" PRIu64, slapi_counter_get_value(num_conns));
+ PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(num_conns));
val.bv_val = buf;
val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "totalconnections", vals );
- sprintf( buf, "%d", (ct!=NULL?ct->size:0) );
+ PR_snprintf( buf, sizeof(buf), "%d", (ct!=NULL?ct->size:0) );
val.bv_val = buf;
val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "dtablesize", vals );
- sprintf( buf, "%d", nreadwaiters );
+ PR_snprintf( buf, sizeof(buf), "%d", nreadwaiters );
val.bv_val = buf;
val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "readwaiters", vals );
Index: daemon.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/daemon.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- daemon.c 23 Oct 2008 22:42:54 -0000 1.22
+++ daemon.c 5 Dec 2008 22:41:52 -0000 1.23
@@ -1496,7 +1496,7 @@
* trying to acquire a closing connection
*/
LDAPDebug (LDAP_DEBUG_ANY,
- "connection_activity: abandoning conn %" PRIu64 " as fd=%d is already closing\n",
+ "connection_activity: abandoning conn %" NSPRIu64 " as fd=%d is already closing\n",
c->c_connid,c->c_sd,0);
/* The call disconnect_server should do nothing,
* as the connection c should be already set to CLOSING */
Index: delete.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/delete.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- delete.c 24 Oct 2008 22:36:58 -0000 1.10
+++ delete.c 5 Dec 2008 22:41:52 -0000 1.11
@@ -257,7 +257,7 @@
{
if (!internal_op )
{
- slapi_log_access(LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d DEL dn=\"%s\"\n",
+ slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d DEL dn=\"%s\"\n",
pb->pb_conn->c_connid,
pb->pb_op->o_opid,
escape_string(dn, ebuf));
Index: entry.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/entry.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- entry.c 15 Oct 2008 06:30:03 -0000 1.19
+++ entry.c 5 Dec 2008 22:41:52 -0000 1.20
@@ -1360,7 +1360,7 @@
if ( (size_t)(ecur - ebuf + 1) > elen )
{
slapi_log_error (SLAPI_LOG_FATAL, NULL,
- "entry2str_internal: array boundary wrote: bufsize=%d wrote=%d\n",
+ "entry2str_internal: array boundary wrote: bufsize=%ld wrote=%ld\n",
elen, (ecur - ebuf + 1));
}
Index: extendop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/extendop.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- extendop.c 17 Oct 2008 22:12:47 -0000 1.9
+++ extendop.c 5 Dec 2008 22:41:52 -0000 1.10
@@ -267,14 +267,14 @@
if ( NULL == ( name = extended_op_oid2string( extoid ))) {
LDAPDebug( LDAP_DEBUG_ARGS, "do_extended: oid (%s)\n", extoid, 0, 0 );
- slapi_log_access( LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d EXT oid=\"%s\"\n",
+ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d EXT oid=\"%s\"\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid );
} else {
LDAPDebug( LDAP_DEBUG_ARGS, "do_extended: oid (%s-%s)\n",
extoid, name, 0 );
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d EXT oid=\"%s\" name=\"%s\"\n",
+ "conn=%" NSPRIu64 " op=%d EXT oid=\"%s\" name=\"%s\"\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid, name );
}
Index: libglobs.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/libglobs.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- libglobs.c 2 Dec 2008 15:29:30 -0000 1.33
+++ libglobs.c 5 Dec 2008 22:41:52 -0000 1.34
@@ -2793,7 +2793,7 @@
if ( *endp != '\0' || errno == ERANGE || nValue < 1 || nValue > maxVal ) {
PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", connection table "
"size must range from 1 to %d (the current process maxdescriptors limit). "
- "Server will use a setting of %d.", attrname, value, maxVal );
+ "Server will use a setting of %d.", attrname, value, maxVal, maxVal );
if ( nValue > maxVal) {
nValue = maxVal;
retVal = LDAP_UNWILLING_TO_PERFORM;
Index: modify.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/modify.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- modify.c 13 Nov 2008 23:08:18 -0000 1.19
+++ modify.c 5 Dec 2008 22:41:52 -0000 1.20
@@ -575,7 +575,7 @@
{
if ( !internal_op )
{
- slapi_log_access(LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d MOD dn=\"%s\"\n",
+ slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"\n",
pb->pb_conn->c_connid,
pb->pb_op->o_opid,
escape_string(slapi_sdn_get_dn(&sdn), ebuf));
@@ -956,7 +956,7 @@
if (operation_is_flag_set(operation,OP_FLAG_ACTION_LOG_ACCESS))
{
- slapi_log_access(LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d MOD dn=\"%s\", %s\n",
+ slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\", %s\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid,
escape_string(slapi_sdn_get_dn(&sdn), ebuf),
"user is not allowed to change password");
@@ -976,7 +976,7 @@
{
if ( !internal_op )
{
- slapi_log_access(LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d MOD dn=\"%s\", %s\n",
+ slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\", %s\n",
pb->pb_conn->c_connid,
pb->pb_op->o_opid,
escape_string(slapi_sdn_get_dn(&sdn), ebuf),
@@ -1011,7 +1011,7 @@
{
if ( !internal_op )
{
- slapi_log_access(LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d MOD dn=\"%s\", %s\n",
+ slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\", %s\n",
pb->pb_conn->c_connid,
pb->pb_op->o_opid,
escape_string(slapi_sdn_get_dn(&sdn), ebuf), "invalid password syntax");
Index: modrdn.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/modrdn.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- modrdn.c 24 Oct 2008 22:36:58 -0000 1.11
+++ modrdn.c 5 Dec 2008 22:41:52 -0000 1.12
@@ -351,7 +351,7 @@
if ( !internal_op )
{
slapi_log_access(LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d MODRDN dn=\"%s\" newrdn=\"%s\" newsuperior=\"%s\"\n",
+ "conn=%" NSPRIu64 " op=%d MODRDN dn=\"%s\" newrdn=\"%s\" newsuperior=\"%s\"\n",
pb->pb_conn->c_connid,
pb->pb_op->o_opid,
escape_string(dn, dnbuf),
@@ -374,7 +374,7 @@
if ((rdns = ldap_explode_rdn(newrdn, 0)) == NULL)
{
slapi_log_error(SLAPI_LOG_FATAL, NULL,
- "conn=%" PRIu64 " op=%d MODRDN invalid new RDN (\"%s\")\n",
+ "conn=%" NSPRIu64 " op=%d MODRDN invalid new RDN (\"%s\")\n",
pb->pb_conn->c_connid,
pb->pb_op->o_opid,
(NULL == newrdn) ? "(null)" : newrdn);
@@ -391,7 +391,7 @@
{
LDAPDebug(LDAP_DEBUG_ARGS, "ldap_explode_dn of newSuperior failed\n", 0, 0, 0);
slapi_log_error(SLAPI_LOG_FATAL, NULL,
- "conn=%" PRIu64 " op=%d MODRDN invalid new superior (\"%s\")",
+ "conn=%" NSPRIu64 " op=%d MODRDN invalid new superior (\"%s\")",
pb->pb_conn->c_connid,
pb->pb_op->o_opid,
(NULL == newsuperior) ? "(null)" : newsuperiorbuf);
Index: monitor.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/monitor.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- monitor.c 24 Oct 2008 22:36:58 -0000 1.8
+++ monitor.c 5 Dec 2008 22:41:52 -0000 1.9
@@ -75,7 +75,6 @@
struct tm utm;
Slapi_Backend *be;
char *cookie;
- PRUint32 len;
vals[0] = &val;
vals[1] = NULL;
@@ -86,31 +85,26 @@
attrlist_replace( &e->e_attrs, "version", vals );
slapi_ch_free( (void **) &val.bv_val );
- sprintf( buf, "%d", g_get_active_threadcnt() );
+ val.bv_len = PR_snprintf( buf, sizeof(buf), "%d", g_get_active_threadcnt() );
val.bv_val = buf;
- val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "threads", vals );
connection_table_as_entry(the_connection_table, e);
- sprintf( buf, "%" PRIu64, slapi_counter_get_value(ops_initiated) );
+ val.bv_len = PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(ops_initiated) );
val.bv_val = buf;
- val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "opsinitiated", vals );
- sprintf( buf, "%" PRIu64, slapi_counter_get_value(ops_completed) );
+ val.bv_len = PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(ops_completed) );
val.bv_val = buf;
- val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "opscompleted", vals );
- len = PR_snprintf ( buf, BUFSIZ, "%" PRIu64, g_get_num_entries_sent() );
+ val.bv_len = PR_snprintf ( buf, sizeof(buf), "%" NSPRIu64, g_get_num_entries_sent() );
val.bv_val = buf;
- val.bv_len = ( unsigned long ) len;
attrlist_replace( &e->e_attrs, "entriessent", vals );
- len = PR_snprintf ( buf, BUFSIZ, "%" PRIu64, g_get_num_bytes_sent() );
+ val.bv_len = PR_snprintf ( buf, sizeof(buf), "%" NSPRIu64, g_get_num_bytes_sent() );
val.bv_val = buf;
- val.bv_len = ( unsigned long ) len;
attrlist_replace( &e->e_attrs, "bytessent", vals );
#ifdef _WIN32
@@ -141,15 +135,13 @@
val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "starttime", vals );
- sprintf( buf, "%d", be_nbackends_public() );
+ val.bv_len = PR_snprintf( buf, sizeof(buf), "%d", be_nbackends_public() );
val.bv_val = buf;
- val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "nbackends", vals );
#ifdef THREAD_SUNOS5_LWP
- sprintf( buf, "%d", thr_getconcurrency() );
+ val.bv_len = PR_snprintf( buf, sizeof(buf), "%d", thr_getconcurrency() );
val.bv_val = buf;
- val.bv_len = strlen( buf );
attrlist_replace( &e->e_attrs, "concurrency", vals );
#endif
Index: opshared.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/opshared.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- opshared.c 17 Oct 2008 22:12:47 -0000 1.13
+++ opshared.c 5 Dec 2008 22:41:52 -0000 1.14
@@ -230,7 +230,7 @@
{
char *fmtstr;
-#define SLAPD_SEARCH_FMTSTR_BASE "conn=%" PRIu64 " op=%d SRCH base=\"%s\" scope=%d "
+#define SLAPD_SEARCH_FMTSTR_BASE "conn=%" NSPRIu64 " op=%d SRCH base=\"%s\" scope=%d "
#define SLAPD_SEARCH_FMTSTR_BASE_INT "conn=%s op=%d SRCH base=\"%s\" scope=%d "
#define SLAPD_SEARCH_FMTSTR_REMAINDER " attrs=%s%s\n"
@@ -1329,7 +1329,7 @@
void op_shared_log_error_access (Slapi_PBlock *pb, const char *type, const char *dn, const char *msg)
{
char ebuf[BUFSIZ];
- slapi_log_access( LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d %s dn=\"%s\", %s\n",
+ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s dn=\"%s\", %s\n",
( pb->pb_conn ? pb->pb_conn->c_connid : 0),
( pb->pb_op ? pb->pb_op->o_opid : 0),
type,
Index: psearch.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/psearch.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- psearch.c 17 Oct 2008 22:12:47 -0000 1.10
+++ psearch.c 5 Dec 2008 22:41:52 -0000 1.11
@@ -305,7 +305,7 @@
if (conn_acq_flag) {
slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search",
- "conn=%" PRIu64 " op=%d Could not acquire the connection - psearch aborted\n",
+ "conn=%" NSPRIu64 " op=%d Could not acquire the connection - psearch aborted\n",
ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid);
}
@@ -315,7 +315,7 @@
/* Check for an abandoned operation */
if ( ps->ps_pblock->pb_op == NULL || slapi_op_abandoned( ps->ps_pblock ) ) {
slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search",
- "conn=%" PRIu64 " op=%d The operation has been abandoned\n",
+ "conn=%" NSPRIu64 " op=%d The operation has been abandoned\n",
ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid);
break;
}
@@ -373,7 +373,7 @@
ectrls, attrs, attrsonly );
if (rc) {
slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search",
- "conn=%" PRIu64 " op=%d Error %d sending entry %s with op status %d\n",
+ "conn=%" NSPRIu64 " op=%d Error %d sending entry %s with op status %d\n",
ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid,
rc, slapi_entry_get_dn_const(ec), ps->ps_pblock->pb_op->o_status);
}
@@ -421,7 +421,7 @@
PR_Lock( ps->ps_pblock->pb_conn->c_mutex );
slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search",
- "conn=%" PRIu64 " op=%d Releasing the connection and operation\n",
+ "conn=%" NSPRIu64 " op=%d Releasing the connection and operation\n",
ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid);
/* Delete this op from the connection's list */
connection_remove_operation( ps->ps_pblock->pb_conn, ps->ps_pblock->pb_op );
@@ -557,7 +557,7 @@
}
slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search",
- "conn=%" PRIu64 " op=%d entry %s with chgtype %d "
+ "conn=%" NSPRIu64 " op=%d entry %s with chgtype %d "
"matches the ps changetype %d\n",
ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid,
edn, chgtype, ps->ps_changetypes);
Index: result.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/result.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- result.c 24 Nov 2008 17:16:55 -0000 1.17
+++ result.c 5 Dec 2008 22:41:52 -0000 1.18
@@ -1641,7 +1641,7 @@
PR_snprintf(etime, ETIME_BUFSIZ, "%f",
(PRFloat64)delta/PR_TicksPerSecond());
} else {
- PR_snprintf(etime, ETIME_BUFSIZ, "%d", current_time() - op->o_time);
+ PR_snprintf(etime, ETIME_BUFSIZ, "%ld", current_time() - op->o_time);
}
if ( 0 == pb->pb_operation_notes ) {
@@ -1672,7 +1672,7 @@
if ( !internal_op )
{
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d RESULT err=%d"
+ "conn=%" NSPRIu64 " op=%d RESULT err=%d"
" tag=%u nentries=%d etime=%s%s%s"
", SASL bind in progress\n",
op->o_connid,
@@ -1704,7 +1704,7 @@
if ( !internal_op )
{
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d RESULT err=%d"
+ "conn=%" NSPRIu64 " op=%d RESULT err=%d"
" tag=%u nentries=%d etime=%s%s%s"
" dn=\"%s\"\n",
op->o_connid,
@@ -1730,7 +1730,7 @@
if ( !internal_op )
{
slapi_log_access( LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d RESULT err=%d"
+ "conn=%" NSPRIu64 " op=%d RESULT err=%d"
" tag=%u nentries=%d etime=%s%s%s\n",
op->o_connid,
op->o_opid,
@@ -1763,7 +1763,7 @@
if ( !internal_op )
{
- slapi_log_access( LDAP_DEBUG_STATS2, "conn=%" PRIu64 " op=%d ENTRY dn=\"%s\"\n",
+ slapi_log_access( LDAP_DEBUG_STATS2, "conn=%" NSPRIu64 " op=%d ENTRY dn=\"%s\"\n",
op->o_connid, op->o_opid,
escape_string( slapi_entry_get_dn_const(e), ebuf ));
}
@@ -1788,7 +1788,7 @@
if ( !internal_op )
{
- slapi_log_access( LDAP_DEBUG_STATS2, "conn=%" PRIu64 " op=%d REFERRAL\n",
+ slapi_log_access( LDAP_DEBUG_STATS2, "conn=%" NSPRIu64 " op=%d REFERRAL\n",
op->o_connid, op->o_opid );
}
else
Index: sasl_io.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/sasl_io.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- sasl_io.c 26 Nov 2008 17:32:21 -0000 1.17
+++ sasl_io.c 5 Dec 2008 22:41:52 -0000 1.18
@@ -82,7 +82,7 @@
int ret = 0;
LDAPDebug( LDAP_DEBUG_CONNS,
- "sasl_io_enable for connection %" PRIu64 "\n", c->c_connid, 0, 0 );
+ "sasl_io_enable for connection %" NSPRIu64 "\n", c->c_connid, 0, 0 );
/* Flag that we should enable SASL I/O for the next read operation on this connection */
c->c_enable_sasl_io = 1;
@@ -108,7 +108,7 @@
sasl_io_private *sp = (sasl_io_private*) slapi_ch_calloc(1, sizeof(sasl_io_private));
LDAPDebug( LDAP_DEBUG_CONNS,
- "sasl_io_setup for connection %" PRIu64 "\n", c->c_connid, 0, 0 );
+ "sasl_io_setup for connection %" NSPRIu64 "\n", c->c_connid, 0, 0 );
/* Get the current functions and store them for later */
real_iofns->lbextiofn_size = LBER_X_EXTIO_FNS_SIZE;
ber_sockbuf_get_option( c->c_sb, LBER_SOCKBUF_OPT_EXT_IO_FNS, real_iofns );
@@ -142,7 +142,7 @@
sasl_io_private *sp = c->c_sasl_io_private;
if (sp) {
LDAPDebug( LDAP_DEBUG_CONNS,
- "sasl_io_cleanup for connection %" PRIu64 "\n", c->c_connid, 0, 0 );
+ "sasl_io_cleanup for connection %" NSPRIu64 "\n", c->c_connid, 0, 0 );
/* Free the buffers */
slapi_ch_free((void**)&(sp->encrypted_buffer));
slapi_ch_free((void**)&(sp->decrypted_buffer));
@@ -204,7 +204,7 @@
}
if (ret != 0 && ret < sizeof(buffer)) {
LDAPDebug( LDAP_DEBUG_ANY,
- "failed to read sasl packet length on connection %" PRIu64 "\n", c->c_connid, 0, 0 );
+ "failed to read sasl packet length on connection %" NSPRIu64 "\n", c->c_connid, 0, 0 );
return -1;
}
@@ -215,7 +215,7 @@
packet_length += 4;
LDAPDebug( LDAP_DEBUG_CONNS,
- "read sasl packet length %ld on connection %" PRIu64 "\n", packet_length, c->c_connid, 0 );
+ "read sasl packet length %ld on connection %" NSPRIu64 "\n", packet_length, c->c_connid, 0 );
/* Check if the packet length is larger than our max allowed. A
* setting of -1 means that we allow any size SASL IO packet. */
@@ -270,7 +270,7 @@
*err = 0;
LDAPDebug( LDAP_DEBUG_CONNS,
- "sasl_recv_connection for connection %" PRIu64 "\n", c->c_connid, 0, 0 );
+ "sasl_recv_connection for connection %" NSPRIu64 "\n", c->c_connid, 0, 0 );
/* Do we have decrypted data buffered from 'before' ? */
bytes_in_buffer = sp->decrypted_buffer_count - sp->decrypted_buffer_offset;
if (0 == bytes_in_buffer) {
@@ -297,12 +297,12 @@
const char *output_buffer = NULL;
unsigned int output_length = 0;
LDAPDebug( LDAP_DEBUG_CONNS,
- "sasl_recv_connection finished reading packet for connection %" PRIu64 "\n", c->c_connid, 0, 0 );
+ "sasl_recv_connection finished reading packet for connection %" NSPRIu64 "\n", c->c_connid, 0, 0 );
/* Now decode it */
ret = sasl_decode(c->c_sasl_conn,sp->encrypted_buffer,sp->encrypted_buffer_count,&output_buffer,&output_length);
if (SASL_OK == ret) {
LDAPDebug( LDAP_DEBUG_CONNS,
- "sasl_recv_connection decoded packet length %d for connection %" PRIu64 "\n", output_length, c->c_connid, 0 );
+ "sasl_recv_connection decoded packet length %d for connection %" NSPRIu64 "\n", output_length, c->c_connid, 0 );
if (output_length) {
sasl_io_resize_decrypted_buffer(sp,output_length);
memcpy(sp->decrypted_buffer,output_buffer,output_length);
@@ -313,7 +313,7 @@
}
} else {
LDAPDebug( LDAP_DEBUG_ANY,
- "sasl_recv_connection failed to decode packet for connection %" PRIu64 "\n", c->c_connid, 0, 0 );
+ "sasl_recv_connection failed to decode packet for connection %" NSPRIu64 "\n", c->c_connid, 0, 0 );
}
}
}
Index: search.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/search.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- search.c 24 Oct 2008 22:36:58 -0000 1.11
+++ search.c 5 Dec 2008 22:41:52 -0000 1.12
@@ -384,7 +384,7 @@
{
char ebuf[BUFSIZ];
slapi_log_access(LDAP_DEBUG_STATS,
- "conn=%" PRIu64 " op=%d SRCH base=\"%s\" scope=%d filter=\"%s\", %s\n",
+ "conn=%" NSPRIu64 " op=%d SRCH base=\"%s\" scope=%d filter=\"%s\", %s\n",
pb->pb_conn->c_connid, pb->pb_op->o_opid,
escape_string(base, ebuf), scope, fstr, msg ? msg : "");
Index: slap.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slap.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- slap.h 2 Dec 2008 15:29:30 -0000 1.42
+++ slap.h 5 Dec 2008 22:41:52 -0000 1.43
@@ -121,14 +121,6 @@
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
-/* NSPR uses the print macros a bit differently than ANSI C. We
- * need to use ll for a 64-bit integer, even when a long is 64-bit.
- */
-#undef PRIu64
-#define PRIu64 "llu"
-#undef PRI64
-#define PRI64 "ll"
-
#else
#error Need to define portable format macros such as PRIu64
#endif /* HAVE_INTTYPES_H */
Index: slapi-plugin.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/slapi-plugin.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- slapi-plugin.h 13 Nov 2008 23:08:18 -0000 1.35
+++ slapi-plugin.h 5 Dec 2008 22:41:52 -0000 1.36
@@ -52,6 +52,37 @@
#include "prtypes.h"
#include "ldap.h"
+#include "prprf.h"
+NSPR_API(PRUint32) PR_snprintf(char *out, PRUint32 outlen, const char *fmt, ...)
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 3, 4)));
+#else
+ ;
+#endif
+NSPR_API(char*) PR_smprintf(const char *fmt, ...)
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 1, 2)));
+#else
+ ;
+#endif
+NSPR_API(char*) PR_sprintf_append(char *last, const char *fmt, ...)
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 2, 3)));
+#else
+ ;
+#endif
+NSPR_API(PRUint32) PR_fprintf(struct PRFileDesc* fd, const char *fmt, ...)
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 2, 3)));
+#else
+ ;
+#endif
+
+/* NSPR uses the print macros a bit differently than ANSI C. We
+ * need to use ll for a 64-bit integer, even when a long is 64-bit.
+ */
+#define NSPRIu64 "llu"
+#define NSPRI64 "ll"
/*
* The slapi_attr_get_flags() routine returns a bitmap that contains one or
@@ -1041,7 +1072,13 @@
/*
* logging
*/
-int slapi_log_error( int severity, char *subsystem, char *fmt, ... );
+int slapi_log_error( int severity, char *subsystem, char *fmt, ... )
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 3, 4)));
+#else
+ ;
+#endif
+
/* allowed values for the "severity" parameter */
#define SLAPI_LOG_FATAL 0
#define SLAPI_LOG_TRACE 1
Index: snmp_collator.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/snmp_collator.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- snmp_collator.c 28 Oct 2008 00:18:27 -0000 1.17
+++ snmp_collator.c 5 Dec 2008 22:41:52 -0000 1.18
@@ -765,7 +765,7 @@
add_counter_to_value(Slapi_Entry *e, const char *type, PRUint64 countervalue)
{
char value[40];
- sprintf(value,"%" PRIu64, countervalue);
+ PR_snprintf(value,sizeof(value),"%" NSPRIu64, countervalue);
slapi_entry_attr_set_charptr( e, type, value);
}
Index: ssl.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/ssl.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ssl.c 2 Dec 2008 15:29:30 -0000 1.20
+++ ssl.c 5 Dec 2008 22:41:52 -0000 1.21
@@ -166,7 +166,7 @@
cipher_names = (char **) slapi_ch_calloc ((number_of_ciphers +1 ) , sizeof(char *));
for (i = 0 ; _conf_ciphers[i].name != NULL; i++ ) {
SSL_GetCipherSuiteInfo((PRUint16)_conf_ciphers[i].num,&info,sizeof(info));
- cipher_names[i] = PR_smprintf("%s%s%s%s%s%s%s%s%d\0",_conf_ciphers[i].version,sep,_conf_ciphers[i].name,sep,info.symCipherName,sep,info.macAlgorithmName,sep,info.symKeyBits);
+ cipher_names[i] = PR_smprintf("%s%s%s%s%s%s%s%s%d",_conf_ciphers[i].version,sep,_conf_ciphers[i].name,sep,info.symCipherName,sep,info.macAlgorithmName,sep,info.symKeyBits);
}
cipher_names[i] = NULL;
}
Index: unbind.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/unbind.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- unbind.c 17 Oct 2008 22:12:47 -0000 1.6
+++ unbind.c 5 Dec 2008 22:41:53 -0000 1.7
@@ -79,7 +79,7 @@
* UnBindRequest ::= NULL
*/
if ( ber_get_null( ber ) == LBER_ERROR ) {
- slapi_log_access( LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d UNBIND,"
+ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNBIND,"
" decoding error: UnBindRequest not null\n",
pb->pb_conn->c_connid, operation->o_opid );
/* LDAPv3 does not allow a response to an unbind... so just return. */
@@ -92,7 +92,7 @@
* pass them to the backend.
*/
if ( (err = get_ldapmessage_controls( pb, ber, NULL )) != 0 ) {
- slapi_log_access( LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d UNBIND,"
+ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNBIND,"
" error processing controls - error %d (%s)\n",
pb->pb_conn->c_connid, operation->o_opid,
err, ldap_err2string( err ));
@@ -107,7 +107,7 @@
/* ONREPL - plugins should be called and passed bind dn and, possibly, other data */
- slapi_log_access( LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d UNBIND\n",
+ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNBIND\n",
pb->pb_conn->c_connid, operation->o_opid );
/* pass the unbind to all backends */
Index: util.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/util.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- util.c 2 Dec 2008 15:29:31 -0000 1.20
+++ util.c 5 Dec 2008 22:41:53 -0000 1.21
@@ -1161,7 +1161,7 @@
} else if (rc == 0) { /* timeout */
rc = LDAP_TIMEOUT;
slapi_log_error(SLAPI_LOG_FATAL, "slapi_ldap_bind",
- "Error: timeout after [%d.%d] seconds reading "
+ "Error: timeout after [%ld.%ld] seconds reading "
"bind response for [%s] mech [%s]\n",
timeout ? timeout->tv_sec : 0,
timeout ? timeout->tv_usec : 0,
15 years, 4 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm dbverify.c, 1.4, 1.5 ldbm_delete.c, 1.9, 1.10 ldbm_modrdn.c, 1.10, 1.11 ldif2ldbm.c, 1.22, 1.23 misc.c, 1.7, 1.8
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13701/ldapserver/ldap/servers/slapd/back-ldbm
Modified Files:
dbverify.c ldbm_delete.c ldbm_modrdn.c ldif2ldbm.c misc.c
Log Message:
Resolves: bug 454030
Bug Description: Need to address 64-bit compiler warnings - again
Reviewed by: nhosoi (Thanks!)
Fix Description: This patch cleans up most of the other remaining compiler warnings. I compiled the directory server code with these flags on RHEL5 x86_64: -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
I also enabled argument/format match checking for most of the commonly used varadic functions. Most of the problems I found fell into these categories:
1) Too many or not enough arguments e.g. most everything that uses or did use LDAPDebug had extra 0,0 arguments. If they had been switched to use slapi_log_error, I removed the extra arguments - for those places still using LDAPDebug, I introduced more macros to handle the number of arguments, since C macros cannot be varadic.
2) When using NSPR formatting functions, we have to use %llu or %lld for 64-bit values, even on 64-bit systems. However, for regular system formatting functions, we have to use %ld or %lu. I introduced two new macros NSPRIu64 and NSPRI64 to handle cases where we are passing explicit 64-bit values to NSPR formatting functions, so that we can use the regular PRIu64 and PRI64 macros for regular system formatting functions. I also made sure we used NSPRI* only with NSPR functions, and used PRI* only with system functions.
3) use %lu for size_t and %ld for time_t
I did find a few "real" errors, places that the code was doing something definitely not right:
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
This is why it's important to use this compiler checking, and why it's important to fix compiler warnings, if for no other reason than the sheer noise from so many warnings can mask real errors.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Index: dbverify.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dbverify.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- dbverify.c 19 Nov 2008 02:52:42 -0000 1.4
+++ dbverify.c 5 Dec 2008 22:41:53 -0000 1.5
@@ -66,7 +66,7 @@
{
slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
"db path too long: %s/%s\n",
- inst->inst_parent_dir_name, inst->inst_dir_name, 0);
+ inst->inst_parent_dir_name, inst->inst_dir_name);
return 1;
}
tmplen = strlen(dbdir);
@@ -99,8 +99,8 @@
if (sizeof(direntry->name) + 2 > filelen)
{
slapi_log_error(SLAPI_LOG_FATAL, "DB verify",
- "db path too long: %s/%s%s\n",
- dbdir, direntry->name, 0);
+ "db path too long: %s/%s\n",
+ dbdir, direntry->name);
continue;
}
PR_snprintf(filep, filelen, "/%s", direntry->name);
Index: ldbm_delete.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_delete.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ldbm_delete.c 17 Oct 2008 22:12:48 -0000 1.9
+++ ldbm_delete.c 5 Dec 2008 22:41:53 -0000 1.10
@@ -93,7 +93,7 @@
if (pb->pb_conn)
{
- slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "enter conn=%" PRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid);
+ slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "enter conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid);
}
is_fixup_operation = operation_is_flag_set(operation, OP_FLAG_REPL_FIXUP);
@@ -666,7 +666,7 @@
slapi_ch_free_string(&e_uniqueid);
if (pb->pb_conn)
{
- slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "leave conn=%" PRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid);
+ slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "leave conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid);
}
return rc;
}
Index: ldbm_modrdn.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ldbm_modrdn.c 13 Nov 2008 23:08:19 -0000 1.10
+++ ldbm_modrdn.c 5 Dec 2008 22:41:53 -0000 1.11
@@ -117,7 +117,7 @@
if (pb->pb_conn)
{
- slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_modrdn", "enter conn=%" PRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid);
+ slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_modrdn", "enter conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid);
}
inst = (ldbm_instance *) be->be_instance_info;
@@ -862,7 +862,7 @@
slapi_pblock_set( pb, SLAPI_ENTRY_POST_OP, postentry );
if (pb->pb_conn)
{
- slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_modrdn", "leave conn=%" PRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid);
+ slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_modrdn", "leave conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid);
}
return retval;
}
Index: ldif2ldbm.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/ldif2ldbm.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ldif2ldbm.c 4 Dec 2008 00:50:18 -0000 1.22
+++ ldif2ldbm.c 5 Dec 2008 22:41:53 -0000 1.23
@@ -679,7 +679,7 @@
/* for each subtree spec... */
for (i = 0; include[i]; i++) {
IDList *idl = NULL;
- char *suffix = slapi_sdn_get_ndn(*be->be_suffix);
+ const char *suffix = slapi_sdn_get_ndn(*be->be_suffix);
char *parentdn = slapi_ch_strdup(suffix);
char *nextdn = NULL;
int matched = 0;
@@ -695,7 +695,7 @@
while (NULL != parentdn &&
NULL != (nextdn = slapi_dn_parent( parentdn ))) {
slapi_ch_free_string( &parentdn );
- if (0 == slapi_utf8casecmp(nextdn, include[i])) {
+ if (0 == slapi_UTF8CASECMP(nextdn, include[i])) {
issubsuffix = 1; /* suffix of be is a subsuffix of include[i] */
break;
}
@@ -719,7 +719,7 @@
while (NULL != parentdn &&
NULL != (nextdn = slapi_dn_parent( parentdn ))) {
slapi_ch_free_string( &parentdn );
- if (0 == slapi_utf8casecmp(nextdn, suffix)) {
+ if (0 == slapi_UTF8CASECMP(nextdn, (char *)suffix)) {
matched = 1;
break;
}
@@ -2458,7 +2458,7 @@
inst_dir, MAXPATHLEN);
slapi_log_error(SLAPI_LOG_TRACE, "upgrade DB",
- "upgradedb_delete_indices_4cmd: %s\n");
+ "upgradedb_delete_indices_4cmd: %s\n", inst_dir);
dirhandle = PR_OpenDir(inst_dirp);
if (!dirhandle)
{
Index: misc.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/misc.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- misc.c 17 Oct 2008 22:12:48 -0000 1.7
+++ misc.c 5 Dec 2008 22:41:53 -0000 1.8
@@ -81,7 +81,7 @@
return;
}
operation_id = operation->o_opid;
- slapi_log_access( LDAP_DEBUG_STATS, "conn=%" PRIu64 " op=%d %s\n",connection_id, operation_id,string);
+ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s\n",connection_id, operation_id,string);
}
int return_on_disk_full(struct ldbminfo *li)
15 years, 4 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication cl5_api.c, 1.25, 1.26 cl5_clcache.c, 1.8, 1.9 cl5_config.c, 1.8, 1.9 repl5_agmt.c, 1.15, 1.16 repl5_connection.c, 1.14, 1.15 repl5_inc_protocol.c, 1.13, 1.14 repl5_init.c, 1.8, 1.9 repl5_plugins.c, 1.10, 1.11 repl5_replica.c, 1.20, 1.21 repl5_tot_protocol.c, 1.9, 1.10 repl5_total.c, 1.12, 1.13 repl_connext.c, 1.7, 1.8 repl_extop.c, 1.15, 1.16 replutil.c, 1.14, 1.15 windows_connection.c, 1.22, 1.23 windows_inc_protocol.c, 1.17, 1.18 wind
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13701/ldapserver/ldap/servers/plugins/replication
Modified Files:
cl5_api.c cl5_clcache.c cl5_config.c repl5_agmt.c
repl5_connection.c repl5_inc_protocol.c repl5_init.c
repl5_plugins.c repl5_replica.c repl5_tot_protocol.c
repl5_total.c repl_connext.c repl_extop.c replutil.c
windows_connection.c windows_inc_protocol.c windows_private.c
windows_protocol_util.c windows_tot_protocol.c
Log Message:
Resolves: bug 454030
Bug Description: Need to address 64-bit compiler warnings - again
Reviewed by: nhosoi (Thanks!)
Fix Description: This patch cleans up most of the other remaining compiler warnings. I compiled the directory server code with these flags on RHEL5 x86_64: -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
I also enabled argument/format match checking for most of the commonly used varadic functions. Most of the problems I found fell into these categories:
1) Too many or not enough arguments e.g. most everything that uses or did use LDAPDebug had extra 0,0 arguments. If they had been switched to use slapi_log_error, I removed the extra arguments - for those places still using LDAPDebug, I introduced more macros to handle the number of arguments, since C macros cannot be varadic.
2) When using NSPR formatting functions, we have to use %llu or %lld for 64-bit values, even on 64-bit systems. However, for regular system formatting functions, we have to use %ld or %lu. I introduced two new macros NSPRIu64 and NSPRI64 to handle cases where we are passing explicit 64-bit values to NSPR formatting functions, so that we can use the regular PRIu64 and PRI64 macros for regular system formatting functions. I also made sure we used NSPRI* only with NSPR functions, and used PRI* only with system functions.
3) use %lu for size_t and %ld for time_t
I did find a few "real" errors, places that the code was doing something definitely not right:
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
This is why it's important to use this compiler checking, and why it's important to fix compiler warnings, if for no other reason than the sheer noise from so many warnings can mask real errors.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Index: cl5_api.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_api.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- cl5_api.c 26 Nov 2008 00:13:42 -0000 1.25
+++ cl5_api.c 5 Dec 2008 22:41:51 -0000 1.26
@@ -3626,6 +3626,7 @@
{
PR_snprintf (plVersion, VERSION_SIZE, "%s/%d.%d/%s\n",
BDB_IMPL, DB_VERSION_MAJOR, DB_VERSION_MINOR, BDB_REPLPLUGIN);
+ dbVersion[0] = '\0';
rc = _cl5ReadGuardian (dbVersion);
if (rc != CL5_SUCCESS || strcasecmp (plVersion, dbVersion) != 0)
@@ -4954,7 +4955,7 @@
break;
default: slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5Operation2LDIF: invalid operation type - %d\n", op->operation_type);
+ "_cl5Operation2LDIF: invalid operation type - %lu\n", op->operation_type);
return CL5_BAD_FORMAT;
}
@@ -5131,7 +5132,7 @@
break;
default: slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5LDIF2Operation: invalid operation type - %d\n",
+ "_cl5LDIF2Operation: invalid operation type - %lu\n",
op->operation_type);
return CL5_BAD_FORMAT;
}
@@ -5375,7 +5376,7 @@
if (rc != 0)
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
- "_cl5GetFirstOperation: failed to format entry\n", rc);
+ "_cl5GetFirstOperation: failed to format entry: %d\n", rc);
goto done;
}
@@ -5466,7 +5467,7 @@
if (rc != 0)
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl,
- "_cl5GetNextEntry: failed to format entry\n", rc);
+ "_cl5GetNextEntry: failed to format entry: %d\n", rc);
}
return rc;
@@ -6659,7 +6660,7 @@
object_release (obj);
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
"_cl5CopyDBFiles: failed to copy %s from %s to %s\n",
- file, srcDir, destDir);
+ file->name, srcDir, destDir);
return CL5_SYSTEM_ERROR;
}
@@ -6892,7 +6893,7 @@
if (fsiz < NO_DISK_SPACE)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "cl5_diskspace_is_available: No enough diskspace for changelog: (%u bytes free)\n", fsiz);
+ "cl5_diskspace_is_available: No enough diskspace for changelog: (%lu bytes free)\n", fsiz);
rval = 0;
}
else if (fsiz > MIN_DISK_SPACE)
Index: cl5_clcache.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_clcache.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cl5_clcache.c 23 Jun 2008 18:32:11 -0000 1.8
+++ cl5_clcache.c 5 Dec 2008 22:41:51 -0000 1.9
@@ -645,7 +645,7 @@
/* Skip helper entry (ENTRY_COUNT, PURGE_RUV and so on) */
if ( cl5HelperEntry ( NULL, buf->buf_current_csn ) == PR_TRUE ) {
slapi_log_error ( SLAPI_LOG_REPL, buf->buf_agmt_name,
- "Skip helper entry type=%d\n", csn_get_time( buf->buf_current_csn ));
+ "Skip helper entry type=%ld\n", csn_get_time( buf->buf_current_csn ));
break;
}
@@ -922,7 +922,7 @@
&( buf->buf_data ),
buf->buf_load_flag | flag );
slapi_log_error ( SLAPI_LOG_REPL, buf->buf_agmt_name,
- "clcache: (%d | %d) %s reallocated and retry returns %d\n", buf->buf_load_flag, flag, buf->buf_key.data, rc );
+ "clcache: (%d | %d) buf key len %d reallocated and retry returns %d\n", buf->buf_load_flag, flag, buf->buf_key.size, rc );
}
}
Index: cl5_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_config.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cl5_config.c 18 Oct 2007 00:08:31 -0000 1.8
+++ cl5_config.c 5 Dec 2008 22:41:51 -0000 1.9
@@ -890,7 +890,7 @@
if (theSize < CL5_MIN_NB_LOCK)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "Warning: Changelog %s value is too low (%d). Set to minimal value instead (%d)\n",
+ "Warning: Changelog %s value is too low (%ld). Set to minimal value instead (%d)\n",
CONFIG_CHANGELOG_NB_LOCK, theSize, CL5_MIN_NB_LOCK);
config->dbconfig.nb_lock_config = CL5_MIN_NB_LOCK;
}
Index: repl5_agmt.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_agmt.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- repl5_agmt.c 4 Nov 2008 18:23:08 -0000 1.15
+++ repl5_agmt.c 5 Dec 2008 22:41:51 -0000 1.16
@@ -192,19 +192,19 @@
if (ra->timeout < 0)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Replication agreement \"%s\" "
- "is malformed: invalid timeout %d.\n", slapi_sdn_get_dn(ra->dn), ra->timeout);
+ "is malformed: invalid timeout %ld.\n", slapi_sdn_get_dn(ra->dn), ra->timeout);
return_value = 0;
}
if (ra->busywaittime < 0)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Replication agreement \"%s\" "
- "is malformed: invalid busy wait time %d.\n", slapi_sdn_get_dn(ra->dn), ra->busywaittime);
+ "is malformed: invalid busy wait time %ld.\n", slapi_sdn_get_dn(ra->dn), ra->busywaittime);
return_value = 0;
}
if (ra->pausetime < 0)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Replication agreement \"%s\" "
- "is malformed: invalid pausetime %d.\n", slapi_sdn_get_dn(ra->dn), ra->pausetime);
+ "is malformed: invalid pausetime %ld.\n", slapi_sdn_get_dn(ra->dn), ra->pausetime);
return_value = 0;
}
return return_value;
Index: repl5_connection.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_connection.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- repl5_connection.c 4 Dec 2008 00:55:47 -0000 1.14
+++ repl5_connection.c 5 Dec 2008 22:41:51 -0000 1.15
@@ -54,6 +54,7 @@
#include "repl5.h"
#include "ldappr.h"
#include "ldap-extension.h"
+#include "nss.h"
typedef struct repl_connection
{
@@ -1701,6 +1702,6 @@
config_set_errorlog_level("nsslapd-errorlog-level", buf, msg, 1);
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
- "repl5_debug_timeout_callback: set debug level to %d at %d\n",
+ "repl5_debug_timeout_callback: set debug level to %d at %ld\n",
s_debug_level, when);
}
Index: repl5_inc_protocol.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_inc_protocol.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- repl5_inc_protocol.c 24 Jun 2008 22:22:09 -0000 1.13
+++ repl5_inc_protocol.c 5 Dec 2008 22:41:51 -0000 1.14
@@ -464,7 +464,7 @@
/* Are we caught up ? */
slapi_log_error(SLAPI_LOG_REPL, NULL,
"repl5_inc_waitfor_async_results: %d %d\n",
- rd->last_message_id_received, rd->last_message_id_sent, 0);
+ rd->last_message_id_received, rd->last_message_id_sent);
if (rd->last_message_id_received >= rd->last_message_id_sent)
{
/* If so then we're done */
@@ -481,7 +481,7 @@
/* Log a warning */
slapi_log_error(SLAPI_LOG_FATAL, NULL,
"repl5_inc_waitfor_async_results timed out waiting for responses: %d %d\n",
- rd->last_message_id_received, rd->last_message_id_sent, 0);
+ rd->last_message_id_received, rd->last_message_id_sent);
done = 1;
}
}
@@ -966,7 +966,7 @@
next_fire_time = backoff_step(prp_priv->backoff);
/* And go back to sleep */
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "%s: Replication session backing off for %d seconds\n",
+ "%s: Replication session backing off for %ld seconds\n",
agmt_get_long_name(prp->agmt),
next_fire_time - now);
@@ -1448,7 +1448,7 @@
break;
default:
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "%s: replay_update: Unknown "
- "operation type %d found in changelog - skipping change.\n",
+ "operation type %lu found in changelog - skipping change.\n",
agmt_get_long_name(prp->agmt), op->operation_type);
}
Index: repl5_init.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_init.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- repl5_init.c 17 Oct 2008 22:12:47 -0000 1.8
+++ repl5_init.c 5 Dec 2008 22:41:52 -0000 1.9
@@ -193,7 +193,7 @@
/* Avoid "Connection is NULL and hence cannot access SLAPI_CONN_ID" */
if (opid) {
slapi_pblock_get (pb, SLAPI_CONN_ID, &connid);
- PR_snprintf (idstr, REPL_SESSION_ID_SIZE, "conn=%" PRIu64 " op=%d", connid, opid);
+ PR_snprintf (idstr, REPL_SESSION_ID_SIZE, "conn=%" NSPRIu64 " op=%d", connid, opid);
}
slapi_pblock_get ( pb, SLAPI_OPERATION, &op );
Index: repl5_plugins.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_plugins.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- repl5_plugins.c 18 Oct 2007 22:40:17 -0000 1.10
+++ repl5_plugins.c 5 Dec 2008 22:41:52 -0000 1.11
@@ -1015,7 +1015,7 @@
/* ONREPL - log error */
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
"write_changelog_and_ruv: can't add a change for "
- "%s (uniqid: %s, optype: %u) to changelog csn %s\n",
+ "%s (uniqid: %s, optype: %lu) to changelog csn %s\n",
op_params->target_address.dn,
op_params->target_address.uniqueid,
op_params->operation_type,
Index: repl5_replica.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_replica.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- repl5_replica.c 13 Nov 2008 23:08:18 -0000 1.20
+++ repl5_replica.c 5 Dec 2008 22:41:52 -0000 1.21
@@ -421,7 +421,7 @@
*isInc = (r->repl_state_flags & REPLICA_INCREMENTAL_IN_PROGRESS);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": "
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": "
"Replica in use locking_purl=%s\n",
connid, opid,
escape_string(slapi_sdn_get_dn(r->repl_root),ebuf),
@@ -435,7 +435,7 @@
else
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": Acquired replica\n",
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": Acquired replica\n",
connid, opid,
escape_string(slapi_sdn_get_dn(r->repl_root),ebuf));
r->repl_state_flags |= REPLICA_IN_USE;
@@ -476,13 +476,13 @@
if (!(r->repl_state_flags & REPLICA_IN_USE))
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": "
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": "
"Replica not in use\n",
connid, opid,
escape_string(slapi_sdn_get_dn(r->repl_root),ebuf));
} else {
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": "
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": "
"Released replica\n",
connid, opid,
escape_string(slapi_sdn_get_dn(r->repl_root),ebuf));
@@ -1111,7 +1111,7 @@
_replica_type_as_string (r));
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\treplica id: %d\n", r->repl_rid);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tflags: %d\n", r->repl_flags);
- slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tstate flags: %d\n", r->repl_state_flags);
+ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tstate flags: %lu\n", r->repl_state_flags);
if (r->updatedn_list)
updatedn_list = replica_updatedn_list_to_string(r->updatedn_list, "\n\t\t");
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tupdate dn: %s\n",
@@ -2522,15 +2522,15 @@
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
"_replica_reap_tombstones: failed when searching for "
- "tombstones in replica %s: %s. Will try again in %d "
+ "tombstones in replica %s: %s. Will try again in %ld "
"seconds.\n", escape_string(slapi_sdn_get_dn(replica->repl_root),ebuf),
ldap_err2string(oprc), replica->tombstone_reap_interval);
}
else
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "_replica_reap_tombstones: purged %d of %d tombstones "
- "in replica %s. Will try again in %d "
+ "_replica_reap_tombstones: purged %ld of %ld tombstones "
+ "in replica %s. Will try again in %ld "
"seconds.\n", cb_data.num_purged_entries, cb_data.num_entries,
escape_string(slapi_sdn_get_dn(replica->repl_root),ebuf),
replica->tombstone_reap_interval);
@@ -3020,7 +3020,7 @@
slapi_ch_free ((void**)&repl_name);
found = slapi_eq_cancel (r->repl_eqcxt_tr);
slapi_log_error (SLAPI_LOG_REPL, NULL,
- "tombstone_reap event (interval=%d) was %s\n",
+ "tombstone_reap event (interval=%ld) was %s\n",
r->tombstone_reap_interval, (found ? "cancelled" : "not found"));
r->repl_eqcxt_tr = NULL;
}
@@ -3032,7 +3032,7 @@
current_time() + r->tombstone_reap_interval,
1000 * r->tombstone_reap_interval);
slapi_log_error (SLAPI_LOG_REPL, NULL,
- "tombstone_reap event (interval=%d) was %s\n",
+ "tombstone_reap event (interval=%ld) was %s\n",
r->tombstone_reap_interval, (r->repl_eqcxt_tr ? "scheduled" : "not scheduled successfully"));
}
PR_Unlock(r->repl_lock);
Index: repl5_tot_protocol.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_tot_protocol.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- repl5_tot_protocol.c 10 Nov 2006 23:45:17 -0000 1.9
+++ repl5_tot_protocol.c 5 Dec 2008 22:41:52 -0000 1.10
@@ -122,8 +122,7 @@
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
"%s: Received error %d: %s for total update operation\n",
agreement_name,
- ldap_error, ldap_error_string ? ldap_error_string : "NULL",
- 0);
+ ldap_error, ldap_error_string ? ldap_error_string : "NULL");
}
/* Thread that collects results from async operations sent to the consumer */
@@ -285,7 +284,7 @@
/* Are we caught up ? */
slapi_log_error(SLAPI_LOG_REPL, NULL,
"repl5_tot_waitfor_async_results: %d %d\n",
- cb_data->last_message_id_received, cb_data->last_message_id_sent, 0);
+ cb_data->last_message_id_received, cb_data->last_message_id_sent);
if (cb_data->last_message_id_received >= cb_data->last_message_id_sent)
{
/* If so then we're done */
@@ -302,7 +301,7 @@
/* Log a warning */
slapi_log_error(SLAPI_LOG_FATAL, NULL,
"repl5_tot_waitfor_async_results timed out waiting for responses: %d %d\n",
- cb_data->last_message_id_received, cb_data->last_message_id_sent, 0);
+ cb_data->last_message_id_received, cb_data->last_message_id_sent);
done = 1;
}
}
@@ -474,7 +473,7 @@
agmt_set_last_init_status(prp->agmt, rc, 0, "Total update aborted");
} else {
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Finished total update of replica "
- "\"%s\". Sent %d entries.\n", agmt_get_long_name(prp->agmt), cb_data.num_entries);
+ "\"%s\". Sent %lu entries.\n", agmt_get_long_name(prp->agmt), cb_data.num_entries);
agmt_set_last_init_status(prp->agmt, 0, 0, "Total update succeeded");
}
@@ -692,7 +691,7 @@
*last_busyp = now;
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
- "Replica \"%s\" is busy. Waiting %ds while"
+ "Replica \"%s\" is busy. Waiting %lds while"
" it finishes processing its current import queue\n",
agmt_get_long_name(prp->agmt), *sleep_on_busyp);
DS_Sleep(PR_SecondsToInterval(*sleep_on_busyp));
Index: repl5_total.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_total.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- repl5_total.c 17 Oct 2008 22:12:47 -0000 1.12
+++ repl5_total.c 5 Dec 2008 22:41:52 -0000 1.13
@@ -881,7 +881,7 @@
const char *dn = slapi_entry_get_dn_const(e);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
"Error %d: could not import entry dn %s "
- "for total update operation conn=%" PRIu64 " op=%d\n",
+ "for total update operation conn=%" NSPRIu64 " op=%d\n",
rc, dn, connid, opid);
rc = -1;
}
@@ -891,7 +891,7 @@
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
"Error %d: could not decode the total update extop "
- "for total update operation conn=%" PRIu64 " op=%d\n",
+ "for total update operation conn=%" NSPRIu64 " op=%d\n",
rc, connid, opid);
}
Index: repl_connext.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl_connext.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- repl_connext.c 17 Oct 2008 22:12:47 -0000 1.7
+++ repl_connext.c 5 Dec 2008 22:41:52 -0000 1.8
@@ -101,7 +101,7 @@
slapi_pblock_get(pb, SLAPI_CONN_ID, &connid);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
"Aborting total update in progress for replicated "
- "area %s connid=%" PRIu64 "\n", slapi_sdn_get_dn(repl_root_sdn),
+ "area %s connid=%" NSPRIu64 "\n", slapi_sdn_get_dn(repl_root_sdn),
connid);
slapi_stop_bulk_import(pb);
}
Index: repl_extop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl_extop.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- repl_extop.c 4 Dec 2008 00:42:18 -0000 1.15
+++ repl_extop.c 5 Dec 2008 22:41:52 -0000 1.16
@@ -605,7 +605,7 @@
/* Stash info that this is an incremental update session */
connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL;
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": Begin incremental protocol\n",
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin incremental protocol\n",
connid, opid, repl_root);
isInc = PR_TRUE;
}
@@ -617,7 +617,7 @@
connext->repl_protocol_version = REPL_PROTOCOL_50_TOTALUPDATE;
}
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": Begin total protocol\n",
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin total protocol\n",
connid, opid, repl_root);
isInc = PR_FALSE;
}
@@ -626,7 +626,7 @@
/* Stash info that this is an incremental update session */
connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL;
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": Begin 7.1 incremental protocol\n",
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin 7.1 incremental protocol\n",
connid, opid, repl_root);
isInc = PR_TRUE;
}
@@ -638,7 +638,7 @@
connext->repl_protocol_version = REPL_PROTOCOL_71_TOTALUPDATE;
}
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": Begin 7.1 total protocol\n",
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin 7.1 total protocol\n",
connid, opid, repl_root);
isInc = PR_FALSE;
}
@@ -660,7 +660,7 @@
if (replica_is_being_configured(repl_root))
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d replica=\"%s\": "
+ "conn=%" NSPRIu64 " op=%d replica=\"%s\": "
"Replica is being configured: try again later\n",
connid, opid, repl_root);
response = NSDS50_REPL_REPLICA_BUSY;
@@ -713,7 +713,7 @@
{
response = NSDS50_REPL_EXCESSIVE_CLOCK_SKEW;
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": "
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": "
"Excessive clock skew from supplier RUV\n",
connid, opid, repl_root);
goto send_response;
@@ -749,7 +749,7 @@
if (check_replica_id_uniqueness(replica, supplier_ruv) != 0){
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": "
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": "
"Replica has same replicaID %d as supplier\n",
connid, opid, repl_root, replica_get_rid(replica));
response = NSDS50_REPL_REPLICAID_ERROR;
@@ -762,7 +762,7 @@
* the session's conn id and op id to identify the the supplier.
*/
/* junkrc = ruv_get_first_id_and_purl(supplier_ruv, &junkrid, &locking_purl); */
- PR_snprintf(locking_session, sizeof(locking_session), "conn=%" PRIu64 " id=%d", connid, opid);
+ PR_snprintf(locking_session, sizeof(locking_session), "conn=%" NSPRIu64 " id=%d", connid, opid);
locking_purl = &locking_session[0];
if (replica_get_exclusive_access(replica, &isInc, connid, opid,
locking_purl,
@@ -878,7 +878,7 @@
}
slapi_log_error (resp_log_level, repl_plugin_name,
- "conn=%" PRIu64 " op=%d replica=\"%s\": "
+ "conn=%" NSPRIu64 " op=%d replica=\"%s\": "
"Unable to acquire replica: error: %s%s\n",
connid, opid,
(replica ? slapi_sdn_get_dn(replica_get_root(replica)) : "unknown"),
@@ -902,7 +902,7 @@
slapi_pblock_set(pb, SLAPI_EXT_OP_RET_OID, REPL_NSDS50_REPLICATION_RESPONSE_OID);
slapi_pblock_set(pb, SLAPI_EXT_OP_RET_VALUE, resp_bval);
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
- "conn=%" PRIu64 " op=%d repl=\"%s\": "
+ "conn=%" NSPRIu64 " op=%d repl=\"%s\": "
"StartNSDS50ReplicationRequest: response=%d rc=%d\n",
connid, opid, repl_root,
response, rc);
Index: replutil.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/replutil.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- replutil.c 4 Dec 2008 00:42:18 -0000 1.14
+++ replutil.c 5 Dec 2008 22:41:52 -0000 1.15
@@ -236,7 +236,7 @@
{
/* means error */
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
- "copyfile: failed to write to destination file %s\n");
+ "copyfile: failed to write to destination file %s\n", destination);
return_value = -1;
break;
}
@@ -822,7 +822,9 @@
int repl_op = 0;
int local_backend = -1; /* index of local backend */
int chaining_backend = -1; /* index of chain backend */
+#ifdef DEBUG_CHAIN_ON_UPDATE
int is_internal = 0;
+#endif
PRBool local_online = PR_FALSE; /* true if the local db is online */
int ii;
int opid;
Index: windows_connection.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_connection.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- windows_connection.c 2 Dec 2008 15:29:30 -0000 1.22
+++ windows_connection.c 5 Dec 2008 22:41:52 -0000 1.23
@@ -55,6 +55,7 @@
#include "windowsrepl.h"
#include "ldappr.h"
#include "slap.h"
+#include "nss.h"
typedef struct repl_connection
{
@@ -880,7 +881,7 @@
ldap_controls_free(returned_controls);
}
if (windows_private_dirsync_has_more(conn->agmt)) {
- slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,"received hasmore from dirsync\n", 0);
+ slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,"received hasmore from dirsync\n");
}
}
break;
@@ -1900,7 +1901,7 @@
config_set_errorlog_level("nsslapd-errorlog-level", buf, msg, 1);
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
- "repl5_debug_timeout_callback: set debug level to %d at %d\n",
+ "repl5_debug_timeout_callback: set debug level to %d at %ld\n",
s_debug_level, when);
LDAPDebug( LDAP_DEBUG_TRACE, "<= repl5_debug_timeout_callback\n", 0, 0, 0 );
Index: windows_inc_protocol.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_inc_protocol.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- windows_inc_protocol.c 27 Aug 2008 21:46:56 -0000 1.17
+++ windows_inc_protocol.c 5 Dec 2008 22:41:52 -0000 1.18
@@ -162,18 +162,18 @@
static void
windows_inc_delete(Private_Repl_Protocol **prpp)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_delete\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_delete\n" );
/* First, stop the protocol if it isn't already stopped */
/* Then, delete all resources used by the protocol */
slapi_eq_cancel(dirsync);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_delete\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_delete\n" );
}
/* helper function */
void
w_set_pause_and_busy_time(long *pausetime, long *busywaittime)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> w_set_pause_and_busy_time\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> w_set_pause_and_busy_time\n" );
/* If neither are set, set busy time to its default */
if (!*pausetime && !*busywaittime)
{
@@ -210,7 +210,7 @@
*/
*pausetime = *busywaittime + 1;
}
- LDAPDebug( LDAP_DEBUG_TRACE, "<= w_set_pause_and_busy_time\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= w_set_pause_and_busy_time\n" );
}
/*
@@ -286,7 +286,7 @@
PRBool run_dirsync = PR_FALSE;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_run\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_run\n" );
prp->stopped = 0;
prp->terminate = 0;
@@ -685,7 +685,7 @@
next_fire_time = backoff_step(prp_priv->backoff);
/* And go back to sleep */
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
- "%s: Replication session backing off for %d seconds\n",
+ "%s: Replication session backing off for %ld seconds\n",
agmt_get_long_name(prp->agmt),
next_fire_time - now);
@@ -991,7 +991,7 @@
conn_cancel_linger(prp->conn);
/* ... and disconnect, if currently connected */
conn_disconnect(prp->conn);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_run\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_run\n" );
}
@@ -1002,7 +1002,7 @@
static void
protocol_sleep(Private_Repl_Protocol *prp, PRIntervalTime duration)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> protocol_sleep\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> protocol_sleep\n" );
PR_ASSERT(NULL != prp);
PR_Lock(prp->lock);
/* we should not go to sleep if there are events available to be processed.
@@ -1016,7 +1016,7 @@
agmt_get_long_name(prp->agmt), prp->eventbits);
}
PR_Unlock(prp->lock);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= protocol_sleep\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= protocol_sleep\n" );
}
@@ -1029,13 +1029,13 @@
static void
event_notify(Private_Repl_Protocol *prp, PRUint32 event)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> event_notify\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> event_notify\n" );
PR_ASSERT(NULL != prp);
PR_Lock(prp->lock);
prp->eventbits |= event;
PR_NotifyCondVar(prp->cvar);
PR_Unlock(prp->lock);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= event_notify\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= event_notify\n" );
}
@@ -1048,26 +1048,26 @@
{
PRUint32 return_value;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> event_occurred\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> event_occurred\n" );
PR_ASSERT(NULL != prp);
PR_Lock(prp->lock);
return_value = (prp->eventbits & event);
prp->eventbits &= ~event; /* Clear event */
PR_Unlock(prp->lock);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= event_occurred\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= event_occurred\n" );
return return_value;
}
static void
reset_events (Private_Repl_Protocol *prp)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> reset_events\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> reset_events\n" );
PR_ASSERT(NULL != prp);
PR_Lock(prp->lock);
prp->eventbits = 0;
PR_Unlock(prp->lock);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= reset_events\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= reset_events\n" );
}
@@ -1075,8 +1075,8 @@
static PRBool
is_dummy_operation (const slapi_operation_parameters *op)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> is_dummy_operation\n", 0, 0, 0 );
- LDAPDebug( LDAP_DEBUG_TRACE, "<= is_dummy_operation\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> is_dummy_operation\n" );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= is_dummy_operation\n" );
return (strcmp (op->target_address.uniqueid, START_ITERATION_ENTRY_UNIQUEID) == 0);
}
@@ -1085,7 +1085,7 @@
void
w_cl5_operation_parameters_done (struct slapi_operation_parameters *sop)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> w_cl5_operation_parameters_done\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> w_cl5_operation_parameters_done\n" );
if(sop!=NULL) {
switch(sop->operation_type)
{
@@ -1120,7 +1120,7 @@
}
}
operation_parameters_done(sop);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= w_cl5_operation_parameters_done\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= w_cl5_operation_parameters_done\n" );
}
@@ -1147,7 +1147,7 @@
RUV *current_ruv = ruv_dup(remote_update_vector);
CSN *mincsn = NULL;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> send_updates\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> send_updates\n" );
*num_changes_sent = 0;
@@ -1445,7 +1445,7 @@
agmt_set_consumer_ruv(prp->agmt,current_ruv);
ruv_destroy(¤t_ruv);
}
- LDAPDebug( LDAP_DEBUG_TRACE, "<= send_updates\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= send_updates\n" );
return return_value;
}
@@ -1462,7 +1462,7 @@
PRIntervalTime start, maxwait, now;
int seconds = 1200;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_stop\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_stop\n" );
maxwait = PR_SecondsToInterval(seconds);
prp->terminate = 1;
@@ -1490,7 +1490,7 @@
agmt_get_long_name(prp->agmt),
PR_IntervalToSeconds(now-start));
}
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_stop\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_stop\n" );
return return_value;
}
@@ -1501,9 +1501,9 @@
{
int return_value = 0;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_status\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_status\n" );
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_status\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_status\n" );
return return_value;
}
@@ -1513,43 +1513,43 @@
static void
windows_inc_notify_update(Private_Repl_Protocol *prp)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_notify_update\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_notify_update\n" );
event_notify(prp, EVENT_TRIGGERING_CRITERIA_MET);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_notify_update\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_notify_update\n" );
}
static void
windows_inc_update_now(Private_Repl_Protocol *prp)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_update_now\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_update_now\n" );
event_notify(prp, EVENT_REPLICATE_NOW);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_update_now\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_update_now\n" );
}
static void
windows_inc_notify_agmt_changed(Private_Repl_Protocol *prp)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_notify_agmt_changed\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_notify_agmt_changed\n" );
event_notify(prp, EVENT_AGMT_CHANGED);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_notify_agmt_changed\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_notify_agmt_changed\n" );
}
static void
windows_inc_notify_window_opened (Private_Repl_Protocol *prp)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_notify_window_opened\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_notify_window_opened\n" );
event_notify(prp, EVENT_WINDOW_OPENED);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_notify_window_opened\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_notify_window_opened\n" );
}
static void
windows_inc_notify_window_closed (Private_Repl_Protocol *prp)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_notify_window_closed\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_notify_window_closed\n" );
event_notify(prp, EVENT_WINDOW_CLOSED);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_notify_window_closed\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_notify_window_closed\n" );
}
@@ -1559,7 +1559,7 @@
windows_inc_private *rip = NULL;
Private_Repl_Protocol *prp = (Private_Repl_Protocol *)slapi_ch_malloc(sizeof(Private_Repl_Protocol));
- LDAPDebug( LDAP_DEBUG_TRACE, "=> Windows_Inc_Protocol_new\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> Windows_Inc_Protocol_new\n" );
prp->delete = windows_inc_delete;
prp->run = windows_inc_run;
@@ -1592,13 +1592,13 @@
prp->private = (void *)rip;
prp->replica_acquired = PR_FALSE;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= Windows_Inc_Protocol_new\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= Windows_Inc_Protocol_new\n" );
return prp;
loser:
windows_inc_delete(&prp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= Windows_Inc_Protocol_new (loser)\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= Windows_Inc_Protocol_new (loser)\n" );
return NULL;
}
@@ -1610,12 +1610,12 @@
{
Private_Repl_Protocol *prp = (Private_Repl_Protocol *)arg;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_backoff_expired\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_backoff_expired\n" );
PR_ASSERT(NULL != prp);
event_notify(prp, EVENT_BACKOFF_EXPIRED);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_backoff_expired\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_backoff_expired\n" );
}
@@ -1641,7 +1641,7 @@
{
int return_value;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_examine_update_vector\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_examine_update_vector\n" );
PR_ASSERT(NULL != prp);
if (NULL == prp)
@@ -1682,7 +1682,7 @@
slapi_ch_free((void**)&remote_gen);
slapi_ch_free((void**)&local_gen);
}
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_examine_update_vector\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_examine_update_vector\n" );
return return_value;
}
@@ -1707,8 +1707,8 @@
static const char*
state2name (int state)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> state2name\n", 0, 0, 0 );
- LDAPDebug( LDAP_DEBUG_TRACE, "<= state2name\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> state2name\n" );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= state2name\n" );
switch (state)
{
case STATE_START: return "start";
@@ -1729,8 +1729,8 @@
static const char*
event2name (int event)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> event2name\n", 0, 0, 0 );
- LDAPDebug( LDAP_DEBUG_TRACE, "<= event2name\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> event2name\n" );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= event2name\n" );
switch (event)
{
case EVENT_WINDOW_OPENED: return "update_window_opened";
@@ -1749,11 +1749,11 @@
static void
periodic_dirsync(time_t when, void *arg)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> periodic_dirsync\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> periodic_dirsync\n" );
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"Running Dirsync \n");
event_notify( (Private_Repl_Protocol*) arg, EVENT_RUN_DIRSYNC);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= periodic_dirsync\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= periodic_dirsync\n" );
}
Index: windows_private.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_private.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- windows_private.c 23 Sep 2008 21:13:22 -0000 1.21
+++ windows_private.c 5 Dec 2008 22:41:52 -0000 1.22
@@ -196,7 +196,7 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_new\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_new\n" );
dp = (Dirsync_Private *)slapi_ch_calloc(sizeof(Dirsync_Private),1);
@@ -204,7 +204,7 @@
dp->directory_filter = NULL;
dp->deleted_filter = NULL;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_new\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_new\n" );
return dp;
}
@@ -213,7 +213,7 @@
{
Dirsync_Private *dp = (Dirsync_Private *) agmt_get_priv(ra);
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_delete\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_delete\n" );
PR_ASSERT(dp != NULL);
@@ -229,7 +229,7 @@
dp->api_cookie = NULL;
slapi_ch_free((void **)dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_delete\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_delete\n" );
}
@@ -237,14 +237,14 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_isnt4\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_isnt4\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_isnt4\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_isnt4\n" );
return dp->isnt4;
}
@@ -253,7 +253,7 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_isnt4\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_isnt4\n" );
PR_ASSERT(ra);
@@ -262,21 +262,21 @@
dp->isnt4 = isit;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_isnt4\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_isnt4\n" );
}
int windows_private_get_iswin2k3(const Repl_Agmt *ra)
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_iswin2k3\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_iswin2k3\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_iswin2k3\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_iswin2k3\n" );
return dp->iswin2k3;
}
@@ -285,7 +285,7 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_iswin2k3\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_iswin2k3\n" );
PR_ASSERT(ra);
@@ -294,7 +294,7 @@
dp->iswin2k3 = isit;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_iswin2k3\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_iswin2k3\n" );
}
/* Returns a copy of the Slapi_Filter pointer. The caller should not free it */
@@ -302,7 +302,7 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_directory_filter\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_directory_filter\n" );
PR_ASSERT(ra);
@@ -316,7 +316,7 @@
slapi_ch_free_string(&string_filter);
}
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_directory_filter\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_directory_filter\n" );
return dp->directory_filter;
}
@@ -326,7 +326,7 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_deleted_filter\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_deleted_filter\n" );
PR_ASSERT(ra);
@@ -340,7 +340,7 @@
slapi_ch_free_string(&string_filter);
}
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_deleted_filter\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_deleted_filter\n" );
return dp->deleted_filter;
}
@@ -350,14 +350,14 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_windows_subtree\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_windows_subtree\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_windows_subtree\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_windows_subtree\n" );
return dp->windows_subtree;
}
@@ -367,14 +367,14 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_windows_domain\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_windows_domain\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_windows_domain\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_windows_domain\n" );
return dp->windows_domain;
}
@@ -384,7 +384,7 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_windows_domain\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_windows_domain\n" );
PR_ASSERT(ra);
@@ -393,7 +393,7 @@
dp->windows_domain = domain;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_windows_domain\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_windows_domain\n" );
}
/* Returns a copy of the Slapi_DN pointer, no need to free it */
@@ -401,14 +401,14 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_directory_replarea\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_directory_replarea\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_directory_replarea\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_directory_replarea\n" );
return dp->directory_subtree;
}
@@ -419,7 +419,7 @@
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_windows_replarea\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_windows_replarea\n" );
PR_ASSERT(ra);
PR_ASSERT(sdn);
@@ -430,7 +430,7 @@
slapi_sdn_free(&dp->windows_subtree);
dp->windows_subtree = sdn;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_windows_replarea\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_windows_replarea\n" );
}
/* Takes a copy of the sdn passed in */
@@ -439,7 +439,7 @@
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_directory_replarea\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_directory_replarea\n" );
PR_ASSERT(ra);
PR_ASSERT(sdn);
@@ -450,20 +450,20 @@
slapi_sdn_free(&dp->directory_subtree);
dp->directory_subtree = sdn;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_directory_replarea\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_directory_replarea\n" );
}
PRBool windows_private_create_users(const Repl_Agmt *ra)
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_create_users\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_create_users\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_create_users\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_create_users\n" );
return dp->create_users_from_dirsync;
@@ -474,7 +474,7 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_create_users\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_create_users\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
@@ -482,7 +482,7 @@
dp->create_users_from_dirsync = value;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_create_users\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_create_users\n" );
}
@@ -490,13 +490,13 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_create_groups\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_create_groups\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_create_groups\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_create_groups\n" );
return dp->create_groups_from_dirsync;
@@ -507,7 +507,7 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_create_groups\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_create_groups\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
@@ -515,7 +515,7 @@
dp->create_groups_from_dirsync = value;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_create_groups\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_create_groups\n" );
}
@@ -533,7 +533,7 @@
Dirsync_Private *dp;
char iscritical = PR_TRUE;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_dirsync_control\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_dirsync_control\n" );
PR_ASSERT(ra);
@@ -551,7 +551,7 @@
ber_free(ber,1);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_dirsync_control\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_dirsync_control\n" );
return control;
@@ -578,7 +578,7 @@
int return_value = LDAP_SUCCESS;
#endif
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_update_dirsync_control\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_update_dirsync_control\n" );
PR_ASSERT(ra);
@@ -636,9 +636,9 @@
}
#ifdef FOR_DEBUGGING
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_update_dirsync_control: rc=%d\n", return_value, 0, 0 );
+ LDAPDebug1Arg( LDAP_DEBUG_TRACE, "<= windows_private_update_dirsync_control: rc=%d\n", return_value);
#else
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_update_dirsync_control\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_update_dirsync_control\n" );
#endif
}
@@ -646,14 +646,14 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_dirsync_has_more\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_dirsync_has_more\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_dirsync_has_more\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_dirsync_has_more\n" );
return dp->dirsync_cookie_has_more;
@@ -663,7 +663,7 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_null_dirsync_control\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_null_dirsync_control\n" );
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
@@ -672,7 +672,7 @@
slapi_ch_free_string(&dp->dirsync_cookie);
dp->dirsync_cookie = NULL;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_null_dirsync_control\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_null_dirsync_control\n" );
}
static
@@ -703,7 +703,7 @@
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_save_dirsync_cookie\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_save_dirsync_cookie\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
@@ -736,7 +736,7 @@
slapi_mods_free(&mods);
slapi_sdn_free(&sdn);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_save_dirsync_cookie\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_save_dirsync_cookie\n" );
return rc;
}
@@ -753,7 +753,7 @@
Slapi_Entry *entry = NULL;
Slapi_Attr *attr = NULL;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_load_dirsync_cookie\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_load_dirsync_cookie\n" );
PR_ASSERT(ra);
dp = (Dirsync_Private *) agmt_get_priv(ra);
@@ -803,7 +803,7 @@
slapi_sdn_free( &sdn);
slapi_pblock_destroy (pb);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_load_dirsync_cookie\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_load_dirsync_cookie\n" );
return rc;
}
@@ -813,12 +813,12 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_raw_entry\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_raw_entry\n" );
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_raw_entry\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_raw_entry\n" );
return dp->raw_entry;
}
@@ -828,7 +828,7 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_raw_entry\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_raw_entry\n" );
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
@@ -836,19 +836,19 @@
slapi_entry_free(dp->raw_entry);
dp->raw_entry = e;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_raw_entry\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_raw_entry\n" );
}
void *windows_private_get_api_cookie(const Repl_Agmt *ra)
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_api_cookie\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_api_cookie\n" );
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_api_cookie\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_api_cookie\n" );
return dp->api_cookie;
}
@@ -857,13 +857,13 @@
{
Dirsync_Private *dp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_api_cookie\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_api_cookie\n" );
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
dp->api_cookie = api_cookie;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_api_cookie\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_api_cookie\n" );
}
/* an array of function pointers */
@@ -875,7 +875,7 @@
void *cookie = NULL;
winsync_plugin_init_cb initfunc = NULL;
- LDAPDebug( LDAP_DEBUG_PLUGIN, "--> windows_plugin_init_start -- begin\n",0,0,0);
+ LDAPDebug0Args( LDAP_DEBUG_PLUGIN, "--> windows_plugin_init_start -- begin\n");
/* if the function pointer array is null, get the functions - we will
call init once per replication agreement, but will only grab the
@@ -884,9 +884,9 @@
(slapi_apib_get_interface(WINSYNC_v1_0_GUID, &_WinSyncAPI) ||
(NULL == _WinSyncAPI)))
{
- LDAPDebug( LDAP_DEBUG_PLUGIN,
+ LDAPDebug1Arg( LDAP_DEBUG_PLUGIN,
"<-- windows_plugin_init_start -- no windows plugin API registered for GUID [%s] -- end\n",
- WINSYNC_v1_0_GUID,0,0);
+ WINSYNC_v1_0_GUID);
return;
}
@@ -897,7 +897,7 @@
}
windows_private_set_api_cookie(ra, cookie);
- LDAPDebug( LDAP_DEBUG_PLUGIN, "<-- windows_plugin_init_start -- end\n",0,0,0);
+ LDAPDebug0Args( LDAP_DEBUG_PLUGIN, "<-- windows_plugin_init_start -- end\n");
return;
}
Index: windows_protocol_util.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- windows_protocol_util.c 24 Sep 2008 22:18:35 -0000 1.42
+++ windows_protocol_util.c 5 Dec 2008 22:41:52 -0000 1.43
@@ -1287,7 +1287,7 @@
break;
default:
slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name, "%s: replay_update: Unknown "
- "operation type %d found in changelog - skipping change.\n",
+ "operation type %lu found in changelog - skipping change.\n",
agmt_get_long_name(prp->agmt), op->operation_type);
}
if (password)
@@ -3878,7 +3878,7 @@
/* We should have been able to map the DN, so this is an error */
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"%s: windows_process_dirsync_entry: failed to map "
- "inbound entry %s - rc is %d dn is [%d].\n",
+ "inbound entry %s - rc is %d dn is [%s].\n",
agmt_get_long_name(prp->agmt),
slapi_sdn_get_dn(slapi_entry_get_sdn_const(e)),
rc,
Index: windows_tot_protocol.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_tot_protocol.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- windows_tot_protocol.c 27 Aug 2008 21:46:56 -0000 1.14
+++ windows_tot_protocol.c 5 Dec 2008 22:41:52 -0000 1.15
@@ -109,7 +109,7 @@
char **attrs = NULL;
LDAPControl **server_controls = NULL;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_tot_run\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_tot_run\n" );
PR_ASSERT(NULL != prp);
@@ -218,7 +218,7 @@
agmt_set_last_init_status(prp->agmt, rc, 0, "Total update aborted");
} else {
slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name, "Finished total update of replica "
- "\"%s\". Sent %d entries.\n", agmt_get_long_name(prp->agmt), cb_data.num_entries);
+ "\"%s\". Sent %lu entries.\n", agmt_get_long_name(prp->agmt), cb_data.num_entries);
agmt_set_last_init_status(prp->agmt, 0, 0, "Total update succeeded");
/* Now update our consumer RUV for this agreement.
* This ensures that future incrememental updates work.
@@ -244,7 +244,7 @@
}
prp->stopped = 1;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_tot_run\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_tot_run\n" );
}
static int
@@ -254,7 +254,7 @@
int seconds = 600;
PRIntervalTime start, maxwait, now;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_tot_stop\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_tot_stop\n" );
prp->terminate = 1;
maxwait = PR_SecondsToInterval(seconds);
@@ -280,7 +280,7 @@
return_value = 0;
}
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_tot_stop\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_tot_stop\n" );
return return_value;
}
@@ -291,8 +291,8 @@
windows_tot_status(Private_Repl_Protocol *prp)
{
int return_value = 0;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_tot_status\n", 0, 0, 0 );
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_tot_status\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_tot_status\n" );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_tot_status\n" );
return return_value;
}
@@ -301,8 +301,8 @@
static void
windows_tot_noop(Private_Repl_Protocol *prp)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_tot_noop\n", 0, 0, 0 );
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_tot_noop\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_tot_noop\n" );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_tot_noop\n" );
/* noop */
}
@@ -313,7 +313,7 @@
windows_tot_private *rip = NULL;
Private_Repl_Protocol *prp = (Private_Repl_Protocol *)slapi_ch_malloc(sizeof(Private_Repl_Protocol));
- LDAPDebug( LDAP_DEBUG_TRACE, "=> Windows_Tot_Protocol_new\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> Windows_Tot_Protocol_new\n" );
prp->delete = windows_tot_delete;
prp->run = windows_tot_run;
@@ -342,28 +342,28 @@
rip->rp = rp;
prp->private = (void *)rip;
prp->replica_acquired = PR_FALSE;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= Windows_Tot_Protocol_new\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= Windows_Tot_Protocol_new\n" );
return prp;
loser:
windows_tot_delete(&prp);
- LDAPDebug( LDAP_DEBUG_TRACE, "<= Windows_Tot_Protocol_new - loser\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= Windows_Tot_Protocol_new - loser\n" );
return NULL;
}
static void
windows_tot_delete(Private_Repl_Protocol **prp)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_tot_delete\n", 0, 0, 0 );
- LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_tot_delete\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_tot_delete\n" );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_tot_delete\n" );
}
static
void get_result (int rc, void *cb_data)
{
- LDAPDebug( LDAP_DEBUG_TRACE, "=> get_result\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> get_result\n" );
PR_ASSERT (cb_data);
((callback_data*)cb_data)->rc = rc;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= get_result\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= get_result\n" );
}
static
@@ -373,7 +373,7 @@
Private_Repl_Protocol *prp;
unsigned long *num_entriesp;
- LDAPDebug( LDAP_DEBUG_TRACE, "=> send_entry\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> send_entry\n" );
PR_ASSERT (cb_data);
@@ -386,13 +386,13 @@
conn_disconnect(prp->conn);
prp->stopped = 1;
((callback_data*)cb_data)->rc = -1;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= send_entry\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= send_entry\n" );
return -1;
}
/* skip ruv tombstone - not relvant to Active Directory */
if (is_ruv_tombstone_entry (e)) {
- LDAPDebug( LDAP_DEBUG_TRACE, "<= send_entry\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= send_entry\n" );
return 0;
}
@@ -401,7 +401,7 @@
(*num_entriesp)++;
- LDAPDebug( LDAP_DEBUG_TRACE, "<= send_entry\n", 0, 0, 0 );
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= send_entry\n" );
if (CONN_OPERATION_SUCCESS == rc) {
return 0;
15 years, 4 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/retrocl retrocl.c, 1.6, 1.7 retrocl_cn.c, 1.5, 1.6 retrocl_po.c, 1.7, 1.8 retrocl_trim.c, 1.8, 1.9
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/retrocl
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13701/ldapserver/ldap/servers/plugins/retrocl
Modified Files:
retrocl.c retrocl_cn.c retrocl_po.c retrocl_trim.c
Log Message:
Resolves: bug 454030
Bug Description: Need to address 64-bit compiler warnings - again
Reviewed by: nhosoi (Thanks!)
Fix Description: This patch cleans up most of the other remaining compiler warnings. I compiled the directory server code with these flags on RHEL5 x86_64: -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
I also enabled argument/format match checking for most of the commonly used varadic functions. Most of the problems I found fell into these categories:
1) Too many or not enough arguments e.g. most everything that uses or did use LDAPDebug had extra 0,0 arguments. If they had been switched to use slapi_log_error, I removed the extra arguments - for those places still using LDAPDebug, I introduced more macros to handle the number of arguments, since C macros cannot be varadic.
2) When using NSPR formatting functions, we have to use %llu or %lld for 64-bit values, even on 64-bit systems. However, for regular system formatting functions, we have to use %ld or %lu. I introduced two new macros NSPRIu64 and NSPRI64 to handle cases where we are passing explicit 64-bit values to NSPR formatting functions, so that we can use the regular PRIu64 and PRI64 macros for regular system formatting functions. I also made sure we used NSPRI* only with NSPR functions, and used PRI* only with system functions.
3) use %lu for size_t and %ld for time_t
I did find a few "real" errors, places that the code was doing something definitely not right:
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
This is why it's important to use this compiler checking, and why it's important to fix compiler warnings, if for no other reason than the sheer noise from so many warnings can mask real errors.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Index: retrocl.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/retrocl/retrocl.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- retrocl.c 10 Nov 2006 23:45:18 -0000 1.6
+++ retrocl.c 5 Dec 2008 22:41:52 -0000 1.7
@@ -221,8 +221,8 @@
operation_free(&op,NULL);
if (err != LDAP_SUCCESS || be == NULL || be == defbackend_get_backend()) {
- LDAPDebug(LDAP_DEBUG_TRACE,"Mapping tree select failed (%d) %s.\n",
- err,errbuf,0);
+ LDAPDebug2Args(LDAP_DEBUG_TRACE,"Mapping tree select failed (%d) %s.\n",
+ err,errbuf);
/* could not find the backend for cn=changelog, either because
* it doesn't exist
@@ -307,7 +307,7 @@
if (rc == 0) {
retrocl_init_trimming();
} else {
- LDAPDebug(LDAP_DEBUG_TRACE,"Couldnt find backend, not trimming retro changelog (%d).\n",rc,0,0);
+ LDAPDebug1Arg(LDAP_DEBUG_TRACE,"Couldnt find backend, not trimming retro changelog (%d).\n",rc);
}
}
Index: retrocl_cn.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/retrocl/retrocl_cn.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- retrocl_cn.c 10 Nov 2006 23:45:18 -0000 1.5
+++ retrocl_cn.c 5 Dec 2008 22:41:52 -0000 1.6
@@ -181,7 +181,7 @@
retrocl_internal_cn = cr.cr_cnum;
- slapi_log_error(SLAPI_LOG_PLUGIN,"retrocl","Got changenumbers %d and %d\n",
+ slapi_log_error(SLAPI_LOG_PLUGIN,"retrocl","Got changenumbers %lu and %lu\n",
retrocl_first_cn,
retrocl_internal_cn);
@@ -379,7 +379,7 @@
retrocl_internal_cn = cr.cr_cnum;
- slapi_log_error(SLAPI_LOG_PLUGIN,"retrocl","Refetched last changenumber = %d \n",
+ slapi_log_error(SLAPI_LOG_PLUGIN,"retrocl","Refetched last changenumber = %lu \n",
retrocl_internal_cn);
slapi_ch_free(( void **) &cr.cr_time );
Index: retrocl_po.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/retrocl/retrocl_po.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- retrocl_po.c 15 Oct 2008 06:29:59 -0000 1.7
+++ retrocl_po.c 5 Dec 2008 22:41:52 -0000 1.8
@@ -179,7 +179,7 @@
PR_ASSERT( changenum > 0UL );
slapi_log_error( SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME,
- "write_replog_db: write change record %d for dn: \"%s\"\n",
+ "write_replog_db: write change record %lu for dn: \"%s\"\n",
changenum, ( dn == NULL ) ? "NULL" : dn );
/* Construct the dn of this change record */
@@ -271,7 +271,7 @@
if ( 0 != rc ) {
slapi_log_error( SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME,
"replog: an error occured while adding change "
- "number %d, dn = %s: %s. \n",
+ "number %lu, dn = %s: %s. \n",
changenum, edn, ldap_err2string( rc ));
retrocl_release_changenumber();
} else {
@@ -484,27 +484,24 @@
(void)slapi_pblock_get( pb, SLAPI_BACKEND, &be );
if (slapi_be_logchanges(be) == 0) {
- LDAPDebug(LDAP_DEBUG_TRACE,"not applying change if not logging\n",
- 0,0,0);
+ LDAPDebug0Args(LDAP_DEBUG_TRACE,"not applying change if not logging\n");
return 0;
}
if (retrocl_be_changelog == NULL || be == retrocl_be_changelog) {
- LDAPDebug(LDAP_DEBUG_TRACE,"not applying change if no/cl be\n",0,0,0);
+ LDAPDebug0Args(LDAP_DEBUG_TRACE,"not applying change if no/cl be\n");
return 0;
}
slapi_pblock_get(pb, SLAPI_RESULT_CODE, &rc);
if (rc != LDAP_SUCCESS) {
- LDAPDebug(LDAP_DEBUG_TRACE,"not applying change if op failed %d\n",rc,
- 0,0);
+ LDAPDebug1Arg(LDAP_DEBUG_TRACE,"not applying change if op failed %d\n",rc);
return 0;
}
if (slapi_op_abandoned(pb)) {
- LDAPDebug(LDAP_DEBUG_PLUGIN,"not applying change if op abandoned\n",
- 0,0,0);
+ LDAPDebug0Args(LDAP_DEBUG_PLUGIN,"not applying change if op abandoned\n");
return 0;
}
@@ -519,12 +516,12 @@
slapi_pblock_get( pb, SLAPI_OPERATION, &op );
if (op == NULL) {
- LDAPDebug(LDAP_DEBUG_TRACE,"not applying change if no op\n",0,0,0);
+ LDAPDebug0Args(LDAP_DEBUG_TRACE,"not applying change if no op\n");
return 0;
}
if (operation_is_flag_set(op, OP_FLAG_TOMBSTONE_ENTRY)){
- LDAPDebug(LDAP_DEBUG_TRACE,"not applying change for nsTombstone entries\n",0,0,0);
+ LDAPDebug0Args(LDAP_DEBUG_TRACE,"not applying change for nsTombstone entries\n");
return 0;
}
Index: retrocl_trim.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/retrocl/retrocl_trim.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- retrocl_trim.c 18 Oct 2007 00:08:32 -0000 1.8
+++ retrocl_trim.c 5 Dec 2008 22:41:52 -0000 1.9
@@ -119,7 +119,7 @@
if ( delrc != LDAP_SUCCESS ) {
slapi_log_error( SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME, "delete_changerecord: could not delete "
- "change record %d\n", cnum );
+ "change record %lu\n", cnum );
} else {
slapi_log_error( SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME,
"delete_changerecord: deleted changelog entry \"%s\"\n", dnbuf);
@@ -312,7 +312,7 @@
}
}
} else {
- LDAPDebug(LDAP_DEBUG_PLUGIN, "not yet time to trim: %d < (%d+%d)\n",
+ LDAPDebug(LDAP_DEBUG_PLUGIN, "not yet time to trim: %ld < (%d+%d)\n",
now,lt,(CHANGELOGDB_TRIM_INTERVAL/1000));
}
PR_Lock( ts.ts_s_trim_mutex );
@@ -366,7 +366,7 @@
int ldrc;
if (retrocl_be_changelog == NULL) {
- LDAPDebug(LDAP_DEBUG_TRACE,"not housekeeping if no cl be\n",0,0,0);
+ LDAPDebug0Args(LDAP_DEBUG_TRACE,"not housekeeping if no cl be\n");
return;
}
@@ -391,7 +391,7 @@
*/
first_time = retrocl_getchangetime( SLAPI_SEQ_FIRST, &ldrc );
LDAPDebug(LDAP_DEBUG_PLUGIN,
- "cltrim: ldrc=%d, first_time=%d, cur_time=%d\n",
+ "cltrim: ldrc=%d, first_time=%ld, cur_time=%ld\n",
ldrc,first_time,cur_time);
if ( LDAP_SUCCESS == ldrc && first_time > (time_t) 0L &&
first_time + ts.ts_c_max_age < cur_time ) {
@@ -399,7 +399,7 @@
}
}
if ( must_trim ) {
- LDAPDebug(LDAP_DEBUG_TRACE,"changelog about to create thread\n",0,0,0);
+ LDAPDebug0Args(LDAP_DEBUG_TRACE,"changelog about to create thread\n");
/* Start a thread to trim the changelog */
ts.ts_s_trimming = 1;
if ( PR_CreateThread( PR_USER_THREAD,
@@ -409,8 +409,8 @@
slapi_log_error( SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME, "unable to create changelog trimming thread\n" );
}
} else {
- LDAPDebug(LDAP_DEBUG_PLUGIN,
- "changelog does not need to be trimmed\n",0,0,0);
+ LDAPDebug0Args(LDAP_DEBUG_PLUGIN,
+ "changelog does not need to be trimmed\n");
}
}
PR_Unlock( ts.ts_s_trim_mutex );
@@ -491,7 +491,7 @@
cl_maxage = retrocl_get_config_str(CONFIG_CHANGELOG_MAXAGE_ATTRIBUTE);
if (cl_maxage == NULL) {
- LDAPDebug(LDAP_DEBUG_TRACE,"No maxage, not trimming retro changelog.\n",0,0,0);
+ LDAPDebug0Args(LDAP_DEBUG_TRACE,"No maxage, not trimming retro changelog.\n");
return;
}
ageval = age_str2time (cl_maxage);
15 years, 4 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/roles roles_cache.c, 1.8, 1.9
by Richard Allen Megginson
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/roles
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13701/ldapserver/ldap/servers/plugins/roles
Modified Files:
roles_cache.c
Log Message:
Resolves: bug 454030
Bug Description: Need to address 64-bit compiler warnings - again
Reviewed by: nhosoi (Thanks!)
Fix Description: This patch cleans up most of the other remaining compiler warnings. I compiled the directory server code with these flags on RHEL5 x86_64: -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
I also enabled argument/format match checking for most of the commonly used varadic functions. Most of the problems I found fell into these categories:
1) Too many or not enough arguments e.g. most everything that uses or did use LDAPDebug had extra 0,0 arguments. If they had been switched to use slapi_log_error, I removed the extra arguments - for those places still using LDAPDebug, I introduced more macros to handle the number of arguments, since C macros cannot be varadic.
2) When using NSPR formatting functions, we have to use %llu or %lld for 64-bit values, even on 64-bit systems. However, for regular system formatting functions, we have to use %ld or %lu. I introduced two new macros NSPRIu64 and NSPRI64 to handle cases where we are passing explicit 64-bit values to NSPR formatting functions, so that we can use the regular PRIu64 and PRI64 macros for regular system formatting functions. I also made sure we used NSPRI* only with NSPR functions, and used PRI* only with system functions.
3) use %lu for size_t and %ld for time_t
I did find a few "real" errors, places that the code was doing something definitely not right:
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserv...
This is why it's important to use this compiler checking, and why it's important to fix compiler warnings, if for no other reason than the sheer noise from so many warnings can mask real errors.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no
Index: roles_cache.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/roles/roles_cache.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- roles_cache.c 15 Oct 2008 06:30:00 -0000 1.8
+++ roles_cache.c 5 Dec 2008 22:41:52 -0000 1.9
@@ -559,7 +559,7 @@
current_role = roles_list;
slapi_log_error( SLAPI_LOG_PLUGIN,
- ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_trigger_update_role: %x \n", roles_list);
+ ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_trigger_update_role: %p \n", roles_list);
/* Go through all the roles list and trigger the associated structure */
@@ -593,7 +593,7 @@
PR_RWLock_Unlock(global_lock);
- slapi_log_error( SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_trigger_update_role: %x \n", roles_list);
+ slapi_log_error( SLAPI_LOG_PLUGIN, ROLES_PLUGIN_SUBSYSTEM, "<-- roles_cache_trigger_update_role: %p \n", roles_list);
}
/* roles_cache_update
@@ -1066,14 +1066,14 @@
role_object *new_role = NULL;
slapi_log_error(SLAPI_LOG_PLUGIN,
- ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_create_role_under: %s - %x\n",
+ ROLES_PLUGIN_SUBSYSTEM, "--> roles_cache_create_role_under: %s - %p\n",
slapi_sdn_get_dn((*roles_cache_suffix)->suffix_dn),
(*roles_cache_suffix)->avl_tree);
rc = roles_cache_create_object_from_entry(entry,&new_role,0);
slapi_log_error(SLAPI_LOG_PLUGIN,
ROLES_PLUGIN_SUBSYSTEM,
- "roles_cache_create_role_under: create node for entry %s - rc: %d SUFFIX: %x\n",
+ "roles_cache_create_role_under: create node for entry %s - rc: %d SUFFIX: %p\n",
slapi_entry_get_dn_const(entry), rc, (*roles_cache_suffix)->avl_tree);
if ( (rc == 0) && new_role)
@@ -1081,7 +1081,7 @@
/* Add to the tree where avl_data is a role_object struct */
rc = roles_cache_insert_object(&((*roles_cache_suffix)->avl_tree),new_role);
slapi_log_error(SLAPI_LOG_PLUGIN,
- ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_role_under:%s in tree %x rc: %d\n",
+ ROLES_PLUGIN_SUBSYSTEM, "roles_cache_create_role_under:%s in tree %p rc: %d\n",
(char*)slapi_sdn_get_ndn(new_role->dn),
(*roles_cache_suffix)->avl_tree, rc);
}
@@ -1351,7 +1351,7 @@
{
slapi_log_error(SLAPI_LOG_PLUGIN,
- ROLES_PLUGIN_SUBSYSTEM, "roles_cache_insert_object: %s in tree %x\n",
+ ROLES_PLUGIN_SUBSYSTEM, "roles_cache_insert_object: %s in tree %p\n",
(char*)slapi_sdn_get_ndn(object->dn),
*tree);
return (avl_insert(tree, (caddr_t)object, roles_cache_node_cmp, avl_dup_error));
@@ -1381,7 +1381,7 @@
static int roles_cache_insert_object_nested(Avlnode **tree, role_object_nested *object)
{
slapi_log_error(SLAPI_LOG_PLUGIN,
- ROLES_PLUGIN_SUBSYSTEM, "roles_cache_insert_object_nested: %s in tree %x: \n",
+ ROLES_PLUGIN_SUBSYSTEM, "roles_cache_insert_object_nested: %s in tree %p: \n",
(char*)slapi_sdn_get_ndn(object->dn), *tree);
return (avl_insert(tree, (caddr_t)object, roles_cache_node_nested_cmp, avl_dup_error));
@@ -2106,7 +2106,7 @@
role_object *this_role = (role_object*)data;
slapi_log_error(SLAPI_LOG_PLUGIN,
- ROLES_PLUGIN_SUBSYSTEM, "roles_cache_dump: %x - %s - %x\n",
+ ROLES_PLUGIN_SUBSYSTEM, "roles_cache_dump: %p - %s - %p\n",
this_role, (char*)slapi_sdn_get_ndn(this_role->dn), this_role->avl_tree);
return 0;
15 years, 4 months