Re: [pkg-ntp-maintainers] Bug#653771: FTBFS on kfreebsd-* due to -Wformat-security

2012-01-04 Thread Steven Chamberlain
On 03/01/12 21:51, Peter Eisentraut wrote:
 I think the below is a more correct fix.  Could you check whether it
 works for you?

Hi Peter,

Your suggestion builds okay on kfreebsd-i386, it prevents the
-Wformat-security warning, and it runs fine.

I've copied your patch and mine to upstream to see which way they would
prefer to fix this:  http://bugs.ntp.org/show_bug.cgi?id=2106

Thanks,
Regards,
-- 
Steven Chamberlain
ste...@pyro.eu.org


-- 
To UNSUBSCRIBE, email to debian-bsd-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f05030b.7040...@pyro.eu.org



Re: [pkg-ntp-maintainers] Bug#653771: FTBFS on kfreebsd-* due to -Wformat-security

2012-01-03 Thread Peter Eisentraut
I think the below is a more correct fix.  Could you check whether it
works for you?

--- a/ntpd/refclock_oncore.c
+++ b/ntpd/refclock_oncore.c
@@ -4058,7 +4058,7 @@ oncore_log (
 
snprintf(Msg, sizeof(Msg), ONCORE[%d]: %s, instance-unit,
 msg);
-   syslog(log_level, Msg);
+   syslog(log_level, %s, Msg);
 
i = strlen(msg);
 
--- a/lib/isc/include/isc/msgcat.h
+++ b/lib/isc/include/isc/msgcat.h
@@ -110,7 +110,7 @@ isc_msgcat_close(isc_msgcat_t **msgcatp)
 
 const char *
 isc_msgcat_get(isc_msgcat_t *msgcat, int set, int message,
-  const char *default_text);
+  const char *default_text) __attribute__((format_arg(4)));
 /*%
  * Get message 'message' from message set 'set' in 'msgcat'.  If it
  * is not available, use 'default_text'.



-- 
To UNSUBSCRIBE, email to debian-bsd-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1325627470.19883.2.ca...@vanquo.pezone.net



Re: [pkg-ntp-maintainers] Bug#653771: FTBFS on kfreebsd-* due to -Wformat-security

2011-12-31 Thread Steven Chamberlain
On 31/12/11 20:48, Peter Eisentraut wrote:
 On fre, 2011-12-30 at 23:29 +, Steven Chamberlain wrote:
 My new patch (attached) fixes only those parts, and I am now able to
 build successfully on kfreebsd-i386.
 
 Why did you change printf to fprintf(stdout, ...)?

Hi,

I saw it written that way in other code, functionally it would be
identical, so I was just trying to be consistent, e.g.:

./ntpd/refclock_jupiter.c:903:  fprintf(stdout, %s: , function);

But actually use of printf seems more common overall... I should
probably have kept it the same.

Regards,
-- 
Steven Chamberlain
ste...@pyro.eu.org


-- 
To UNSUBSCRIBE, email to debian-bsd-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4eff784a.1090...@pyro.eu.org



Re: [pkg-ntp-maintainers] Bug#653771: FTBFS on kfreebsd-* due to -Wformat-security

2011-12-31 Thread Peter Eisentraut
On fre, 2011-12-30 at 23:29 +, Steven Chamberlain wrote:
 My new patch (attached) fixes only those parts, and I am now able to
 build successfully on kfreebsd-i386.

Why did you change printf to fprintf(stdout, ...)?


-- 
To UNSUBSCRIBE, email to debian-bsd-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1325364488.8243.1.ca...@vanquo.pezone.net



Re: Bug#653771: FTBFS on kfreebsd-* due to -Wformat-security

2011-12-30 Thread Steven Chamberlain
On 30/12/11 21:49, Steven Chamberlain wrote:
 ntp is now failing to build on the kfreebsd-* arches.

Argh!  I had the wrong version of the source package.  Most of the fixes
in my last mail are already applied (as per #542721, #627403) -- but
there are two places where some (apparently kfreebsd-specific) code was
not covered by Colin Watson's existing format-security.patch

This explains why build failures occurred only on kfreebsd arches.

My new patch (attached) fixes only those parts, and I am now able to
build successfully on kfreebsd-i386.

Thanks!

Regards,
-- 
Steven Chamberlain
ste...@pyro.eu.org
Index: ntp-4.2.6.p3+dfsg/lib/isc/unix/ifiter_sysctl.c
===
--- ntp-4.2.6.p3+dfsg.orig/lib/isc/unix/ifiter_sysctl.c	2010-12-25 09:40:35.0 +
+++ ntp-4.2.6.p3+dfsg/lib/isc/unix/ifiter_sysctl.c	2011-12-30 20:30:25.0 +
@@ -272,10 +272,11 @@
 
 		return (ISC_R_SUCCESS);
 	} else {
-		printf(isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERSYSCTL,
-  ISC_MSG_UNEXPECTEDTYPE,
-  warning: unexpected interface list 
-  message type\n));
+		fprintf(stdout, %s,
+		isc_msgcat_get(isc_msgcat, ISC_MSGSET_IFITERSYSCTL,
+   ISC_MSG_UNEXPECTEDTYPE,
+   warning: unexpected interface list 
+   message type\n));
 		return (ISC_R_IGNORE);
 	}
 }
Index: ntp-4.2.6.p3+dfsg/ntpd/refclock_oncore.c
===
--- ntp-4.2.6.p3+dfsg.orig/ntpd/refclock_oncore.c	2010-12-25 09:40:34.0 +
+++ ntp-4.2.6.p3+dfsg/ntpd/refclock_oncore.c	2011-12-30 20:37:33.0 +
@@ -4058,7 +4058,7 @@
 
 	snprintf(Msg, sizeof(Msg), ONCORE[%d]: %s, instance-unit,
 		 msg);
-	syslog(log_level, Msg);
+	syslog(log_level, %s, Msg);
 
 	i = strlen(msg);