Package: sa-exim
Version: 4.2.1-17
Severity: normal
Tags: patch

Building sa-exim throws lots of warnings like this one:
-------------------
gcc -I/usr/include/exim4 -fPIC -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 
-fdebug-prefix-map=/dev/shm/EXIM4/sa-exim-4.2.1=. -fstack-protector-strong 
-Wformat -Werror=format-security -shared -Wl,-z,relro -o sa-exim.so sa-exim.c
sa-exim.c: In function 'savemail':
sa-exim.c:285:92: warning: format '%d' expects argument of type 'int', but 
argument 5 has type 'long unsigned int' [-Wformat=]
  285 |  log_write(0, LOG_MAIN, "SA: Debug9: Archive body write starts: writing 
up to %d bytes in %d byte blocks", SAmaxarchivebody, sizeof(buffera));
      |                                                                         
                  ~^                                 ~~~~~~~~~~~~~~~
      |                                                                         
                   |                                 |
      |                                                                         
                   int                               long unsigned int
      |                                                                         
                  %ld
-------------------

cu Andreas
--- a/sa-exim.c
+++ b/sa-exim.c
@@ -282,7 +282,7 @@ static int savemail(int readfd, off_t fd
 
     if (SAEximDebug > 8)
     { 
-	log_write(0, LOG_MAIN, "SA: Debug9: Archive body write starts: writing up to %d bytes in %d byte blocks", SAmaxarchivebody, sizeof(buffera));
+	log_write(0, LOG_MAIN, "SA: Debug9: Archive body write starts: writing up to %d bytes in %ld byte blocks", SAmaxarchivebody, sizeof(buffera));
     }
 
     towrite=SAmaxarchivebody;
@@ -1064,7 +1064,7 @@ int local_scan(volatile int fd, uschar *
 	    header_add(' ', "X-SA-Exim-Scanned: No (on %s); SA Timed out after %d secs\n", primary_hostname, SAtimeout);
 
 	    /* We sent it to LOG_REJECT too so that we get a header dump */
-	    log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: spamd took more than %d secs to run, accepting message (scanned in %d/%d secs | Message-Id: %s). %s", SAtimeout, scantime, fulltime, safemesgid, mailinfo);
+	    log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: spamd took more than %d secs to run, accepting message (scanned in %ld/%ld secs | Message-Id: %s). %s", SAtimeout, scantime, fulltime, safemesgid, mailinfo);
 
 	    ret=savemail(fd, fdstart, SAtimeoutsave, "SAtimeoutsave", (char *)mesgfn, SAerrmaxarchivebody, SAtimeoutSavCond);
 	    CHECKERR(ret,where,line);
@@ -1197,7 +1197,8 @@ restart:
 	{
 	    if (SAEximDebug > 5)
 	    {
-		log_write(0, LOG_MAIN, "SA: Debug6: spamc read got newline, end of headers", buffer);
+		//log_write(0, LOG_MAIN, "SA: Debug6: spamc read got newline, end of headers", buffer);
+		log_write(0, LOG_MAIN, "SA: Debug6: spamc read got newline, end of headers");
 	    }
 	    goto exit;
 	}
@@ -1257,7 +1258,7 @@ restart:
 	{
 	    if (SAEximDebug > 8)
 	    {
-		log_write(0, LOG_MAIN, "SA: Debug9: Read body from SA; line %d (read %d)", line, strlen(buffer));
+		log_write(0, LOG_MAIN, "SA: Debug9: Read body from SA; line %d (read %ld)", line, strlen(buffer));
 	    }
 
 	    stret=write(fd, buffer, strlen(buffer));
@@ -1315,7 +1316,7 @@ restart:
     if (gotsa == 0)
     {
 	header_add(' ', "X-SA-Exim-Scanned: No (on %s); Unknown failure\n", primary_hostname);
-	log_write(0, LOG_MAIN, "SA: Action: SA didn't successfully run against message, accepting (time: %d/%d secs | Message-Id: %s). %s", scantime, fulltime, safemesgid, mailinfo);
+	log_write(0, LOG_MAIN, "SA: Action: SA didn't successfully run against message, accepting (time: %ld/%ld secs | Message-Id: %s). %s", scantime, fulltime, safemesgid, mailinfo);
 	return LOCAL_SCAN_ACCEPT;
     }
 
@@ -1401,11 +1402,11 @@ restart:
 
 	    for (i=0;i<SAteergrubetime/10;i++)
 	    {
-		smtp_printf("451-%s\r\n", teergrubewaitstr);
+		smtp_printf("451-%s\r\n", FALSE, teergrubewaitstr);
 		ret=smtp_fflush();
 		if (ret != 0)
 		{
-		    log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: teergrubed sender for %d secs until it closed the connection: %s (scanned in %d/%d secs | Message-Id: %s). %s", i*10, spamstatus, scantime, fulltime, safemesgid, mailinfo);
+		    log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: teergrubed sender for %d secs until it closed the connection: %s (scanned in %ld/%ld secs | Message-Id: %s). %s", i*10, spamstatus, scantime, fulltime, safemesgid, mailinfo);
 		    /* The other side closed the connection, nothing to print */
 		    *return_text="";
 		    return LOCAL_SCAN_TEMPREJECT_NOLOGHDR;
@@ -1413,7 +1414,7 @@ restart:
 		sleep(10);
 	    }
 
-	    log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: teergrubed sender until full configured duration of %d secs: %s (scanned in %d/%d secs | Message-Id: %s). %s", SAteergrubetime, spamstatus, scantime, fulltime, safemesgid, mailinfo);
+	    log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: teergrubed sender until full configured duration of %d secs: %s (scanned in %ld/%ld secs | Message-Id: %s). %s", SAteergrubetime, spamstatus, scantime, fulltime, safemesgid, mailinfo);
 	    *return_text=string_sprintf(SAmsgteergruberej, spamstatus);
 	    return LOCAL_SCAN_TEMPREJECT_NOLOGHDR;
 	}
@@ -1424,7 +1425,7 @@ restart:
 
 	    recipients_count=0;
 	    spamstatus=string_sprintf("%s trigger=%.1f", spamstatus, SAdevnullthreshold);
-	    log_write(0, LOG_REJECT | LOG_MAIN, "SA: Action: silently tossed message: %s (scanned in %d/%d secs | Message-Id: %s). %s", spamstatus, scantime, fulltime, safemesgid, mailinfo);
+	    log_write(0, LOG_REJECT | LOG_MAIN, "SA: Action: silently tossed message: %s (scanned in %ld/%ld secs | Message-Id: %s). %s", spamstatus, scantime, fulltime, safemesgid, mailinfo);
 	    return LOCAL_SCAN_ACCEPT;
 	}
 	else if (dorej && spamvalue >= SApermrejectthreshold)
@@ -1433,7 +1434,7 @@ restart:
 	    CHECKERR(ret,where,line);
 
 	    spamstatus=string_sprintf("%s trigger=%.1f", spamstatus, SApermrejectthreshold);
-	    log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: permanently rejected message: %s (scanned in %d/%d secs | Message-Id: %s). %s", spamstatus, scantime, fulltime, safemesgid, mailinfo);
+	    log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: permanently rejected message: %s (scanned in %ld/%ld secs | Message-Id: %s). %s", spamstatus, scantime, fulltime, safemesgid, mailinfo);
 	    *return_text=string_sprintf(SAmsgpermrej, spamstatus);
 	    return LOCAL_SCAN_REJECT_NOLOGHDR;
 	}
@@ -1447,7 +1448,7 @@ restart:
 	{
 	    ret=savemail(fd, fdstart, SAspamacceptsave, "SAspamacceptsave", (char *)mesgfn, SAmaxarchivebody, SAspamacceptSavCond);
 	    CHECKERR(ret,where,line);
-	    log_write(0, LOG_MAIN, "SA: Action: flagged as Spam but accepted: %s (scanned in %d/%d secs | Message-Id: %s). %s", spamstatus, scantime, fulltime, safemesgid, mailinfo);
+	    log_write(0, LOG_MAIN, "SA: Action: flagged as Spam but accepted: %s (scanned in %ld/%ld secs | Message-Id: %s). %s", spamstatus, scantime, fulltime, safemesgid, mailinfo);
 	    return LOCAL_SCAN_ACCEPT;
 	}
     }
@@ -1476,7 +1477,7 @@ restart:
 	    }
 
 	    spamstatus=string_sprintf("%s trigger=%.1f", spamstatus, SAtemprejectthreshold);
-	    log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: temporarily rejected message: %s (scanned in %d/%d secs | Message-Id: %s). %s", spamstatus, scantime, fulltime, safemesgid, mailinfo);
+	    log_write(0, LOG_MAIN | LOG_REJECT, "SA: Action: temporarily rejected message: %s (scanned in %ld/%ld secs | Message-Id: %s). %s", spamstatus, scantime, fulltime, safemesgid, mailinfo);
 	    *return_text=string_sprintf(SAmsgtemprej, spamstatus);
 	    return LOCAL_SCAN_TEMPREJECT_NOLOGHDR;
 	}
@@ -1484,7 +1485,7 @@ restart:
 	{
 	    ret=savemail(fd, fdstart, SAnotspamsave, "SAnotspamsave", (char *)mesgfn, SAmaxarchivebody, SAnotspamSavCond);
 	    CHECKERR(ret,where,line);
-	    log_write(0, LOG_MAIN, "SA: Action: scanned but message isn't spam: %s (scanned in %d/%d secs | Message-Id: %s). %s", spamstatus, scantime, fulltime, safemesgid, mailinfo);
+	    log_write(0, LOG_MAIN, "SA: Action: scanned but message isn't spam: %s (scanned in %ld/%ld secs | Message-Id: %s). %s", spamstatus, scantime, fulltime, safemesgid, mailinfo);
 	    return LOCAL_SCAN_ACCEPT;
 	}
     }

Reply via email to